12 #include "libmesh/parallel_algebra.h" 25 params.
set<
bool>(
"auto_sort") =
true;
27 params.
set<
bool>(
"auto_broadcast") =
true;
54 for (
const auto elem_id : elems_ids)
72 mooseAssert(
initialized(
false),
"Positions vector has not been initialized.");
88 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()
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
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.
static InputParameters validParams()
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) ...
std::unique_ptr< KDTree > _positions_kd_tree
FEProblemBase & _fe_problem
Reference to the FEProblemBase for this user object.
registerMooseObject("MooseApp", NodePositions)
An interface that restricts an object to subdomains via the 'blocks' input parameter.
virtual MooseMesh & mesh() override
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...