www.mooseframework.org
PenetrationThread.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #ifndef PENETRATIONTHREAD_H
16 #define PENETRATIONTHREAD_H
17 
18 // MOOSE includes
19 #include "MooseTypes.h"
20 #include "PenetrationLocator.h"
21 
22 // Forward declarations
23 class MooseVariable;
24 
26 {
27 public:
28  PenetrationThread(SubProblem & subproblem,
29  const MooseMesh & mesh,
30  BoundaryID master_boundary,
31  BoundaryID slave_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  std::vector<std::vector<FEBase *>> & fes,
40  FEType & fe_type,
41  NearestNodeLocator & nearest_node,
42  const std::map<dof_id_type, std::vector<dof_id_type>> & node_to_elem_map,
43  std::vector<dof_id_type> & elem_list,
44  std::vector<unsigned short int> & side_list,
45  std::vector<boundary_id_type> & id_list);
46 
47  // Splitting Constructor
48  PenetrationThread(PenetrationThread & x, Threads::split split);
49 
50  void operator()(const NodeIdRange & range);
51 
52  void join(const PenetrationThread & other);
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 
73 
74  std::vector<std::vector<FEBase *>> & _fes;
75 
76  FEType & _fe_type;
77 
79 
80  const std::map<dof_id_type, std::vector<dof_id_type>> & _node_to_elem_map;
81 
82  std::vector<dof_id_type> & _elem_list;
83  std::vector<unsigned short int> & _side_list;
84  std::vector<boundary_id_type> & _id_list;
85 
86  unsigned int _n_elems;
87 
89 
91  {
95  };
96 
98  {
103  };
104 
106 
108 
109  bool findRidgeContactPoint(Point & contact_point,
110  Real & tangential_distance,
111  const Node *& closest_node,
112  unsigned int & index,
113  Point & contact_point_ref,
114  std::vector<PenetrationInfo *> & p_info,
115  const unsigned int index1,
116  const unsigned int index2);
117 
118  void getSideCornerNodes(const Elem * side, std::vector<const Node *> & corner_nodes);
119 
120  bool restrictPointToSpecifiedEdgeOfFace(Point & p,
121  const Node *& closest_node,
122  const Elem * side,
123  const std::vector<const Node *> & edge_nodes);
124  bool restrictPointToFace(Point & p, const Node *& closest_node, const Elem * side);
125 
126  bool isFaceReasonableCandidate(const Elem * master_elem,
127  const Elem * side,
128  FEBase * fe,
129  const Point * slave_point,
130  const Real tangential_tolerance);
131 
132  void smoothNormal(PenetrationInfo * info, std::vector<PenetrationInfo *> & p_info);
133 
135  std::vector<PenetrationInfo *> & edge_face_info,
136  std::vector<Real> & edge_face_weights,
137  std::vector<PenetrationInfo *> & p_info);
138  void getSmoothingEdgeNodesAndWeights(const Point & p,
139  const Elem * side,
140  std::vector<std::vector<const Node *>> & edge_nodes,
141  std::vector<Real> & edge_face_weights);
142 
143  void getInfoForFacesWithCommonNodes(const Node * slave_node,
144  const std::set<dof_id_type> & elems_to_exclude,
145  const std::vector<const Node *> edge_nodes,
146  std::vector<PenetrationInfo *> & face_info_comm_edge,
147  std::vector<PenetrationInfo *> & p_info);
148 
149  void getInfoForElem(std::vector<PenetrationInfo *> & thisElemInfo,
150  std::vector<PenetrationInfo *> & p_info,
151  const Elem * elem);
152 
153  void createInfoForElem(std::vector<PenetrationInfo *> & thisElemInfo,
154  std::vector<PenetrationInfo *> & p_info,
155  const Node * slave_node,
156  const Elem * elem,
157  const std::vector<const Node *> & nodes_that_must_be_on_side,
158  const bool check_whether_reasonable = false);
159 
160  void getSidesOnMasterBoundary(std::vector<unsigned int> & sides, const Elem * const elem);
161 
162  void computeSlip(FEBase & fe, PenetrationInfo & info);
163 
164  void switchInfo(PenetrationInfo *& info, PenetrationInfo *& infoNew);
165 
166  struct RidgeData
167  {
168  unsigned int _index;
172  const Node * _closest_node;
173  };
174 
176  {
177  Real _distance;
179  const Node * _closest_node;
180  std::vector<RidgeData> _ridge_data_vec;
181  };
182 };
183 
184 #endif // PENETRATIONTHREAD_H
MooseVariable * _nodal_normal_z
unsigned int _n_elems
void getSidesOnMasterBoundary(std::vector< unsigned int > &sides, const Elem *const elem)
Class for stuff related to variables.
Definition: MooseVariable.h:43
FEGenericBase< Real > FEBase
Definition: Assembly.h:34
BoundaryID _master_boundary
void smoothNormal(PenetrationInfo *info, std::vector< PenetrationInfo * > &p_info)
Data structure used to hold penetration information.
NearestNodeLocator & _nearest_node
StoredRange< std::vector< dof_id_type >::iterator, dof_id_type > NodeIdRange
Definition: MooseTypes.h:81
Finds the nearest node to each node in boundary1 to each node in boundary2 and the other way around...
void getSmoothingEdgeNodesAndWeights(const Point &p, const Elem *side, std::vector< std::vector< const Node * >> &edge_nodes, std::vector< Real > &edge_face_weights)
void getSideCornerNodes(const Elem *side, std::vector< const Node * > &corner_nodes)
bool restrictPointToFace(Point &p, const Node *&closest_node, const Elem *side)
PenetrationThread(SubProblem &subproblem, const MooseMesh &mesh, BoundaryID master_boundary, BoundaryID slave_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, std::vector< std::vector< FEBase * >> &fes, FEType &fe_type, NearestNodeLocator &nearest_node, const std::map< dof_id_type, std::vector< dof_id_type >> &node_to_elem_map, std::vector< dof_id_type > &elem_list, std::vector< unsigned short int > &side_list, std::vector< boundary_id_type > &id_list)
static PetscErrorCode Vec x
std::vector< unsigned short int > & _side_list
bool restrictPointToSpecifiedEdgeOfFace(Point &p, const Node *&closest_node, const Elem *side, const std::vector< const Node * > &edge_nodes)
SubProblem & _subproblem
const MooseMesh & _mesh
std::vector< std::vector< FEBase * > > & _fes
CompeteInteractionResult competeInteractions(PenetrationInfo *pi1, PenetrationInfo *pi2)
void operator()(const NodeIdRange &range)
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:74
bool findRidgeContactPoint(Point &contact_point, Real &tangential_distance, const Node *&closest_node, unsigned int &index, Point &contact_point_ref, std::vector< PenetrationInfo * > &p_info, const unsigned int index1, const unsigned int index2)
void getInfoForElem(std::vector< PenetrationInfo * > &thisElemInfo, std::vector< PenetrationInfo * > &p_info, const Elem *elem)
void join(const PenetrationThread &other)
bool isFaceReasonableCandidate(const Elem *master_elem, const Elem *side, FEBase *fe, const Point *slave_point, const Real tangential_tolerance)
void getInfoForFacesWithCommonNodes(const Node *slave_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)
std::vector< dof_id_type > & _elem_list
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:53
std::map< dof_id_type, PenetrationInfo * > & _penetration_info
MooseVariable * _nodal_normal_y
void createInfoForElem(std::vector< PenetrationInfo * > &thisElemInfo, std::vector< PenetrationInfo * > &p_info, const Node *slave_node, const Elem *elem, const std::vector< const Node * > &nodes_that_must_be_on_side, const bool check_whether_reasonable=false)
std::vector< boundary_id_type > & _id_list
void computeSlip(FEBase &fe, PenetrationInfo &info)
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
void getSmoothingFacesAndWeights(PenetrationInfo *info, std::vector< PenetrationInfo * > &edge_face_info, std::vector< Real > &edge_face_weights, std::vector< PenetrationInfo * > &p_info)
CommonEdgeResult interactionsOffCommonEdge(PenetrationInfo *pi1, PenetrationInfo *pi2)
PenetrationLocator::NORMAL_SMOOTHING_METHOD _normal_smoothing_method
BoundaryID _slave_boundary
unsigned int THREAD_ID
Definition: MooseTypes.h:79
boundary_id_type BoundaryID
Definition: MooseTypes.h:75
std::vector< RidgeData > _ridge_data_vec