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:
27  PenetrationThread(SubProblem & subproblem,
28  const MooseMesh & mesh,
29  BoundaryID primary_boundary,
30  BoundaryID secondary_boundary,
31  std::map<dof_id_type, PenetrationInfo *> & penetration_info,
32  bool check_whether_reasonable,
33  bool update_location,
34  Real tangential_tolerance,
35  bool do_normal_smoothing,
36  Real normal_smoothing_distance,
37  PenetrationLocator::NORMAL_SMOOTHING_METHOD normal_smoothing_method,
38  bool use_point_locator,
39  std::vector<std::vector<libMesh::FEBase *>> & fes,
40  libMesh::FEType & fe_type,
41  NearestNodeLocator & nearest_node,
42  const std::map<dof_id_type, std::vector<dof_id_type>> & node_to_elem_map);
43 
44  // Splitting Constructor
46 
47  void operator()(const NodeIdRange & range);
48 
49  void join(const PenetrationThread & other);
50 
52  std::vector<dof_id_type> _recheck_secondary_nodes;
53 
54 protected:
56  // The Mesh
57  const MooseMesh & _mesh;
60 
61  // This is the info map we're actually filling here
62  std::map<dof_id_type, PenetrationInfo *> & _penetration_info;
63 
74 
75  std::vector<std::vector<libMesh::FEBase *>> & _fes;
76 
78 
80 
81  const std::map<dof_id_type, std::vector<dof_id_type>> & _node_to_elem_map;
82 
84 
87 
89  {
93  };
94 
96  {
101  };
102 
111 
120  PenetrationInfo * pi2);
121 
123 
124  bool findRidgeContactPoint(libMesh::Point & contact_point,
125  Real & tangential_distance,
126  const Node *& closest_node,
127  unsigned int & index,
128  libMesh::Point & contact_point_ref,
129  std::vector<PenetrationInfo *> & p_info,
130  const unsigned int index1,
131  const unsigned int index2);
132 
133  void getSideCornerNodes(const Elem * side, std::vector<const Node *> & corner_nodes);
134 
136  const Node *& closest_node,
137  const Elem * side,
138  const std::vector<const Node *> & edge_nodes);
139  bool restrictPointToFace(libMesh::Point & p, const Node *& closest_node, const Elem * side);
140 
141  bool isFaceReasonableCandidate(const Elem * primary_elem,
142  const Elem * side,
143  libMesh::FEBase * fe,
144  const libMesh::Point * secondary_point,
145  const Real tangential_tolerance);
146 
147  void
148  smoothNormal(PenetrationInfo * info, std::vector<PenetrationInfo *> & p_info, const Node & node);
149 
151  std::vector<PenetrationInfo *> & edge_face_info,
152  std::vector<Real> & edge_face_weights,
153  std::vector<PenetrationInfo *> & p_info,
154  const Node & secondary_node);
156  const Elem * side,
157  std::vector<std::vector<const Node *>> & edge_nodes,
158  std::vector<Real> & edge_face_weights);
159 
160  void getInfoForFacesWithCommonNodes(const Node * secondary_node,
161  const std::set<dof_id_type> & elems_to_exclude,
162  const std::vector<const Node *> edge_nodes,
163  std::vector<PenetrationInfo *> & face_info_comm_edge,
164  std::vector<PenetrationInfo *> & p_info);
165 
166  void getInfoForElem(std::vector<PenetrationInfo *> & thisElemInfo,
167  std::vector<PenetrationInfo *> & p_info,
168  const Elem * elem);
169 
170  void createInfoForElem(std::vector<PenetrationInfo *> & thisElemInfo,
171  std::vector<PenetrationInfo *> & p_info,
172  const Node * secondary_node,
173  const Elem * elem,
174  const std::vector<const Node *> & nodes_that_must_be_on_side,
175  const bool check_whether_reasonable = false);
176 
177  void getSidesOnPrimaryBoundary(std::vector<unsigned int> & sides, const Elem * const elem);
178 
180 
181  void switchInfo(PenetrationInfo *& info, PenetrationInfo *& infoNew);
182 
183  struct RidgeData
184  {
185  unsigned int _index;
189  const Node * _closest_node;
190  };
191 
193  {
196  const Node * _closest_node;
197  std::vector<RidgeData> _ridge_data_vec;
198  };
199 };
void getSidesOnPrimaryBoundary(std::vector< unsigned int > &sides, const Elem *const elem)
MooseVariable * _nodal_normal_z
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::map< dof_id_type, std::vector< dof_id_type >> &node_to_elem_map)
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:31
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
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:92
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)
const std::map< dof_id_type, std::vector< dof_id_type > > & _node_to_elem_map
void switchInfo(PenetrationInfo *&info, PenetrationInfo *&infoNew)
MooseVariable * _nodal_normal_x
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:209
uint8_t dof_id_type
std::vector< RidgeData > _ridge_data_vec
MooseVariableFE< Real > MooseVariable