12 #include "libmesh/parallel_algebra.h" 26 params.
set<
bool>(
"auto_sort") =
true;
28 params.
set<
bool>(
"auto_broadcast") =
true;
37 _mesh(_subproblem.
mesh())
51 const BoundaryInfo * binfo =
nullptr;
64 if (!binfo->get_nodeset_map().count(node))
68 for (
const auto [_, nodeset_id] :
as_range(binfo->get_nodeset_map().equal_range(node)))
78 for (
const auto elem_id : elems_ids)
96 mooseAssert(
initialized(
false),
"Positions vector has not been initialized.");
112 mooseAssert(
comm().verify(
_positions),
"Positions should be the same across all MPI processes.");
void allgather(const T &send_data, std::vector< T, A > &recv_data) const
static InputParameters validParams()
virtual bool boundaryRestricted() const
Returns true if this object has been restricted to a boundary.
Positions from nodes of elements in the mesh.
void clearPositions()
Clear all positions vectors.
Positions objects are under the hood Reporters.
virtual const Node * queryNodePtr(const dof_id_type i) const
virtual void initialize() override
In charge of computing / loading the positions.
const Parallel::Communicator & comm() const
/class BoundaryRestrictable /brief Provides functionality for limiting the object to certain boundary...
const Parallel::Communicator & _communicator
virtual const Node & nodeRef(const dof_id_type i) const
virtual Elem * queryElemPtr(const dof_id_type i)
bool _initialized
Whether the positions object has been initialized. This must be set by derived objects.
static InputParameters validParams()
virtual void finalize() override
In charge of reduction across all ranks & sorting for consistent output.
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
static InputParameters validParams()
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
NodePositions(const InputParameters ¶meters)
std::vector< Point > & _positions
For now, only the 1D vector will be shared across all ranks.
bool initialized(bool initial) const
Whether the positions object has been initialized.
bool _need_broadcast
Whether generation of positions is distributed or not (and therefore needs a broadcast) ...
static InputParameters validParams()
bool hasBoundary(const BoundaryName &name) const
Test if the supplied boundary name is valid for this object.
std::unique_ptr< KDTree > _positions_kd_tree
registerMooseObject("MooseApp", NodePositions)
An interface that restricts an object to subdomains via the 'blocks' input parameter.
bool hasBlocks(const SubdomainName &name) const
Test if the supplied block name is valid for this object.
const std::map< dof_id_type, std::vector< dof_id_type > > & nodeToElemMap()
If not already created, creates a map from every node to all elements to which they are connected...