https://mooseframework.inl.gov
NearestNodeNumberUO.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include "NodalUserObject.h"
13 
19 {
20 public:
22 
24 
25  virtual void meshChanged() override;
26  virtual void initialize() override;
27  virtual void execute() override;
28  virtual void finalize() override;
29  virtual void threadJoin(const UserObject & y) override;
30 
33 
39  const Node * getClosestNode() const;
40 
41 private:
44 
46  const Point & _point;
47 
50 
53 
55  const Node * _closest_node;
56 
59 };
virtual void execute() override
Execute method.
bool _node_found
Whether the nearest node on this processor has been found (this is used to reduce unnecessary re-comp...
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual void meshChanged() override
Called on this object when the mesh changes.
dof_id_type _overall_best_id
Node number of closest node, over the whole mesh.
const Node * getClosestNode() const
Returns a const pointer to the closest node over the entire mesh, if that node is owned by this proce...
A user object that runs over all the nodes and does an aggregation step to compute a single value...
uint8_t processor_id_type
NearestNodeNumberUO(const InputParameters &parameters)
Finds the nearest node to a given point.
virtual void threadJoin(const UserObject &y) override
Must override.
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void finalize() override
Finalize.
const InputParameters & parameters() const
Get the parameters of the object.
Real _min_distance
Minimum distance for nodes on this processor.
dof_id_type getClosestNodeId() const
Returns the ID of the nearest node.
const Node * _closest_node
Nearest node on this processor.
const Point & _point
The point.
Base class for user-specific data.
Definition: UserObject.h:40
uint8_t dof_id_type
static InputParameters validParams()
const processor_id_type _my_pid
processor ID of this object