10#ifdef MOOSE_MFEM_ENABLED
19 params.
addParam<std::vector<BoundaryName>>(
22 "The list of boundaries (ids or names) from the mesh where this object applies. "
23 "Defaults to all boundaries.");
28 const mfem::ParMesh & mfem_mesh)
29 : _mfem_mesh(mfem_mesh),
30 _boundary_names(parameters.get<
std::vector<BoundaryName>>(
"boundary")),
31 _boundary_attributes(boundariesToAttributes())
34 mfem::common::AttrToMarker(
47 [&
mesh](
const BoundaryName & boundary) ->
int
52 return std::stoi(boundary);
57 auto & boundary_ids =
mesh.bdr_attribute_sets.GetAttributeSet(boundary);
58 if (boundary_ids.Size() != 1)
60 "There should be a 1-to-1 correspondence between boundary name and boundary ID");
61 return boundary_ids[0];
67std::vector<std::string>
71 std::vector<std::string> strs(attrs.Size());
72 std::transform(attrs.begin(), attrs.end(), strs.begin(), [](
int n) { return std::to_string(n); });
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
mfem::Array< int > _boundary_attributes
Array storing boundary attribute IDs for this object.
mfem::Array< int > boundariesToAttributes()
std::vector< BoundaryName > _boundary_names
Stores the names of the boundaries.
mfem::Array< int > _boundary_markers
Boolean array indicating which boundaries are active in this object.
std::vector< std::string > boundariesToStrings()
const mfem::ParMesh & getMesh()
MFEMBoundaryRestrictable(const InputParameters ¶meters, const mfem::ParMesh &mfem_mesh)
const mfem::ParMesh & _mfem_mesh
Stores the names of the boundaries.
static InputParameters validParams()