109#ifdef MOOSE_MFEM_ENABLED
150 if (names.size() != 2)
151 throw std::invalid_argument(
"invalid syntax in ReporterName parameter " + field.fullpath() +
152 ": supplied name '" + val +
"' must contain the '/' delimiter");
153 return {names[0], names[1]};
163 const auto vec = field.param<std::vector<double>>();
164 if (vec.size() != LIBMESH_DIM)
166 " parameter '" + field.fullpath() +
"': was given " +
167 std::to_string(vec.size()) +
" component(s) but should have " +
168 std::to_string(LIBMESH_DIM));
171 value(d) = Real(vec[d]);
179 registry.
add<RealVectorValue>([](RealVectorValue & value,
const hit::Field & field)
191 [](RealEigenVector & value,
const hit::Field & field)
193 const auto vec = field.param<std::vector<double>>();
194 value.resize(vec.size());
195 for (
const auto i : index_range(vec))
196 value(i) = Real(vec[i]);
200 [](RealEigenMatrix & value,
const hit::Field & field)
203 std::vector<std::string> tokens;
206 for (
const auto i : index_range(tokens))
210 if (!MooseUtils::tokenizeAndConvert<Real>(
token,
values))
211 throw std::invalid_argument(
"invalid syntax for parameter: " + field.fullpath() +
"[" +
212 std::to_string(i) +
"]='" +
token +
"'");
214 value.resize(tokens.size(),
values.size());
215 else if (libMesh::cast_int<std::size_t>(value.cols()) !=
values.size())
216 throw std::invalid_argument(
"matrix is not square for parameter " + field.fullpath());
217 for (
const auto j : index_range(
values))
223 { value = field.param<std::string>(); });
234 [](RealTensorValue & value,
const hit::Field & field)
236 const auto vec = field.param<std::vector<double>>();
237 if (vec.size() != LIBMESH_DIM * LIBMESH_DIM)
238 throw std::invalid_argument(
"invalid RealTensorValue parameter '" + field.fullpath() +
239 "': size is " + std::to_string(vec.size()) +
" but should be " +
240 std::to_string(LIBMESH_DIM * LIBMESH_DIM));
244 value(i, j) = Real(vec[i * LIBMESH_DIM + j]);
259 const auto vec = field.param<std::vector<double>>();
261 if (vec.size() % LIBMESH_DIM)
262 throw std::invalid_argument(
"wrong number of values in vector parameter '" + field.fullpath() +
263 "': size " + std::to_string(vec.size()) +
" is not a multiple of " +
264 std::to_string(LIBMESH_DIM));
266 const std::size_t size = vec.size() / LIBMESH_DIM;
268 for (
const auto i : make_range(size))
270 value[i](d) = vec[i * LIBMESH_DIM + d];
275 registry.
add<std::vector<Point>>([](std::vector<Point> & value,
const hit::Field & field)
279 [](std::vector<RealVectorValue> & value,
const hit::Field & field)
288 [](std::vector<MooseEnum> & value,
const hit::Field & field)
290 mooseAssert(!value.empty(),
"Missing a value to initialize on");
295 const auto vec = field.param<std::vector<std::string>>();
296 value.resize(vec.size(), value[0]);
297 for (
const auto i : index_range(vec))
302 [](std::vector<MultiMooseEnum> & value,
const hit::Field & field)
304 mooseAssert(!value.empty(),
"Missing a value to initialize on");
307 for (
const auto i : index_range(tokens))
309 const auto & entry = tokens[i];
311 throw std::invalid_argument(
"entry " + std::to_string(i) +
" in '" + field.fullpath() +
314 value.resize(tokens.size(), value[0]);
315 for (
const auto i : index_range(tokens))
317 std::vector<std::string> strvals;
318 MooseUtils::tokenize<std::string>(tokens[i], strvals, 1,
" ");
324 [](std::vector<ReporterName> & value,
const hit::Field & field)
327 const auto names = field.param<std::vector<std::string>>();
328 value.resize(names.size());
329 for (
const auto i : index_range(names))
334 [](std::vector<CLIArgString> & value,
const hit::Field & field)
337 const auto strvals = field.param<std::vector<std::string>>();
342 value.resize(strvals.size());
345 unsigned int i_param = 0;
346 bool vector_param_detected =
false;
347 for (
const auto i : index_range(strvals))
350 const auto double_split =
352 const auto single_split =
354 if (double_split.size() + single_split.size() >= 3)
357 if ((double_split.size() + single_split.size()) % 2 == 1)
358 vector_param_detected = !vector_param_detected;
361 if (vector_param_detected)
362 value[i_param] += strvals[i] +
' ';
365 value[i_param] += strvals[i];
370 value.resize(i_param);
380 const auto strval = field.param<std::string>();
383 std::vector<std::string> tokens;
385 value.resize(tokens.size());
388 std::vector<std::vector<double>> vecvec(tokens.size());
389 for (
const auto i : index_range(tokens))
390 if (!MooseUtils::tokenizeAndConvert<double>(tokens[i], vecvec[i]))
391 throw std::invalid_argument(
"invalid format for parameter '" + field.fullpath() +
392 "' at index " + std::to_string(i));
394 for (
const auto i : index_range(vecvec))
396 const auto & vec = vecvec[i];
397 if (vec.size() % LIBMESH_DIM)
398 throw std::invalid_argument(
399 "wrong number of values in double-indexed vector component parameter '" +
400 field.fullpath() +
"' at index " + std::to_string(i) +
": subcomponent size " +
401 std::to_string(vec.size()) +
" is not a multiple of " + std::to_string(LIBMESH_DIM));
405 value.resize(vecvec.size());
406 for (
const auto i : index_range(vecvec))
408 const auto & vec_entry = vecvec[i];
409 auto & value_entry = value[i];
410 const std::size_t size = vec_entry.size() / LIBMESH_DIM;
411 value_entry.resize(size);
412 for (
const auto j : make_range(size))
414 value_entry[j](d) = vec_entry[j * LIBMESH_DIM + d];
420 [](std::vector<std::vector<Point>> & value,
const hit::Field & field)
424 [](std::vector<std::vector<RealVectorValue>> & value,
const hit::Field & field)