20 "Marks all elements with sides on a given boundary for refinement/coarsening");
24 "mark", marker_states,
"How to mark elements adjacent to the boundary.");
26 "Boundaries to refine elements along");
27 params.
addParam<
Real>(
"distance", 0.0,
"Distance from the boundary to refine within");
33 _distance(getParam<
Real>(
"distance")),
34 _bnd_elem_ids(_mesh.getBoundariesToActiveSemiLocalElemIds()),
36 _boundary_ids(_mesh.
getBoundaryIDs(getParam<
std::vector<BoundaryName>>(
"next_to")))
39 mooseWarning(
"Elements with in `distance ` of a boundary segment on a different processor " 40 "might not get marked when running with a distributed mesh.");
61 for (
const auto id : it->second)
69 const auto r =
_current_elem->vertex_average() - elem->vertex_average();
virtual Elem * elemPtr(const dof_id_type i)
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"...
virtual MarkerValue computeElementMarker() override
BoundaryMarker(const InputParameters ¶meters)
void mooseWarning(Args &&... args) const
Emits a warning prefixed with object name and type.
const std::vector< BoundaryID > _boundary_ids
boundary near which to mark elements
static InputParameters validParams()
Marks all elements near a given boundary for refinement/coarsening.
const Real _distance
distance from the boundary (centroid of boundary element to centroid of marked element) ...
MooseMesh & _mesh
Reference to the mesh, obtained from the subproblem.
registerMooseObject("MooseApp", BoundaryMarker)
static MooseEnum markerStates()
Helper function for getting the valid refinement flag states a marker can use as a MooseEnum...
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
const MarkerValue _mark
which way to mark elements near the boundary
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.
const std::unordered_map< boundary_id_type, std::unordered_set< dof_id_type > > & _bnd_elem_ids
lists of boundary elements for all boundaries
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
bool isBoundaryElem(dof_id_type elem_id) const
Returns true if the requested element is in the list of boundary elements, false otherwise.
virtual bool isDistributedMesh() const
Returns the final Mesh distribution type.