12 #include "libmesh/elem.h" 21 params.
addRequiredParam<std::vector<MeshDivisionName>>(
"divisions",
"Nested divisions");
27 for (
const auto & div_name :
getParam<std::vector<MeshDivisionName>>(
"divisions"))
30 paramError(
"divisions",
"You cannot pass an empty vector of divisions");
53 if (!division->coversEntireMesh())
63 unsigned int index = 0;
64 unsigned int running_product = 1;
68 index +=
_divisions[N_divs - 1 - i]->divisionIndex(elem) * running_product;
69 running_product *=
_num_divs[N_divs - 1 - i];
77 unsigned int index = 0;
78 unsigned int running_product = 1;
82 index +=
_divisions[N_divs - 1 - i]->divisionIndex(pt) * running_product;
83 running_product *=
_num_divs[N_divs - 1 - i];
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
registerMooseObject("MooseApp", NestedDivision)
std::vector< unsigned int > _num_divs
Vector of the number of divisions for each nested division.
Divides the mesh based on nested divisions.
Base class for MeshDivision objects.
MeshDivision & getMeshDivision(const std::string &name, const THREAD_ID tid=0) const
Get a MeshDivision.
const std::string & name() const
Get the name of the class.
static InputParameters validParams()
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.
NestedDivision(const InputParameters ¶meters)
const FEProblemBase *const _fe_problem
Pointer to the problem, needed to retrieve pointers to various objects.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
virtual unsigned int divisionIndex(const Point &pt) const override
Return the index of the division to which the point belongs.
virtual void initialize() override
Set up any data members that would be necessary to obtain the division indices.
static InputParameters validParams()
Class constructor.
auto index_range(const T &sizable)
std::vector< const MeshDivision * > _divisions
Vector of nested divisions. Indexing is more and more 'inner' as we progress in the vector...