109#ifdef MOOSE_MFEM_ENABLED
153 if (names.size() != 2)
154 throw std::invalid_argument(
"invalid syntax in ReporterName parameter " + field.fullpath() +
155 ": supplied name '" + val +
"' must contain the '/' delimiter");
156 return {names[0], names[1]};
166 const auto vec = field.param<std::vector<double>>();
167 if (vec.size() != LIBMESH_DIM)
169 " parameter '" + field.fullpath() +
"': was given " +
170 std::to_string(vec.size()) +
" component(s) but should have " +
171 std::to_string(LIBMESH_DIM));
174 value(d) = Real(vec[d]);
182 registry.
add<RealVectorValue>([](RealVectorValue & value,
const hit::Field & field)
194 [](RealEigenVector & value,
const hit::Field & field)
196 const auto vec = field.param<std::vector<double>>();
197 value.resize(vec.size());
198 for (
const auto i : index_range(vec))
199 value(i) = Real(vec[i]);
203 [](RealEigenMatrix & value,
const hit::Field & field)
206 std::vector<std::string> tokens;
209 for (
const auto i : index_range(tokens))
213 if (!MooseUtils::tokenizeAndConvert<Real>(
token,
values))
214 throw std::invalid_argument(
"invalid syntax for parameter: " + field.fullpath() +
"[" +
215 std::to_string(i) +
"]='" +
token +
"'");
217 value.resize(tokens.size(),
values.size());
218 else if (libMesh::cast_int<std::size_t>(value.cols()) !=
values.size())
219 throw std::invalid_argument(
"matrix is not square for parameter " + field.fullpath());
220 for (
const auto j : index_range(
values))
226 { value = field.param<std::string>(); });
237 [](RealTensorValue & value,
const hit::Field & field)
239 const auto vec = field.param<std::vector<double>>();
240 if (vec.size() != LIBMESH_DIM * LIBMESH_DIM)
241 throw std::invalid_argument(
"invalid RealTensorValue parameter '" + field.fullpath() +
242 "': size is " + std::to_string(vec.size()) +
" but should be " +
243 std::to_string(LIBMESH_DIM * LIBMESH_DIM));
247 value(i, j) = Real(vec[i * LIBMESH_DIM + j]);
262 const auto vec = field.param<std::vector<double>>();
264 if (vec.size() % LIBMESH_DIM)
265 throw std::invalid_argument(
"wrong number of values in vector parameter '" + field.fullpath() +
266 "': size " + std::to_string(vec.size()) +
" is not a multiple of " +
267 std::to_string(LIBMESH_DIM));
269 const std::size_t size = vec.size() / LIBMESH_DIM;
271 for (
const auto i : make_range(size))
273 value[i](d) = vec[i * LIBMESH_DIM + d];
278 registry.
add<std::vector<Point>>([](std::vector<Point> & value,
const hit::Field & field)
282 [](std::vector<RealVectorValue> & value,
const hit::Field & field)
291 [](std::vector<MooseEnum> & value,
const hit::Field & field)
293 mooseAssert(!value.empty(),
"Missing a value to initialize on");
298 const auto vec = field.param<std::vector<std::string>>();
299 value.resize(vec.size(), value[0]);
300 for (
const auto i : index_range(vec))
305 [](std::vector<MultiMooseEnum> & value,
const hit::Field & field)
307 mooseAssert(!value.empty(),
"Missing a value to initialize on");
310 for (
const auto i : index_range(tokens))
312 const auto & entry = tokens[i];
314 throw std::invalid_argument(
"entry " + std::to_string(i) +
" in '" + field.fullpath() +
317 value.resize(tokens.size(), value[0]);
318 for (
const auto i : index_range(tokens))
320 std::vector<std::string> strvals;
321 MooseUtils::tokenize<std::string>(tokens[i], strvals, 1,
" ");
327 [](std::vector<ReporterName> & value,
const hit::Field & field)
330 const auto names = field.param<std::vector<std::string>>();
331 value.resize(names.size());
332 for (
const auto i : index_range(names))
337 [](std::vector<CLIArgString> & value,
const hit::Field & field)
340 const auto strvals = field.param<std::vector<std::string>>();
345 value.resize(strvals.size());
348 unsigned int i_param = 0;
349 bool vector_param_detected =
false;
350 for (
const auto i : index_range(strvals))
353 const auto double_split =
355 const auto single_split =
357 if (double_split.size() + single_split.size() >= 3)
360 if ((double_split.size() + single_split.size()) % 2 == 1)
361 vector_param_detected = !vector_param_detected;
364 if (vector_param_detected)
365 value[i_param] += strvals[i] +
' ';
368 value[i_param] += strvals[i];
373 value.resize(i_param);
383 const auto strval = field.param<std::string>();
386 std::vector<std::string> tokens;
388 value.resize(tokens.size());
391 std::vector<std::vector<double>> vecvec(tokens.size());
392 for (
const auto i : index_range(tokens))
393 if (!MooseUtils::tokenizeAndConvert<double>(tokens[i], vecvec[i]))
394 throw std::invalid_argument(
"invalid format for parameter '" + field.fullpath() +
395 "' at index " + std::to_string(i));
397 for (
const auto i : index_range(vecvec))
399 const auto & vec = vecvec[i];
400 if (vec.size() % LIBMESH_DIM)
401 throw std::invalid_argument(
402 "wrong number of values in double-indexed vector component parameter '" +
403 field.fullpath() +
"' at index " + std::to_string(i) +
": subcomponent size " +
404 std::to_string(vec.size()) +
" is not a multiple of " + std::to_string(LIBMESH_DIM));
408 value.resize(vecvec.size());
409 for (
const auto i : index_range(vecvec))
411 const auto & vec_entry = vecvec[i];
412 auto & value_entry = value[i];
413 const std::size_t size = vec_entry.size() / LIBMESH_DIM;
414 value_entry.resize(size);
415 for (
const auto j : make_range(size))
417 value_entry[j](d) = vec_entry[j * LIBMESH_DIM + d];
423 [](std::vector<std::vector<Point>> & value,
const hit::Field & field)
427 [](std::vector<std::vector<RealVectorValue>> & value,
const hit::Field & field)