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)))
registerMooseObject("MooseApp", BoundaryPreservedMarker)
static InputParameters validParams()
BoundaryID _preserved_boundary
virtual MarkerValue computeElementMarker() override
bool preserveBoundary(const Elem *const &_current_elem)
BoundaryPreservedMarker(const InputParameters ¶meters)
static InputParameters validParams()
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"...
MooseMesh & _mesh
Reference to the mesh, obtained from the subproblem.
const std::string & type() const
Get the type of this class.
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
void errorIfDistributedMesh(std::string name) const
Generate a unified error message if the underlying libMesh mesh is a DistributedMesh.
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.