22 params.
set<
bool>(
"auto_sort") =
false;
24 params.
set<
bool>(
"auto_broadcast") =
true;
48 unsigned int b_index = 0;
49 for (
const auto & sub_id :
blockIDs())
51 for (
const auto & elem :
_mesh.
getMesh().active_local_subdomain_elements_ptr_range(sub_id))
53 auto centroid = elem->true_centroid();
64 for (
const auto & elem :
_mesh.
getMesh().active_local_element_ptr_range())
ElementCentroidPositions(const InputParameters ¶meters)
unsigned int numBlocks() const
Return the number of blocks for this object.
static InputParameters validParams()
registerMooseObject("MooseApp", ElementCentroidPositions)
Positions from centroids of elements in the mesh.
void clearPositions()
Clear all positions vectors.
static InputParameters validParams()
Positions objects are under the hood Reporters.
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.
bool _initialized
Whether the positions object has been initialized. This must be set by derived objects.
static InputParameters validParams()
std::vector< std::vector< Point > > _positions_2d
2D storage for all the positions
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
std::vector< Point > & _positions
For now, only the 1D vector will be shared across all ranks.
virtual void initialize() override
In charge of computing / loading the positions.
An interface that restricts an object to subdomains via the 'blocks' input parameter.
virtual void finalize() override
In charge of reduction across all ranks & sorting for consistent output.