https://mooseframework.inl.gov
PenetrationThread.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 // MOOSE includes
13 #include "MooseTypes.h"
14 #include "PenetrationLocator.h"
15 
16 #include "libmesh/elem_side_builder.h"
17 
18 // Forward declarations
19 template <typename>
23 
25 {
26 public:
28  SubProblem & subproblem,
29  const MooseMesh & mesh,
30  BoundaryID primary_boundary,
31  BoundaryID secondary_boundary,
32  std::map<dof_id_type, PenetrationInfo *> & penetration_info,
33  bool check_whether_reasonable,
34  bool update_location,
35  Real tangential_tolerance,
36  bool do_normal_smoothing,
37  Real normal_smoothing_distance,
38  PenetrationLocator::NORMAL_SMOOTHING_METHOD normal_smoothing_method,
39  bool use_point_locator,
40  std::vector<std::vector<libMesh::FEBase *>> & fes,
41  libMesh::FEType & fe_type,
42  NearestNodeLocator & nearest_node,
43  const std::unordered_map<dof_id_type, std::vector<dof_id_type>> & node_to_elem_map);
44 
45  // Splitting Constructor
47 
48  void operator()(const NodeIdRange & range);
49 
50  void join(const PenetrationThread & other);
51 
53  std::vector<dof_id_type> _recheck_secondary_nodes;
54 
55 protected:
57  // The Mesh
58  const MooseMesh & _mesh;
61 
62  // This is the info map we're actually filling here
63  std::map<dof_id_type, PenetrationInfo *> & _penetration_info;
64 
75 
76  std::vector<std::vector<libMesh::FEBase *>> & _fes;
77 
79 
81 
82  const std::unordered_map<dof_id_type, std::vector<dof_id_type>> & _node_to_elem_map;
83 
85 
88 
90  {
94  };
95 
97  {
102  };
103 
112 
121  PenetrationInfo * pi2);
122 
124 
125  bool findRidgeContactPoint(libMesh::Point & contact_point,
126  Real & tangential_distance,
127  const Node *& closest_node,
128  unsigned int & index,
129  libMesh::Point & contact_point_ref,
130  std::vector<PenetrationInfo *> & p_info,
131  const unsigned int index1,
132  const unsigned int index2);
133 
134  void getSideCornerNodes(const Elem * side, std::vector<const Node *> & corner_nodes);
135 
137  const Node *& closest_node,
138  const Elem * side,
139  const std::vector<const Node *> & edge_nodes);
140  bool restrictPointToFace(libMesh::Point & p, const Node *& closest_node, const Elem * side);
141 
142  bool isFaceReasonableCandidate(const Elem * primary_elem,
143  const Elem * side,
144  libMesh::FEBase * fe,
145  const libMesh::Point * secondary_point,
146  const Real tangential_tolerance);
147 
148  void
149  smoothNormal(PenetrationInfo * info, std::vector<PenetrationInfo *> & p_info, const Node & node);
150 
152  std::vector<PenetrationInfo *> & edge_face_info,
153  std::vector<Real> & edge_face_weights,
154  std::vector<PenetrationInfo *> & p_info,
155  const Node & secondary_node);
157  const Elem * side,
158  std::vector<std::vector<const Node *>> & edge_nodes,
159  std::vector<Real> & edge_face_weights);
160 
161  void getInfoForFacesWithCommonNodes(const Node * secondary_node,
162  const std::set<dof_id_type> & elems_to_exclude,
163  const std::vector<const Node *> edge_nodes,
164  std::vector<PenetrationInfo *> & face_info_comm_edge,
165  std::vector<PenetrationInfo *> & p_info);
166 
167  void getInfoForElem(std::vector<PenetrationInfo *> & thisElemInfo,
168  std::vector<PenetrationInfo *> & p_info,
169  const Elem * elem);
170 
171  void createInfoForElem(std::vector<PenetrationInfo *> & thisElemInfo,
172  std::vector<PenetrationInfo *> & p_info,
173  const Node * secondary_node,
174  const Elem * elem,
175  const std::vector<const Node *> & nodes_that_must_be_on_side,
176  const bool check_whether_reasonable = false);
177 
178  void getSidesOnPrimaryBoundary(std::vector<unsigned int> & sides, const Elem * const elem);
179 
181 
182  void switchInfo(PenetrationInfo *& info, PenetrationInfo *& infoNew);
183 
184  struct RidgeData
185  {
186  unsigned int _index;
190  const Node * _closest_node;
191  };
192 
194  {
197  const Node * _closest_node;
198  std::vector<RidgeData> _ridge_data_vec;
199  };
200 };
void getSidesOnPrimaryBoundary(std::vector< unsigned int > &sides, const Elem *const elem)
MooseVariable * _nodal_normal_z
void getSmoothingEdgeNodesAndWeights(const libMesh::Point &p, const Elem *side, std::vector< std::vector< const Node *>> &edge_nodes, std::vector< Real > &edge_face_weights)
Class for stuff related to variables.
Definition: Adaptivity.h:33
MooseVariableFE< libMesh::VectorValue< Real > > VectorMooseVariable
MPI_Info info
bool findRidgeContactPoint(libMesh::Point &contact_point, Real &tangential_distance, const Node *&closest_node, unsigned int &index, libMesh::Point &contact_point_ref, std::vector< PenetrationInfo *> &p_info, const unsigned int index1, const unsigned int index2)
Data structure used to hold penetration information.
NearestNodeLocator & _nearest_node
Finds the nearest node to each node in boundary1 to each node in boundary2 and the other way around...
MeshBase & mesh
void createInfoForElem(std::vector< PenetrationInfo *> &thisElemInfo, std::vector< PenetrationInfo *> &p_info, const Node *secondary_node, const Elem *elem, const std::vector< const Node *> &nodes_that_must_be_on_side, const bool check_whether_reasonable=false)
void getSideCornerNodes(const Elem *side, std::vector< const Node *> &corner_nodes)
void smoothNormal(PenetrationInfo *info, std::vector< PenetrationInfo *> &p_info, const Node &node)
libMesh::FEType & _fe_type
void getInfoForFacesWithCommonNodes(const Node *secondary_node, const std::set< dof_id_type > &elems_to_exclude, const std::vector< const Node *> edge_nodes, std::vector< PenetrationInfo *> &face_info_comm_edge, std::vector< PenetrationInfo *> &p_info)
void getSmoothingFacesAndWeights(PenetrationInfo *info, std::vector< PenetrationInfo *> &edge_face_info, std::vector< Real > &edge_face_weights, std::vector< PenetrationInfo *> &p_info, const Node &secondary_node)
BoundaryID _primary_boundary
SubProblem & _subproblem
PenetrationThread(SubProblem &subproblem, const MooseMesh &mesh, BoundaryID primary_boundary, BoundaryID secondary_boundary, std::map< dof_id_type, PenetrationInfo *> &penetration_info, bool check_whether_reasonable, bool update_location, Real tangential_tolerance, bool do_normal_smoothing, Real normal_smoothing_distance, PenetrationLocator::NORMAL_SMOOTHING_METHOD normal_smoothing_method, bool use_point_locator, std::vector< std::vector< libMesh::FEBase *>> &fes, libMesh::FEType &fe_type, NearestNodeLocator &nearest_node, const std::unordered_map< dof_id_type, std::vector< dof_id_type >> &node_to_elem_map)
const MooseMesh & _mesh
char ** sides
boundary_id_type BoundaryID
BoundaryID _secondary_boundary
CompeteInteractionResult competeInteractions(PenetrationInfo *pi1, PenetrationInfo *pi2)
When interactions are identified between a node and two faces, compete between the faces to determine...
void operator()(const NodeIdRange &range)
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:93
void computeSlip(libMesh::FEBase &fe, PenetrationInfo &info)
std::vector< dof_id_type > _recheck_secondary_nodes
List of secondary nodes for which penetration was not detected in the current patch and for which pat...
bool restrictPointToSpecifiedEdgeOfFace(libMesh::Point &p, const Node *&closest_node, const Elem *side, const std::vector< const Node *> &edge_nodes)
void join(const PenetrationThread &other)
tbb::split split
bool restrictPointToFace(libMesh::Point &p, const Node *&closest_node, const Elem *side)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:78
std::map< dof_id_type, PenetrationInfo * > & _penetration_info
MooseVariable * _nodal_normal_y
libMesh::ElemSideBuilder _elem_side_builder
Helper for building element sides without extraneous allocation.
void getInfoForElem(std::vector< PenetrationInfo *> &thisElemInfo, std::vector< PenetrationInfo *> &p_info, const Elem *elem)
void switchInfo(PenetrationInfo *&info, PenetrationInfo *&infoNew)
MooseVariable * _nodal_normal_x
const std::unordered_map< dof_id_type, std::vector< dof_id_type > > & _node_to_elem_map
std::vector< std::vector< libMesh::FEBase * > > & _fes
CompeteInteractionResult competeInteractionsBothOnFace(PenetrationInfo *pi1, PenetrationInfo *pi2)
Determine whether first (pi1) or second (pi2) interaction is stronger when it is known that the node ...
CommonEdgeResult interactionsOffCommonEdge(PenetrationInfo *pi1, PenetrationInfo *pi2)
bool isFaceReasonableCandidate(const Elem *primary_elem, const Elem *side, libMesh::FEBase *fe, const libMesh::Point *secondary_point, const Real tangential_tolerance)
PenetrationLocator::NORMAL_SMOOTHING_METHOD _normal_smoothing_method
unsigned int THREAD_ID
Definition: MooseTypes.h:237
uint8_t dof_id_type
std::vector< RidgeData > _ridge_data_vec
MooseVariableFE< Real > MooseVariable