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(_boundary_names.size())
35 mfem::common::AttrToMarker(
42 mfem::Array<int> attributes(boundary_names.size());
45 boundary_names.begin(),
48 [&
mesh](
const BoundaryName & boundary) ->
int 53 return std::stoi(boundary);
58 auto & boundary_ids =
mesh.bdr_attribute_sets.GetAttributeSet(boundary);
59 if (boundary_ids.Size() != 1)
61 "There should be a 1-to-1 correspondence between boundary name and boundary ID");
62 return boundary_ids[0];
const mfem::ParMesh & getMesh()
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
T * get(const std::unique_ptr< T > &u)
The MooseUtils::get() specializations are used to support making forwards-compatible code changes fro...
static InputParameters validParams()
mfem::Array< int > _boundary_markers
Boolean array indicating which boundaries are active in this object.
std::vector< BoundaryName > _boundary_names
Stores the names of the boundaries.
const mfem::ParMesh & _mfem_mesh
Stores the names of the boundaries.
mfem::Array< int > boundariesToAttributes(const std::vector< BoundaryName > &boundary_names)
MFEMBoundaryRestrictable(const InputParameters ¶meters, const mfem::ParMesh &mfem_mesh)
mfem::Array< int > _boundary_attributes
Array storing boundary attribute IDs for this object.