10 #ifdef MOOSE_MFEM_ENABLED 18 std::vector<MFEMVectorCoefficientName>
21 std::vector<MFEMVectorCoefficientName> result;
22 bool in_literal =
false;
23 MFEMVectorCoefficientName literal;
24 for (
const auto & item : input)
28 if (item.front() ==
'{')
29 mooseError(
"Nested numeric vector values are not permitted in " 30 "MFEMGenericFunctorVectoMaterial prop_values.");
31 else if (item.back() ==
'}')
34 literal +=
" " + item.substr(0, item.size() - 1);
35 result.push_back(literal);
38 literal +=
" " + item;
40 else if (item.front() ==
'{')
42 if (item.back() ==
'}')
43 result.push_back(item.substr(1, item.size() - 2));
47 literal = item.substr(1);
51 result.push_back(item);
54 mooseError(
"No closing curly brace for vector value in " 55 "MFEMGenericFunctorVectorMaterial prop_values: '{" +
64 params.
addClassDescription(
"Declares material vector properties based on names and coefficients " 65 "prescribed by input parameters.");
67 "prop_names",
"The names of the properties this material will have");
70 "The corresponding names of coefficients associated with the named properties");
78 _prop_names(getParam<
std::vector<
std::string>>(
"prop_names")),
83 paramError(
"prop_names",
"Must match the size of prop_values");
Moose::MFEM::CoefficientManager & _properties
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
mfem::VectorCoefficient & declareVectorProperty(const std::string &name, const std::vector< std::string > &blocks, const std::string &existing_or_literal)
Use an existing vector coefficient for a property on some blocks of the mesh.
Declares material properties based on names and functions prescribed by input parameters.
static InputParameters validParams()
const std::vector< std::string > & _prop_names
registerMooseObject("MooseApp", MFEMGenericFunctorVectorMaterial)
std::vector< MFEMVectorCoefficientName > processLiteralVectors(const std::vector< MFEMVectorCoefficientName > &input)
Handle any numerical vector values, which should be enclosed in curly braces.
std::vector< std::string > subdomainsToStrings(const std::vector< SubdomainName > &subdomain_names)
std::vector< SubdomainName > _subdomain_names
Stores the names of the subdomains.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
MFEMGenericFunctorVectorMaterial(const InputParameters ¶meters)
auto index_range(const T &sizable)
virtual ~MFEMGenericFunctorVectorMaterial()
static InputParameters validParams()
const std::vector< MFEMVectorCoefficientName > _prop_values