Finds the nearest node to each node in boundary1 to each node in boundary2 and the other way around. More...
#include <NearestNodeLocator.h>
Classes | |
class | NearestNodeInfo |
Data structure used to hold nearest node info. More... | |
Public Member Functions | |
NearestNodeLocator (SubProblem &subproblem, MooseMesh &mesh, BoundaryID boundary1, BoundaryID boundary2) | |
~NearestNodeLocator () | |
void | findNodes () |
This is the main method that is going to start the search. More... | |
void | reinit () |
Completely redo the search from scratch. More... | |
Real | distance (dof_id_type node_id) |
Valid to call this after findNodes() has been called to get the distance to the nearest node. More... | |
const Node * | nearestNode (dof_id_type node_id) |
Valid to call this after findNodes() has been called to get a pointer to the nearest node. More... | |
std::vector< dof_id_type > & | secondaryNodes () |
Returns the list of secondary nodes this Locator is tracking. More... | |
NodeIdRange & | secondaryNodeRange () |
Returns the NodeIdRange of secondary nodes to be used for calling threaded functions operating on the secondary nodes. More... | |
void | updatePatch (std::vector< dof_id_type > &secondary_nodes) |
Reconstructs the KDtree, updates the patch for the nodes in secondary_nodes, and updates the closest neighbor for these nodes in nearest node info. More... | |
void | updateGhostedElems () |
Updates the ghosted elements at the start of the time step for iterion patch update strategy. More... | |
PerfGraph & | perfGraph () |
Get the PerfGraph. More... | |
Static Public Member Functions | |
static InputParameters | validParams () |
Public Attributes | |
std::map< dof_id_type, NearestNodeInfo > | _nearest_node_info |
BoundaryID | _boundary1 |
BoundaryID | _boundary2 |
bool | _first |
bool | _reinit_iteration |
std::vector< dof_id_type > | _secondary_nodes |
std::map< dof_id_type, std::vector< dof_id_type > > | _neighbor_nodes |
const Moose::PatchUpdateType | _patch_update_strategy |
Real | _max_patch_percentage |
std::vector< dof_id_type > | _new_ghosted_elems |
Static Public Attributes | |
static const unsigned int | _patch_size |
Protected Member Functions | |
template<typename T , typename... Args> | |
T & | declareRestartableData (const std::string &data_name, Args &&... args) |
Declare a piece of data as "restartable" and initialize it. More... | |
template<typename T , typename... Args> | |
ManagedValue< T > | declareManagedRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args) |
Declares a piece of "managed" restartable data and initialize it. More... | |
template<typename T , typename... Args> | |
const T & | getRestartableData (const std::string &data_name) const |
Declare a piece of data as "restartable" and initialize it Similar to declareRestartableData but returns a const reference to the object. More... | |
template<typename T , typename... Args> | |
T & | declareRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args) |
Declare a piece of data as "restartable" and initialize it. More... | |
template<typename T , typename... Args> | |
T & | declareRecoverableData (const std::string &data_name, Args &&... args) |
Declare a piece of data as "recoverable" and initialize it. More... | |
template<typename T , typename... Args> | |
T & | declareRestartableDataWithObjectName (const std::string &data_name, const std::string &object_name, Args &&... args) |
Declare a piece of data as "restartable". More... | |
template<typename T , typename... Args> | |
T & | declareRestartableDataWithObjectNameWithContext (const std::string &data_name, const std::string &object_name, void *context, Args &&... args) |
Declare a piece of data as "restartable". More... | |
std::string | restartableName (const std::string &data_name) const |
Gets the name of a piece of restartable data given a data name, adding the system name and object name prefix. More... | |
PerfID | registerTimedSection (const std::string §ion_name, const unsigned int level) const |
Call to register a named section for timing. More... | |
PerfID | registerTimedSection (const std::string §ion_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const |
Call to register a named section for timing. More... | |
std::string | timedSectionName (const std::string §ion_name) const |
Protected Attributes | |
SubProblem & | _subproblem |
MooseMesh & | _mesh |
std::unique_ptr< NodeIdRange > | _secondary_node_range |
MooseApp & | _restartable_app |
Reference to the application. More... | |
const std::string | _restartable_system_name |
The system name this object is in. More... | |
const THREAD_ID | _restartable_tid |
The thread ID for this object. More... | |
const bool | _restartable_read_only |
Flag for toggling read only status (see ReporterData) More... | |
MooseApp & | _pg_moose_app |
The MooseApp that owns the PerfGraph. More... | |
const std::string | _prefix |
A prefix to use for all sections. More... | |
Finds the nearest node to each node in boundary1 to each node in boundary2 and the other way around.
Definition at line 24 of file NearestNodeLocator.h.
NearestNodeLocator::NearestNodeLocator | ( | SubProblem & | subproblem, |
MooseMesh & | mesh, | ||
BoundaryID | boundary1, | ||
BoundaryID | boundary2 | ||
) |
Definition at line 26 of file NearestNodeLocator.C.
|
default |
|
protectedinherited |
Declares a piece of "managed" restartable data and initialize it.
Here, "managed" restartable data means that the caller can destruct this data upon destruction of the return value of this method. Therefore, this ManagedValue<T> wrapper should survive after the final calls to dataStore() for it. That is... at the very end.
This is needed for objects whose destruction ordering is important, and enables natural c++ destruction in reverse construction order of the object that declares it.
See delcareRestartableData and declareRestartableDataWithContext for more information.
Definition at line 276 of file Restartable.h.
|
protectedinherited |
Declare a piece of data as "recoverable" and initialize it.
This means that in the event of a restart this piece of data will be restored back to its previous value.
Note - this data will NOT be restored on Restart!
NOTE: This returns a reference! Make sure you store it in a reference!
data_name | The name of the data (usually just use the same name as the member variable) |
args | Arguments to forward to the constructor of the data |
Definition at line 351 of file Restartable.h.
|
protectedinherited |
Declare a piece of data as "restartable" and initialize it.
This means that in the event of a restart this piece of data will be restored back to its previous value.
NOTE: This returns a reference! Make sure you store it in a reference!
data_name | The name of the data (usually just use the same name as the member variable) |
args | Arguments to forward to the constructor of the data |
Definition at line 269 of file Restartable.h.
|
protectedinherited |
Declare a piece of data as "restartable" and initialize it.
This means that in the event of a restart this piece of data will be restored back to its previous value.
NOTE: This returns a reference! Make sure you store it in a reference!
data_name | The name of the data (usually just use the same name as the member variable) |
context | Context pointer that will be passed to the load and store functions |
args | Arguments to forward to the constructor of the data |
Definition at line 294 of file Restartable.h.
|
protectedinherited |
Declare a piece of data as "restartable".
This means that in the event of a restart this piece of data will be restored back to its previous value.
NOTE: This returns a reference! Make sure you store it in a reference!
data_name | The name of the data (usually just use the same name as the member variable) |
object_name | A supplied name for the object that is declaring this data. |
args | Arguments to forward to the constructor of the data |
Definition at line 323 of file Restartable.h.
|
protectedinherited |
Declare a piece of data as "restartable".
This means that in the event of a restart this piece of data will be restored back to its previous value.
NOTE: This returns a reference! Make sure you store it in a reference!
data_name | The name of the data (usually just use the same name as the member variable) |
object_name | A supplied name for the object that is declaring this data. |
context | Context pointer that will be passed to the load and store functions |
args | Arguments to forward to the constructor of the data |
Definition at line 333 of file Restartable.h.
Real NearestNodeLocator::distance | ( | dof_id_type | node_id | ) |
Valid to call this after findNodes() has been called to get the distance to the nearest node.
Definition at line 233 of file NearestNodeLocator.C.
Referenced by NearestNodeDistanceAux::computeValue(), findNodes(), and updatePatch().
void NearestNodeLocator::findNodes | ( | ) |
This is the main method that is going to start the search.
If this is the first time through we're going to build up a "neighborhood" of nodes surrounding each of the secondary nodes. This will speed searching later.
Definition at line 63 of file NearestNodeLocator.C.
Referenced by reinit(), and GeometricSearchData::update().
|
protectedinherited |
Declare a piece of data as "restartable" and initialize it Similar to declareRestartableData
but returns a const reference to the object.
Forwarded arguments are not allowed in this case because we assume that the object is restarted and we won't need different constructors to initialize it.
NOTE: This returns a const reference! Make sure you store it in a const reference!
data_name | The name of the data (usually just use the same name as the member variable) |
Definition at line 287 of file Restartable.h.
const Node * NearestNodeLocator::nearestNode | ( | dof_id_type | node_id | ) |
Valid to call this after findNodes() has been called to get a pointer to the nearest node.
Definition at line 239 of file NearestNodeLocator.C.
Referenced by NearestNodeValueAux::computeValue(), and PenetrationThread::operator()().
|
inherited |
Get the PerfGraph.
Definition at line 78 of file PerfGraphInterface.C.
Referenced by CommonOutputAction::act(), PerfGraphData::finalize(), and PerfGraphOutput::output().
|
protectedinherited |
Call to register a named section for timing.
section_name | The name of the code section to be timed |
level | The importance of the timer - lower is more important (0 will always come out) |
Definition at line 53 of file PerfGraphInterface.C.
|
protectedinherited |
Call to register a named section for timing.
section_name | The name of the code section to be timed |
level | The importance of the timer - lower is more important (0 will always come out) |
live_message | The message to be printed to the screen during execution |
print_dots | Whether or not progress dots should be printed for this section |
Definition at line 64 of file PerfGraphInterface.C.
void NearestNodeLocator::reinit | ( | ) |
Completely redo the search from scratch.
Most likely called because of mesh adaptivity.
Definition at line 207 of file NearestNodeLocator.C.
Referenced by GeometricSearchData::clearNearestNodeLocators(), and GeometricSearchData::reinit().
|
protectedinherited |
Gets the name of a piece of restartable data given a data name, adding the system name and object name prefix.
This should only be used in this interface and in testing.
Definition at line 66 of file Restartable.C.
Referenced by Restartable::declareRecoverableData(), and Restartable::declareRestartableDataHelper().
|
inline |
Returns the NodeIdRange of secondary nodes to be used for calling threaded functions operating on the secondary nodes.
Definition at line 64 of file NearestNodeLocator.h.
Referenced by PenetrationLocator::detectPenetration().
|
inline |
Returns the list of secondary nodes this Locator is tracking.
Definition at line 58 of file NearestNodeLocator.h.
|
protectedinherited |
section_name
.Optionally adds a prefix if one is defined.
Definition at line 47 of file PerfGraphInterface.C.
Referenced by PerfGraphInterface::registerTimedSection().
void NearestNodeLocator::updateGhostedElems | ( | ) |
Updates the ghosted elements at the start of the time step for iterion patch update strategy.
Definition at line 358 of file NearestNodeLocator.C.
Referenced by GeometricSearchData::updateGhostedElems().
void NearestNodeLocator::updatePatch | ( | std::vector< dof_id_type > & | secondary_nodes | ) |
Reconstructs the KDtree, updates the patch for the nodes in secondary_nodes, and updates the closest neighbor for these nodes in nearest node info.
Definition at line 245 of file NearestNodeLocator.C.
Referenced by PenetrationLocator::detectPenetration().
|
staticinherited |
Definition at line 16 of file PerfGraphInterface.C.
BoundaryID NearestNodeLocator::_boundary1 |
Definition at line 100 of file NearestNodeLocator.h.
Referenced by findNodes(), and updatePatch().
BoundaryID NearestNodeLocator::_boundary2 |
Definition at line 101 of file NearestNodeLocator.h.
Referenced by findNodes().
bool NearestNodeLocator::_first |
Definition at line 103 of file NearestNodeLocator.h.
Referenced by findNodes(), and reinit().
Real NearestNodeLocator::_max_patch_percentage |
Definition at line 121 of file NearestNodeLocator.h.
Referenced by findNodes(), GeometricSearchData::maxPatchPercentage(), and updatePatch().
|
protected |
Definition at line 93 of file NearestNodeLocator.h.
Referenced by findNodes(), and updatePatch().
std::map<dof_id_type, NearestNodeInfo> NearestNodeLocator::_nearest_node_info |
Definition at line 98 of file NearestNodeLocator.h.
Referenced by distance(), findNodes(), nearestNode(), reinit(), and updatePatch().
std::map<dof_id_type, std::vector<dof_id_type> > NearestNodeLocator::_neighbor_nodes |
Definition at line 112 of file NearestNodeLocator.h.
Referenced by findNodes(), reinit(), and updatePatch().
std::vector<dof_id_type> NearestNodeLocator::_new_ghosted_elems |
Definition at line 124 of file NearestNodeLocator.h.
Referenced by reinit(), updateGhostedElems(), and updatePatch().
|
static |
Definition at line 115 of file NearestNodeLocator.h.
const Moose::PatchUpdateType NearestNodeLocator::_patch_update_strategy |
Definition at line 118 of file NearestNodeLocator.h.
Referenced by findNodes().
|
protectedinherited |
The MooseApp that owns the PerfGraph.
Definition at line 124 of file PerfGraphInterface.h.
Referenced by PerfGraphInterface::perfGraph().
|
protectedinherited |
A prefix to use for all sections.
Definition at line 127 of file PerfGraphInterface.h.
Referenced by PerfGraphInterface::timedSectionName().
bool NearestNodeLocator::_reinit_iteration |
Definition at line 108 of file NearestNodeLocator.h.
Referenced by findNodes(), and reinit().
|
protectedinherited |
Reference to the application.
Definition at line 227 of file Restartable.h.
Referenced by Restartable::registerRestartableDataOnApp(), and Restartable::registerRestartableNameWithFilterOnApp().
|
protectedinherited |
Flag for toggling read only status (see ReporterData)
Definition at line 236 of file Restartable.h.
Referenced by Restartable::registerRestartableDataOnApp().
|
protectedinherited |
The system name this object is in.
Definition at line 230 of file Restartable.h.
Referenced by Restartable::restartableName().
|
protectedinherited |
The thread ID for this object.
Definition at line 233 of file Restartable.h.
Referenced by Restartable::declareRestartableDataHelper().
|
protected |
Definition at line 95 of file NearestNodeLocator.h.
Referenced by findNodes(), reinit(), and secondaryNodeRange().
std::vector<dof_id_type> NearestNodeLocator::_secondary_nodes |
Definition at line 110 of file NearestNodeLocator.h.
Referenced by NonlinearSystemBase::constraintJacobians(), NonlinearSystemBase::constraintResiduals(), findNodes(), NonlinearSystemBase::overwriteNodeFace(), reinit(), secondaryNodes(), and NonlinearSystemBase::setConstraintSecondaryValues().
|
protected |
Definition at line 91 of file NearestNodeLocator.h.
Referenced by findNodes(), updateGhostedElems(), and updatePatch().