108#ifdef MOOSE_MFEM_ENABLED
149 if (names.size() != 2)
150 throw std::invalid_argument(
"invalid syntax in ReporterName parameter " + field.fullpath() +
151 ": supplied name '" + val +
"' must contain the '/' delimiter");
152 return {names[0], names[1]};
162 const auto vec = field.param<std::vector<double>>();
163 if (vec.size() != LIBMESH_DIM)
165 " parameter '" + field.fullpath() +
"': was given " +
166 std::to_string(vec.size()) +
" component(s) but should have " +
167 std::to_string(LIBMESH_DIM));
170 value(d) = Real(vec[d]);
178 registry.
add<RealVectorValue>([](RealVectorValue & value,
const hit::Field & field)
190 [](RealEigenVector & value,
const hit::Field & field)
192 const auto vec = field.param<std::vector<double>>();
193 value.resize(vec.size());
194 for (
const auto i : index_range(vec))
195 value(i) = Real(vec[i]);
199 [](RealEigenMatrix & value,
const hit::Field & field)
202 std::vector<std::string> tokens;
205 for (
const auto i : index_range(tokens))
209 if (!MooseUtils::tokenizeAndConvert<Real>(
token,
values))
210 throw std::invalid_argument(
"invalid syntax for parameter: " + field.fullpath() +
"[" +
211 std::to_string(i) +
"]='" +
token +
"'");
213 value.resize(tokens.size(),
values.size());
214 else if (libMesh::cast_int<std::size_t>(value.cols()) !=
values.size())
215 throw std::invalid_argument(
"matrix is not square for parameter " + field.fullpath());
216 for (
const auto j : index_range(
values))
222 { value = field.param<std::string>(); });
233 [](RealTensorValue & value,
const hit::Field & field)
235 const auto vec = field.param<std::vector<double>>();
236 if (vec.size() != LIBMESH_DIM * LIBMESH_DIM)
237 throw std::invalid_argument(
"invalid RealTensorValue parameter '" + field.fullpath() +
238 "': size is " + std::to_string(vec.size()) +
" but should be " +
239 std::to_string(LIBMESH_DIM * LIBMESH_DIM));
243 value(i, j) = Real(vec[i * LIBMESH_DIM + j]);
258 const auto vec = field.param<std::vector<double>>();
260 if (vec.size() % LIBMESH_DIM)
261 throw std::invalid_argument(
"wrong number of values in vector parameter '" + field.fullpath() +
262 "': size " + std::to_string(vec.size()) +
" is not a multiple of " +
263 std::to_string(LIBMESH_DIM));
265 const std::size_t size = vec.size() / LIBMESH_DIM;
267 for (
const auto i : make_range(size))
269 value[i](d) = vec[i * LIBMESH_DIM + d];
274 registry.
add<std::vector<Point>>([](std::vector<Point> & value,
const hit::Field & field)
278 [](std::vector<RealVectorValue> & value,
const hit::Field & field)
287 [](std::vector<MooseEnum> & value,
const hit::Field & field)
289 mooseAssert(!value.empty(),
"Missing a value to initialize on");
294 const auto vec = field.param<std::vector<std::string>>();
295 value.resize(vec.size(), value[0]);
296 for (
const auto i : index_range(vec))
301 [](std::vector<MultiMooseEnum> & value,
const hit::Field & field)
303 mooseAssert(!value.empty(),
"Missing a value to initialize on");
306 for (
const auto i : index_range(tokens))
308 const auto & entry = tokens[i];
310 throw std::invalid_argument(
"entry " + std::to_string(i) +
" in '" + field.fullpath() +
313 value.resize(tokens.size(), value[0]);
314 for (
const auto i : index_range(tokens))
316 std::vector<std::string> strvals;
317 MooseUtils::tokenize<std::string>(tokens[i], strvals, 1,
" ");
323 [](std::vector<ReporterName> & value,
const hit::Field & field)
326 const auto names = field.param<std::vector<std::string>>();
327 value.resize(names.size());
328 for (
const auto i : index_range(names))
333 [](std::vector<CLIArgString> & value,
const hit::Field & field)
336 const auto strvals = field.param<std::vector<std::string>>();
341 value.resize(strvals.size());
344 unsigned int i_param = 0;
345 bool vector_param_detected =
false;
346 for (
const auto i : index_range(strvals))
349 const auto double_split =
351 const auto single_split =
353 if (double_split.size() + single_split.size() >= 3)
356 if ((double_split.size() + single_split.size()) % 2 == 1)
357 vector_param_detected = !vector_param_detected;
360 if (vector_param_detected)
361 value[i_param] += strvals[i] +
' ';
364 value[i_param] += strvals[i];
369 value.resize(i_param);
379 const auto strval = field.param<std::string>();
382 std::vector<std::string> tokens;
384 value.resize(tokens.size());
387 std::vector<std::vector<double>> vecvec(tokens.size());
388 for (
const auto i : index_range(tokens))
389 if (!MooseUtils::tokenizeAndConvert<double>(tokens[i], vecvec[i]))
390 throw std::invalid_argument(
"invalid format for parameter '" + field.fullpath() +
391 "' at index " + std::to_string(i));
393 for (
const auto i : index_range(vecvec))
395 const auto & vec = vecvec[i];
396 if (vec.size() % LIBMESH_DIM)
397 throw std::invalid_argument(
398 "wrong number of values in double-indexed vector component parameter '" +
399 field.fullpath() +
"' at index " + std::to_string(i) +
": subcomponent size " +
400 std::to_string(vec.size()) +
" is not a multiple of " + std::to_string(LIBMESH_DIM));
404 value.resize(vecvec.size());
405 for (
const auto i : index_range(vecvec))
407 const auto & vec_entry = vecvec[i];
408 auto & value_entry = value[i];
409 const std::size_t size = vec_entry.size() / LIBMESH_DIM;
410 value_entry.resize(size);
411 for (
const auto j : make_range(size))
413 value_entry[j](d) = vec_entry[j * LIBMESH_DIM + d];
419 [](std::vector<std::vector<Point>> & value,
const hit::Field & field)
423 [](std::vector<std::vector<RealVectorValue>> & value,
const hit::Field & field)