26 _my_pid(processor_id()),
27 _point(getParam<Point>(
"point")),
29 _min_distance(
std::numeric_limits<Real>::max()),
30 _closest_node(nullptr),
59 const Real dist = ((*_current_node) -
_point).norm();
74 : std::numeric_limits<dof_id_type>::max();
99 if (!nnn._closest_node)
registerMooseObject("MooseApp", NearestNodeNumberUO)
Finds the nearest node to a given point.
const Node * _closest_node
Nearest node on this processor.
dof_id_type getClosestNodeId() const
Returns the ID of the nearest node.
virtual void threadJoin(const UserObject &y) override
Must override.
Real _min_distance
Minimum distance for nodes on this processor.
virtual void execute() override
Execute method.
dof_id_type _overall_best_id
Node number of closest node, over the whole mesh.
NearestNodeNumberUO(const InputParameters ¶meters)
static InputParameters validParams()
virtual void meshChanged() override
Called on this object when the mesh changes.
bool _node_found
Whether the nearest node on this processor has been found (this is used to reduce unnecessary re-comp...
const Point & _point
The point.
const processor_id_type _my_pid
processor ID of this object
const Node * getClosestNode() const
Returns a const pointer to the closest node over the entire mesh, if that node is owned by this proce...
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
virtual void finalize() override
Finalize.
A user object that runs over all the nodes and does an aggregation step to compute a single value.
const Node *const & _current_node
Reference to current node pointer.
static InputParameters validParams()
void gatherMin(T &value)
Gather the parallel min of the variable passed in.
Base class for user-specific data.