10 #ifdef MOOSE_MFEM_ENABLED 21 params.
addParam<std::vector<SubdomainName>>(
"block",
23 "The list of subdomains (names or ids) that this " 24 "object will be restricted to. Leave empty to apply " 25 "to all subdomains.");
30 const mfem::ParMesh & mfem_mesh)
31 : _mfem_mesh(mfem_mesh),
32 _subdomain_names(parameters.
get<
std::vector<SubdomainName>>(
"block")),
33 _subdomain_attributes(subdomainsToAttributes())
36 mfem::common::AttrToMarker(
43 mfem::Array<int> attributes;
51 const int attribute_id = std::stoi(subdomain_name);
52 attributes.Append(attribute_id);
57 auto & subdomain_ids =
mesh.attribute_sets.GetAttributeSet(subdomain_name);
58 for (
const auto & subdomain_id : subdomain_ids)
59 attributes.Append(subdomain_id);
65 std::vector<std::string>
69 std::vector<std::string> strs(attrs.Size());
70 std::transform(attrs.begin(), attrs.end(), strs.begin(), [](
int n) {
return std::to_string(n); });
const mfem::ParMesh & _mfem_mesh
Stores the names of the subdomains.
std::vector< SubdomainName > _subdomain_names
Stores the names of the subdomains.
mfem::Array< int > subdomainsToAttributes()
mfem::Array< int > _subdomain_markers
Boolean array indicating which subdomains are active in this object.
std::vector< std::string > subdomainsToStrings()
mfem::Array< int > _subdomain_attributes
Array storing subdomain attribute IDs for this object.
static InputParameters validParams()
MFEMBlockRestrictable(const InputParameters ¶meters, const mfem::ParMesh &mfem_mesh)
const mfem::ParMesh & getMesh() const
const Elem & get(const ElemType type_in)