14 #include "libmesh/error_vector.h" 24 "The name of the boundary to be preserved. Will try to preserve the boundary during AMR");
26 "marker",
"The marker name to decide whether to carsen or refine elements.");
27 params.
addClassDescription(
"Marks elements for refinement or coarsening based on the provided " 28 "marker value, while preserving the given boundary.");
34 _marker_name(parameters.
get<MarkerName>(
"marker")),
35 _marker(&getMarkerValue(_marker_name))
38 BoundaryName boundary_name = getParam<BoundaryName>(
"preserved_boundary");
40 mooseAssert(boundary_ids.size() == 1,
"Boundary does not exist");
47 auto & elem_side_bnd_ids =
_mesh.
getMesh().get_boundary_info().get_sideset_map();
50 for (
const auto & pr :
as_range(elem_side_bnd_ids.equal_range(current_elem)))
static InputParameters validParams()
T * get(const std::unique_ptr< T > &u)
The MooseUtils::get() specializations are used to support making forwards-compatible code changes fro...
const Elem *const & _current_elem
Pointer to the current element being considered in the marker element-based loop. ...
MarkerValue
This mirrors the main refinement flag values in libMesh in Elem::RefinementState but adds "dont_mark"...
bool preserveBoundary(const Elem *const &_current_elem)
void errorIfDistributedMesh(std::string name) const
Generate a unified error message if the underlying libMesh mesh is a DistributedMesh.
BoundaryID _preserved_boundary
MooseMesh & _mesh
Reference to the mesh, obtained from the subproblem.
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
const std::string & type() const
Get the type of this class.
std::vector< BoundaryID > getBoundaryIDs(const libMesh::MeshBase &mesh, const std::vector< BoundaryName > &boundary_name, bool generate_unknown, const std::set< BoundaryID > &mesh_boundary_ids)
Gets the boundary IDs with their names.
virtual MarkerValue computeElementMarker() override
BoundaryPreservedMarker(const InputParameters ¶meters)
static InputParameters validParams()
registerMooseObject("MooseApp", BoundaryPreservedMarker)