13 #include "libmesh/mesh_base.h" 14 #include "libmesh/elem.h" 24 "Divide the mesh by increasing subdomain ids. The division will be contiguously " 25 "numbered even if the subdomain ids are not");
42 const auto & subdomain_ids =
blockIDs();
45 for (
const auto sub_id : subdomain_ids)
54 for (
const auto sub_id : subdomain_ids)
77 std::set<const Elem *> candidates;
78 (*pl)(pt, candidates);
81 const Elem * elem =
nullptr;
83 for (
const auto elem_ptr : candidates)
84 if (elem_ptr->subdomain_id() < min_sub_id)
87 min_sub_id = elem_ptr->subdomain_id();
SubdomainsDivision(const InputParameters ¶meters)
static InputParameters validParams()
virtual const std::set< SubdomainID > & blockIDs() const
Return the block subdomain ids for this object Note, if this is not block restricted, this function returns all mesh subdomain ids.
virtual bool blockRestricted() const
Returns true if this object has been restricted to a block.
registerMooseObject("MooseApp", SubdomainsDivision)
Base class for MeshDivision objects.
const MooseMesh & _mesh
Mesh that is being divided.
static InputParameters validParams()
const SubdomainID INVALID_BLOCK_ID
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
unsigned int INVALID_DIVISION_INDEX
Invalid subdomain id to return when outside the mesh division.
bool _mesh_fully_indexed
Whether the mesh is fully covered / indexed, all elements and points have a valid index...
void setNumDivisions(const unsigned int ndivs)
Set the number of divisions.
const std::vector< SubdomainName > & blocks() const
Return the block names for this object.
virtual void initialize() override
Set up any data members that would be necessary to obtain the division indices.
Divides the mesh based on the subdomains.
An interface that restricts an object to subdomains via the 'blocks' input parameter.
virtual unsigned int divisionIndex(const Point &pt) const override
Return the index of the division to which the point belongs.
std::vector< SubdomainID > getSubdomainIDs(const std::vector< SubdomainName > &subdomain_name) const
Get the associated subdomainIDs for the subdomain names that are passed in.
static InputParameters validParams()
Class constructor.
std::unordered_map< SubdomainID, unsigned int > _subdomain_ids_to_division_index
Map from subdomain ids to division index. Created on calls to initialize()