www.mooseframework.org
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
PenetrationLocator Class Reference

#include <PenetrationLocator.h>

Inheritance diagram for PenetrationLocator:
[legend]

Public Types

enum  NORMAL_SMOOTHING_METHOD { NSM_EDGE_BASED, NSM_NODAL_NORMAL_BASED }
 

Public Member Functions

 PenetrationLocator (SubProblem &subproblem, GeometricSearchData &geom_search_data, MooseMesh &mesh, const unsigned int primary_id, const unsigned int secondary_id, Order order, NearestNodeLocator &nearest_node)
 
 ~PenetrationLocator ()
 
void detectPenetration ()
 
void reinit ()
 Completely redo the search from scratch. More...
 
Real penetrationDistance (dof_id_type node_id)
 
RealVectorValue penetrationNormal (dof_id_type node_id)
 
Real normDistance (const Elem &elem, const Elem &side, const Node &p0, Point &closest_point, RealVectorValue &normal)
 
int intersect2D_Segments (Point S1P0, Point S1P1, Point S2P0, Point S2P1, Point *I0, Point *I1)
 
int inSegment (Point P, Point SP0, Point SP1)
 
void setCheckWhetherReasonable (bool state)
 
void setUpdate (bool update)
 
void setTangentialTolerance (Real tangential_tolerance)
 
void setNormalSmoothingDistance (Real normal_smoothing_distance)
 
void setNormalSmoothingMethod (std::string nsmString)
 
Real getTangentialTolerance ()
 
PerfGraphperfGraph ()
 Get the PerfGraph. More...
 

Static Public Member Functions

static InputParameters validParams ()
 

Public Attributes

SubProblem_subproblem
 
MooseMesh_mesh
 
BoundaryID _primary_boundary
 
BoundaryID _secondary_boundary
 
FEType _fe_type
 
std::vector< std::vector< FEBase * > > _fe
 
NearestNodeLocator_nearest_node
 
std::map< dof_id_type, PenetrationInfo * > & _penetration_info
 Data structure of nodes and their associated penetration information. More...
 
std::set< dof_id_type > & _has_penetrated
 

Protected Member Functions

PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 Call to register a named section for timing. More...
 
PerfID registerTimedSection (const std::string &section_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 &section_name) const
 

Protected Attributes

bool _check_whether_reasonable
 Check whether found candidates are reasonable. More...
 
bool & _update_location
 
Real _tangential_tolerance
 
bool _do_normal_smoothing
 
Real _normal_smoothing_distance
 
NORMAL_SMOOTHING_METHOD _normal_smoothing_method
 
const Moose::PatchUpdateType _patch_update_strategy
 
MooseApp_pg_moose_app
 The MooseApp that owns the PerfGraph. More...
 
const std::string _prefix
 A prefix to use for all sections. More...
 

Private 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...
 

Private Attributes

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...
 

Detailed Description

Definition at line 27 of file PenetrationLocator.h.

Member Enumeration Documentation

◆ NORMAL_SMOOTHING_METHOD

Enumerator
NSM_EDGE_BASED 
NSM_NODAL_NORMAL_BASED 

Definition at line 49 of file PenetrationLocator.h.

Constructor & Destructor Documentation

◆ PenetrationLocator()

PenetrationLocator::PenetrationLocator ( SubProblem subproblem,
GeometricSearchData geom_search_data,
MooseMesh mesh,
const unsigned int  primary_id,
const unsigned int  secondary_id,
Order  order,
NearestNodeLocator nearest_node 
)

Definition at line 22 of file PenetrationLocator.C.

29  : Restartable(subproblem.getMooseApp(),
30  Moose::stringify(primary_id) + "to" + Moose::stringify(secondary_id),
31  "PenetrationLocator",
32  0),
34  "PenetrationLocator_" + Moose::stringify(primary_id) + "_" +
35  Moose::stringify(secondary_id)),
36  _subproblem(subproblem),
37  _mesh(mesh),
38  _primary_boundary(primary_id),
39  _secondary_boundary(secondary_id),
40  _fe_type(order),
41  _nearest_node(nearest_node),
42  _penetration_info(declareRestartableDataWithContext<std::map<dof_id_type, PenetrationInfo *>>(
43  "penetration_info", &_mesh)),
44  _has_penetrated(declareRestartableData<std::set<dof_id_type>>("has_penetrated")),
46  _update_location(declareRestartableData<bool>("update_location", true)),
48  _do_normal_smoothing(false),
52 {
53  // Preconstruct an FE object for each thread we're going to use and for each lower-dimensional
54  // element
55  // This is a time savings so that the thread objects don't do this themselves multiple times
56  _fe.resize(libMesh::n_threads());
57  for (unsigned int i = 0; i < libMesh::n_threads(); i++)
58  {
59  unsigned int n_dims = _mesh.dimension();
60  _fe[i].resize(n_dims + 1);
61  for (unsigned int dim = 0; dim <= n_dims; ++dim)
62  {
63  _fe[i][dim] = FEBase::build(dim, _fe_type).release();
64  _fe[i][dim]->get_xyz();
65  _fe[i][dim]->get_phi();
66  _fe[i][dim]->get_dphi();
67  _fe[i][dim]->get_dxyzdxi();
68  _fe[i][dim]->get_d2xyzdxi2();
69  _fe[i][dim]->get_d2xyzdxideta();
70  _fe[i][dim]->get_dxyzdeta();
71  _fe[i][dim]->get_d2xyzdeta2();
72  _fe[i][dim]->get_d2xyzdxideta();
73  }
74  }
75 
77  {
78  if (!((_subproblem.hasVariable("nodal_normal_x")) &&
79  (_subproblem.hasVariable("nodal_normal_y")) &&
80  (_subproblem.hasVariable("nodal_normal_z"))))
81  {
82  mooseError(
83  "To use nodal-normal-based smoothing, the nodal_normal_x, nodal_normal_y, and "
84  "nodal_normal_z variables must exist. Are you missing the \\[NodalNormals\\] block?");
85  }
86  }
87 }
const Moose::PatchUpdateType _patch_update_strategy
unsigned int n_threads()
BoundaryID _secondary_boundary
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
T & declareRestartableDataWithContext(const std::string &data_name, void *context, Args &&... args)
Declare a piece of data as "restartable" and initialize it.
Definition: Restartable.h:294
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:148
std::vector< std::vector< FEBase * > > _fe
T & declareRestartableData(const std::string &data_name, Args &&... args)
Declare a piece of data as "restartable" and initialize it.
Definition: Restartable.h:269
std::map< dof_id_type, PenetrationInfo * > & _penetration_info
Data structure of nodes and their associated penetration information.
MooseApp & getMooseApp() const
Get the MooseApp this class is associated with.
Definition: MooseBase.h:45
bool _check_whether_reasonable
Check whether found candidates are reasonable.
virtual unsigned int dimension() const
Returns MeshBase::mesh_dimension(), (not MeshBase::spatial_dimension()!) of the underlying libMesh me...
Definition: MooseMesh.C:2679
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:62
virtual bool hasVariable(const std::string &var_name) const =0
Whether or not this problem has the variable.
Restartable(const MooseObject *moose_object, const std::string &system_name)
Class constructor.
Definition: Restartable.C:18
SubProblem & _subproblem
PerfGraphInterface(const MooseObject *moose_object)
For objects that are MooseObjects with a default prefix of type()
const Moose::PatchUpdateType & getPatchUpdateStrategy() const
Get the current patch update strategy.
Definition: MooseMesh.C:3164
std::set< dof_id_type > & _has_penetrated
PerfGraph & perfGraph()
Get the PerfGraph for this app.
Definition: MooseApp.h:133
BoundaryID _primary_boundary
NORMAL_SMOOTHING_METHOD _normal_smoothing_method
NearestNodeLocator & _nearest_node

◆ ~PenetrationLocator()

PenetrationLocator::~PenetrationLocator ( )

Definition at line 89 of file PenetrationLocator.C.

90 {
91  for (unsigned int i = 0; i < libMesh::n_threads(); i++)
92  for (unsigned int dim = 0; dim < _fe[i].size(); dim++)
93  delete _fe[i][dim];
94 
95  for (auto & it : _penetration_info)
96  delete it.second;
97 }
unsigned int n_threads()
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:148
std::vector< std::vector< FEBase * > > _fe
std::map< dof_id_type, PenetrationInfo * > & _penetration_info
Data structure of nodes and their associated penetration information.

Member Function Documentation

◆ declareManagedRestartableDataWithContext()

template<typename T , typename... Args>
Restartable::ManagedValue< T > Restartable::declareManagedRestartableDataWithContext ( const std::string &  data_name,
void context,
Args &&...  args 
)
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.

279 {
280  auto & data_ptr =
281  declareRestartableDataHelper<T>(data_name, context, std::forward<Args>(args)...);
282  return Restartable::ManagedValue<T>(data_ptr);
283 }
Wrapper class for restartable data that is "managed.
Definition: Restartable.h:42

◆ declareRecoverableData()

template<typename T , typename... Args>
T & Restartable::declareRecoverableData ( const std::string &  data_name,
Args &&...  args 
)
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!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
argsArguments to forward to the constructor of the data

Definition at line 351 of file Restartable.h.

352 {
353  const auto full_name = restartableName(data_name);
354 
356 
357  return declareRestartableDataWithContext<T>(data_name, nullptr, std::forward<Args>(args)...);
358 }
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 nam...
Definition: Restartable.C:66
void registerRestartableNameWithFilterOnApp(const std::string &name, Moose::RESTARTABLE_FILTER filter)
Helper function for actually registering the restartable data.
Definition: Restartable.C:59

◆ declareRestartableData()

template<typename T , typename... Args>
T & Restartable::declareRestartableData ( const std::string &  data_name,
Args &&...  args 
)
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!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
argsArguments to forward to the constructor of the data

Definition at line 269 of file Restartable.h.

270 {
271  return declareRestartableDataWithContext<T>(data_name, nullptr, std::forward<Args>(args)...);
272 }

◆ declareRestartableDataWithContext()

template<typename T , typename... Args>
T & Restartable::declareRestartableDataWithContext ( const std::string &  data_name,
void context,
Args &&...  args 
)
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!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
contextContext pointer that will be passed to the load and store functions
argsArguments to forward to the constructor of the data

Definition at line 294 of file Restartable.h.

297 {
298  return declareRestartableDataHelper<T>(data_name, context, std::forward<Args>(args)...).set();
299 }

◆ declareRestartableDataWithObjectName()

template<typename T , typename... Args>
T & Restartable::declareRestartableDataWithObjectName ( const std::string &  data_name,
const std::string &  object_name,
Args &&...  args 
)
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!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
object_nameA supplied name for the object that is declaring this data.
argsArguments to forward to the constructor of the data

Definition at line 323 of file Restartable.h.

326 {
327  return declareRestartableDataWithObjectNameWithContext<T>(
328  data_name, object_name, nullptr, std::forward<Args>(args)...);
329 }

◆ declareRestartableDataWithObjectNameWithContext()

template<typename T , typename... Args>
T & Restartable::declareRestartableDataWithObjectNameWithContext ( const std::string &  data_name,
const std::string &  object_name,
void context,
Args &&...  args 
)
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!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
object_nameA supplied name for the object that is declaring this data.
contextContext pointer that will be passed to the load and store functions
argsArguments to forward to the constructor of the data

Definition at line 333 of file Restartable.h.

337 {
338  std::string old_name = _restartable_name;
339 
340  _restartable_name = object_name;
341 
342  T & value = declareRestartableDataWithContext<T>(data_name, context, std::forward<Args>(args)...);
343 
344  _restartable_name = old_name;
345 
346  return value;
347 }
std::string _restartable_name
The name of the object.
Definition: Restartable.h:243
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)

◆ detectPenetration()

void PenetrationLocator::detectPenetration ( )

Definition at line 100 of file PenetrationLocator.C.

Referenced by reinit(), and GeometricSearchData::update().

101 {
102  TIME_SECTION("detectPenetration", 3, "Detecting Penetration");
103 
104  // Get list of boundary (elem, side, id) tuples.
105  std::vector<std::tuple<dof_id_type, unsigned short int, boundary_id_type>> bc_tuples =
107 
108  // Grab the secondary nodes we need to worry about from the NearestNodeLocator
109  NodeIdRange & secondary_node_range = _nearest_node.secondaryNodeRange();
110 
112  _mesh,
122  _fe,
123  _fe_type,
126  bc_tuples);
127 
128  Threads::parallel_reduce(secondary_node_range, pt);
129 
130  std::vector<dof_id_type> recheck_secondary_nodes = pt._recheck_secondary_nodes;
131 
132  // Update the patch for the secondary nodes in recheck_secondary_nodes and re-run penetration
133  // thread on these nodes at every nonlinear iteration if patch update strategy is set to
134  // "iteration".
135  if (recheck_secondary_nodes.size() > 0 && _patch_update_strategy == Moose::Iteration &&
137  {
138  // Update the patch for this subset of secondary nodes and calculate the nearest neighbor_nodes
139  _nearest_node.updatePatch(recheck_secondary_nodes);
140 
141  // Re-run the penetration thread to see if these nodes are in contact with the updated patch
142  NodeIdRange recheck_secondary_node_range(
143  recheck_secondary_nodes.begin(), recheck_secondary_nodes.end(), 1);
144 
145  Threads::parallel_reduce(recheck_secondary_node_range, pt);
146  }
147 
148  if (recheck_secondary_nodes.size() > 0 && _patch_update_strategy != Moose::Iteration &&
150  mooseDoOnce(mooseWarning("Warning in PenetrationLocator. Penetration is not "
151  "detected for one or more secondary nodes. This could be because "
152  "those secondary nodes simply do not project to faces on the primary "
153  "surface. However, this could also be because contact should be "
154  "enforced on those nodes, but the faces that they project to "
155  "are outside the contact patch, which will give an erroneous "
156  "result. Use appropriate options for 'patch_size' and "
157  "'patch_update_strategy' in the Mesh block to avoid this issue. "
158  "Setting 'patch_update_strategy=iteration' is recommended because "
159  "it completely avoids this potential issue. Also note that this "
160  "warning is printed only once, so a similar situation could occur "
161  "multiple times during the simulation but this warning is printed "
162  "only at the first occurrence."));
163 }
const Moose::PatchUpdateType _patch_update_strategy
BoundaryID _secondary_boundary
std::vector< std::tuple< dof_id_type, unsigned short int, boundary_id_type > > buildActiveSideList() const
Calls BoundaryInfo::build_active_side_list.
Definition: MooseMesh.C:2766
StoredRange< std::vector< dof_id_type >::iterator, dof_id_type > NodeIdRange
Definition: MooseTypes.h:205
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 ...
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
Definition: MooseError.h:333
std::vector< std::vector< FEBase * > > _fe
std::map< dof_id_type, PenetrationInfo * > & _penetration_info
Data structure of nodes and their associated penetration information.
NodeIdRange & secondaryNodeRange()
Returns the NodeIdRange of secondary nodes to be used for calling threaded functions operating on the...
bool _check_whether_reasonable
Check whether found candidates are reasonable.
SubProblem & _subproblem
const bool & currentlyComputingJacobian() const
Returns true if the problem is in the process of computing the Jacobian.
Definition: SubProblem.h:654
BoundaryID _primary_boundary
NORMAL_SMOOTHING_METHOD _normal_smoothing_method
NearestNodeLocator & _nearest_node
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...
Definition: MooseMesh.C:981

◆ getRestartableData()

template<typename T , typename... Args>
const T & Restartable::getRestartableData ( const std::string &  data_name) const
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!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)

Definition at line 287 of file Restartable.h.

288 {
289  return declareRestartableDataHelper<T>(data_name, nullptr).get();
290 }

◆ getTangentialTolerance()

Real PenetrationLocator::getTangentialTolerance ( )
inline

Definition at line 88 of file PenetrationLocator.h.

◆ inSegment()

int PenetrationLocator::inSegment ( Point  P,
Point  SP0,
Point  SP1 
)

◆ intersect2D_Segments()

int PenetrationLocator::intersect2D_Segments ( Point  S1P0,
Point  S1P1,
Point  S2P0,
Point  S2P1,
Point *  I0,
Point *  I1 
)

◆ normDistance()

Real PenetrationLocator::normDistance ( const Elem &  elem,
const Elem &  side,
const Node &  p0,
Point &  closest_point,
RealVectorValue normal 
)

◆ penetrationDistance()

Real PenetrationLocator::penetrationDistance ( dof_id_type  node_id)

Definition at line 183 of file PenetrationLocator.C.

184 {
186 
187  if (info)
188  return info->_distance;
189  else
190  return 0;
191 }
MPI_Info info
Data structure used to hold penetration information.
std::map< dof_id_type, PenetrationInfo * > & _penetration_info
Data structure of nodes and their associated penetration information.

◆ penetrationNormal()

RealVectorValue PenetrationLocator::penetrationNormal ( dof_id_type  node_id)

Definition at line 194 of file PenetrationLocator.C.

195 {
196  std::map<dof_id_type, PenetrationInfo *>::const_iterator found_it =
197  _penetration_info.find(node_id);
198 
199  if (found_it != _penetration_info.end())
200  return found_it->second->_normal;
201  else
202  return RealVectorValue(0, 0, 0);
203 }
std::map< dof_id_type, PenetrationInfo * > & _penetration_info
Data structure of nodes and their associated penetration information.

◆ perfGraph()

PerfGraph & PerfGraphInterface::perfGraph ( )
inherited

Get the PerfGraph.

Definition at line 78 of file PerfGraphInterface.C.

Referenced by CommonOutputAction::act(), PerfGraphData::finalize(), and PerfGraphOutput::output().

79 {
80  return _pg_moose_app.perfGraph();
81 }
MooseApp & _pg_moose_app
The MooseApp that owns the PerfGraph.
PerfGraph & perfGraph()
Get the PerfGraph for this app.
Definition: MooseApp.h:133

◆ registerTimedSection() [1/2]

PerfID PerfGraphInterface::registerTimedSection ( const std::string &  section_name,
const unsigned int  level 
) const
protectedinherited

Call to register a named section for timing.

Parameters
section_nameThe name of the code section to be timed
levelThe importance of the timer - lower is more important (0 will always come out)
Returns
The ID of the section - use when starting timing

Definition at line 53 of file PerfGraphInterface.C.

55 {
56  const auto timed_section_name = timedSectionName(section_name);
57  if (!moose::internal::getPerfGraphRegistry().sectionExists(timed_section_name))
58  return moose::internal::getPerfGraphRegistry().registerSection(timed_section_name, level);
59  else
60  return moose::internal::getPerfGraphRegistry().sectionID(timed_section_name);
61 }
PerfID registerSection(const std::string &section_name, const unsigned int level)
Call to register a named section for timing.
std::string timedSectionName(const std::string &section_name) const
PerfID sectionID(const std::string &section_name) const
Given a name return the PerfID The name of the section.
PerfGraphRegistry & getPerfGraphRegistry()
Get the global PerfGraphRegistry singleton.

◆ registerTimedSection() [2/2]

PerfID PerfGraphInterface::registerTimedSection ( const std::string &  section_name,
const unsigned int  level,
const std::string &  live_message,
const bool  print_dots = true 
) const
protectedinherited

Call to register a named section for timing.

Parameters
section_nameThe name of the code section to be timed
levelThe importance of the timer - lower is more important (0 will always come out)
live_messageThe message to be printed to the screen during execution
print_dotsWhether or not progress dots should be printed for this section
Returns
The ID of the section - use when starting timing

Definition at line 64 of file PerfGraphInterface.C.

68 {
69  const auto timed_section_name = timedSectionName(section_name);
70  if (!moose::internal::getPerfGraphRegistry().sectionExists(timed_section_name))
72  timedSectionName(section_name), level, live_message, print_dots);
73  else
74  return moose::internal::getPerfGraphRegistry().sectionID(timed_section_name);
75 }
PerfID registerSection(const std::string &section_name, const unsigned int level)
Call to register a named section for timing.
std::string timedSectionName(const std::string &section_name) const
PerfID sectionID(const std::string &section_name) const
Given a name return the PerfID The name of the section.
PerfGraphRegistry & getPerfGraphRegistry()
Get the global PerfGraphRegistry singleton.

◆ reinit()

void PenetrationLocator::reinit ( )

Completely redo the search from scratch.

This is probably getting called because of mesh adaptivity.

Definition at line 166 of file PenetrationLocator.C.

Referenced by GeometricSearchData::reinit().

167 {
168  TIME_SECTION("reinit", 3, "Reinitializing PenetrationLocator");
169 
170  // Delete the PenetrationInfo objects we own before clearing the
171  // map, or we have a memory leak.
172  for (auto & it : _penetration_info)
173  delete it.second;
174 
175  _penetration_info.clear();
176 
177  _has_penetrated.clear();
178 
180 }
std::map< dof_id_type, PenetrationInfo * > & _penetration_info
Data structure of nodes and their associated penetration information.
std::set< dof_id_type > & _has_penetrated

◆ restartableName()

std::string Restartable::restartableName ( const std::string &  data_name) const
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().

67 {
68  return _restartable_system_name + "/" + _restartable_name + "/" + data_name;
69 }
std::string _restartable_name
The name of the object.
Definition: Restartable.h:243
const std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:230

◆ setCheckWhetherReasonable()

void PenetrationLocator::setCheckWhetherReasonable ( bool  state)

Definition at line 206 of file PenetrationLocator.C.

207 {
209 }
bool _check_whether_reasonable
Check whether found candidates are reasonable.

◆ setNormalSmoothingDistance()

void PenetrationLocator::setNormalSmoothingDistance ( Real  normal_smoothing_distance)

Definition at line 224 of file PenetrationLocator.C.

Referenced by GapValueAux::GapValueAux(), NodeFaceConstraint::NodeFaceConstraint(), and PenetrationAux::PenetrationAux().

225 {
226  _normal_smoothing_distance = normal_smoothing_distance;
227  if (_normal_smoothing_distance > 0.0)
228  _do_normal_smoothing = true;
229 }

◆ setNormalSmoothingMethod()

void PenetrationLocator::setNormalSmoothingMethod ( std::string  nsmString)

Definition at line 232 of file PenetrationLocator.C.

Referenced by GapValueAux::GapValueAux(), NodeFaceConstraint::NodeFaceConstraint(), and PenetrationAux::PenetrationAux().

233 {
234  if (nsmString == "edge_based")
236  else if (nsmString == "nodal_normal_based")
238  else
239  mooseError("Invalid normal_smoothing_method: ", nsmString);
240  _do_normal_smoothing = true;
241 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
NORMAL_SMOOTHING_METHOD _normal_smoothing_method

◆ setTangentialTolerance()

void PenetrationLocator::setTangentialTolerance ( Real  tangential_tolerance)

Definition at line 218 of file PenetrationLocator.C.

Referenced by GapValueAux::GapValueAux(), NodeFaceConstraint::NodeFaceConstraint(), and PenetrationAux::PenetrationAux().

219 {
220  _tangential_tolerance = tangential_tolerance;
221 }

◆ setUpdate()

void PenetrationLocator::setUpdate ( bool  update)

Definition at line 212 of file PenetrationLocator.C.

213 {
214  _update_location = update;
215 }

◆ timedSectionName()

std::string PerfGraphInterface::timedSectionName ( const std::string &  section_name) const
protectedinherited
Returns
The name of the timed section with the name section_name.

Optionally adds a prefix if one is defined.

Definition at line 47 of file PerfGraphInterface.C.

Referenced by PerfGraphInterface::registerTimedSection().

48 {
49  return _prefix.empty() ? "" : (_prefix + "::") + section_name;
50 }
const std::string _prefix
A prefix to use for all sections.

◆ validParams()

InputParameters PerfGraphInterface::validParams ( )
staticinherited

Definition at line 16 of file PerfGraphInterface.C.

17 {
19  return params;
20 }
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
InputParameters emptyInputParameters()

Member Data Documentation

◆ _check_whether_reasonable

bool PenetrationLocator::_check_whether_reasonable
protected

Check whether found candidates are reasonable.

Definition at line 92 of file PenetrationLocator.h.

Referenced by detectPenetration(), and setCheckWhetherReasonable().

◆ _do_normal_smoothing

bool PenetrationLocator::_do_normal_smoothing
protected

◆ _fe

std::vector<std::vector<FEBase *> > PenetrationLocator::_fe

Definition at line 73 of file PenetrationLocator.h.

Referenced by detectPenetration(), PenetrationLocator(), and ~PenetrationLocator().

◆ _fe_type

FEType PenetrationLocator::_fe_type

Definition at line 70 of file PenetrationLocator.h.

Referenced by detectPenetration(), and PenetrationLocator().

◆ _has_penetrated

std::set<dof_id_type>& PenetrationLocator::_has_penetrated

Definition at line 81 of file PenetrationLocator.h.

Referenced by reinit().

◆ _mesh

MooseMesh& PenetrationLocator::_mesh

Definition at line 66 of file PenetrationLocator.h.

Referenced by detectPenetration(), and PenetrationLocator().

◆ _nearest_node

NearestNodeLocator& PenetrationLocator::_nearest_node

◆ _normal_smoothing_distance

Real PenetrationLocator::_normal_smoothing_distance
protected

Definition at line 97 of file PenetrationLocator.h.

Referenced by detectPenetration(), and setNormalSmoothingDistance().

◆ _normal_smoothing_method

NORMAL_SMOOTHING_METHOD PenetrationLocator::_normal_smoothing_method
protected

◆ _patch_update_strategy

const Moose::PatchUpdateType PenetrationLocator::_patch_update_strategy
protected

Definition at line 101 of file PenetrationLocator.h.

Referenced by detectPenetration().

◆ _penetration_info

std::map<dof_id_type, PenetrationInfo *>& PenetrationLocator::_penetration_info

◆ _pg_moose_app

MooseApp& PerfGraphInterface::_pg_moose_app
protectedinherited

The MooseApp that owns the PerfGraph.

Definition at line 124 of file PerfGraphInterface.h.

Referenced by PerfGraphInterface::perfGraph().

◆ _prefix

const std::string PerfGraphInterface::_prefix
protectedinherited

A prefix to use for all sections.

Definition at line 127 of file PerfGraphInterface.h.

Referenced by PerfGraphInterface::timedSectionName().

◆ _primary_boundary

BoundaryID PenetrationLocator::_primary_boundary

◆ _restartable_app

MooseApp& Restartable::_restartable_app
protectedinherited

Reference to the application.

Definition at line 227 of file Restartable.h.

Referenced by Restartable::registerRestartableDataOnApp(), and Restartable::registerRestartableNameWithFilterOnApp().

◆ _restartable_read_only

const bool Restartable::_restartable_read_only
protectedinherited

Flag for toggling read only status (see ReporterData)

Definition at line 236 of file Restartable.h.

Referenced by Restartable::registerRestartableDataOnApp().

◆ _restartable_system_name

const std::string Restartable::_restartable_system_name
protectedinherited

The system name this object is in.

Definition at line 230 of file Restartable.h.

Referenced by Restartable::restartableName().

◆ _restartable_tid

const THREAD_ID Restartable::_restartable_tid
protectedinherited

The thread ID for this object.

Definition at line 233 of file Restartable.h.

Referenced by Restartable::declareRestartableDataHelper().

◆ _secondary_boundary

BoundaryID PenetrationLocator::_secondary_boundary

◆ _subproblem

SubProblem& PenetrationLocator::_subproblem

Definition at line 55 of file PenetrationLocator.h.

Referenced by detectPenetration(), and PenetrationLocator().

◆ _tangential_tolerance

Real PenetrationLocator::_tangential_tolerance
protected

◆ _update_location

bool& PenetrationLocator::_update_location
protected

Definition at line 93 of file PenetrationLocator.h.

Referenced by detectPenetration(), and setUpdate().


The documentation for this class was generated from the following files: