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())
registerMooseObject("MooseApp", ElementCentroidPositions)
An interface that restricts an object to subdomains via the 'blocks' input parameter.
virtual const std::set< SubdomainID > & blockIDs() const
Return the block subdomain ids for this object Note, if this is not block restricted,...
unsigned int numBlocks() const
Return the number of blocks for this object.
virtual bool blockRestricted() const
Returns true if this object has been restricted to a block.
static InputParameters validParams()
Positions from centroids of elements in the mesh.
virtual void initialize() override
In charge of computing / loading the positions.
ElementCentroidPositions(const InputParameters ¶meters)
static InputParameters validParams()
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Positions objects are under the hood Reporters.
std::vector< std::vector< Point > > _positions_2d
2D storage for all the positions
void clearPositions()
Clear all positions vectors.
std::vector< Point > & _positions
For now, only the 1D vector will be shared across all ranks.
static InputParameters validParams()
virtual void finalize() override
In charge of reduction across all ranks & sorting for consistent output.
bool _initialized
Whether the positions object has been initialized. This must be set by derived objects.