v0.14.0
EshelbianContact.hpp
Go to the documentation of this file.
1 /**
2  * @file EshelbianContact.hpp
3  * @brief
4  * @date 2023-05-13
5  *
6  * @copyright Copyright (c) 2023
7  *
8  */
9 
10 namespace ContactOps {
11 
15 
17  FormsIntegrators<BoundaryEleOp>::Assembly<A>::OpBase;
18 
19 double cn_contact = 1;
22 double scale = 1;
23 
24 } // namespace ContactOps
25 
26 #include <ContactOps.hpp>
27 
28 namespace EshelbianPlasticity {
29 
31  : public PostProcBrokenMeshInMoabBase<FaceElementForcesAndSourcesCore> {
32 
33  using Base = PostProcBrokenMeshInMoabBase<FaceElementForcesAndSourcesCore>;
34  using Base::refElementsMap;
35 
37  boost::shared_ptr<moab::Core> core_mesh_ptr, int max_order,
38  std::map<int, Range> &&body_map);
41  inline boost::shared_ptr<OrientedBoxTreeTool> &getTreeSurfPtr() {
42  return treeSurfPtr;
43  }
44  inline auto getRootSetSurf() { return rootSetSurf; }
45  int getMaxLevel() const { return refElementsMap.at(MBTRI)->defMaxLevel; }
46 
47  friend struct OpMoveNode;
48  friend struct OpTreeSearch;
49 
50  struct FaceData {
51  int gaussPtNb; //< integration points number
52  std::array<double, 3> slavePoint;
53  std::array<double, 3> masterPoint;
54  std::array<double, 3> rayPoint;
55  std::array<double, 3> unitRay;
56  double eleRadius;
57 
58  // std::vector<int> dofsSlaveIds;
59  // std::vector<double> dofsSlaveCoeff;
60  // std::vector<double> baseSlaveFuncs;
61 
62  std::array<double, 9> masterPointNodes;
63  std::array<double, 9> masterTractionNodes;
64  std::array<double, 9> slavePointNodes;
65  std::array<double, 9> slaveTractionNodes;
66 
67  FaceData() = default;
68  };
69 
70  using MapFaceData = std::map<EntityHandle, std::vector<FaceData>>;
71 
72  inline auto findFaceDataVecPtr(EntityHandle fe_ent) {
73  auto &map_face_data = shadowDataMap;
74  auto it = map_face_data.find(fe_ent);
75  if (it == map_face_data.end()) {
76  return (std::vector<FaceData> *)nullptr;
77  }
78  return &(it->second);
79  }
80 
81  inline auto getFaceDataPtr(std::vector<FaceData>::iterator &it, int gg,
82  std::vector<FaceData> *vec_ptr) {
83  FaceData *face_data_ptr = nullptr;
84  if (it != vec_ptr->end()) {
85  if (it->gaussPtNb == gg) {
86  face_data_ptr = &(*it);
87  ++it;
88  }
89  }
90  return face_data_ptr;
91  }
92 
93 protected:
95  boost::shared_ptr<OrientedBoxTreeTool> treeSurfPtr;
97 
98  Tag thEleId;
99  // Tag thCoeff;
100  // Tag thIds;
101  // Tag thBases;
102  Tag thBodyId;
103  Tag thSmallX;
104  Tag thLargeX;
106 
108 
109  std::map<int, Range> bodyMap;
110 
111  const int maxOrder;
112 };
113 
116  const std::string row_field_name,
117  boost::shared_ptr<ContactOps::CommonData> common_data_ptr,
118  boost::shared_ptr<ContactTree> contact_tree_ptr,
119  boost::shared_ptr<std::map<int, Range>> sdf_map_range_ptr = nullptr);
120 
122 
123 private:
124  boost::shared_ptr<ContactOps::CommonData> commonDataPtr;
125  boost::shared_ptr<ContactTree> contactTreePtr;
126  boost::shared_ptr<std::map<int, Range>> sdfMapRangePtr;
127 };
128 
130 
132  const std::string row_field_name,
133  boost::shared_ptr<ContactOps::CommonData> common_data_ptr,
134  boost::shared_ptr<ContactTree> contact_tree_ptr);
135 
137 
138 private:
139  boost::shared_ptr<ContactOps::CommonData> commonDataPtr;
140  boost::shared_ptr<ContactTree> contactTreePtr;
141 };
142 
144 
146  const std::string row_field_name, const std::string col_field_name,
147  boost::shared_ptr<ContactOps::CommonData> common_data_ptr,
148  boost::shared_ptr<ContactTree> contact_tree_ptr,
149  boost::shared_ptr<std::map<int, Range>> sdf_map_range_ptr = nullptr);
150 
152  EntitiesFieldData::EntData &col_data);
153 
154 private:
155  boost::shared_ptr<ContactOps::CommonData> commonDataPtr;
156  boost::shared_ptr<ContactTree> contactTreePtr;
157  boost::shared_ptr<std::map<int, Range>> sdfMapRangePtr;
158 };
159 
161 
163  const std::string row_field_name, const std::string col_field_name,
164  boost::shared_ptr<ContactOps::CommonData> common_data_ptr,
165  boost::shared_ptr<ContactTree> contact_tree_ptr,
166  boost::shared_ptr<std::map<int, Range>> sdf_map_range_ptr = nullptr);
167 
169  EntitiesFieldData::EntData &col_data);
170 
171 private:
172  boost::shared_ptr<ContactOps::CommonData> commonDataPtr;
173  boost::shared_ptr<ContactTree> contactTreePtr;
174  boost::shared_ptr<std::map<int, Range>> sdfMapRangePtr;
175 };
176 
179 
181  const std::string row_field_name, const std::string col_field_name,
182  boost::shared_ptr<ContactOps::CommonData> common_data_ptr,
183  boost::shared_ptr<ContactTree> contact_tree_ptr);
184 
186  EntitiesFieldData::EntData &col_data);
187 
188 private:
189  boost::shared_ptr<ContactOps::CommonData> commonDataPtr;
190  boost::shared_ptr<ContactTree> contactTreePtr;
191 };
192 
194 
196 
197  OpMoveNode(boost::shared_ptr<ContactTree> contact_tree_ptr,
198  boost::shared_ptr<ContactOps::CommonData> common_data_ptr,
199  boost::shared_ptr<MatrixDouble> u_h1_ptr);
200  MoFEMErrorCode doWork(int side, EntityType type,
202 
203 protected:
204  boost::shared_ptr<ContactTree> contactTreePtr;
205  boost::shared_ptr<MatrixDouble> uH1Ptr;
206  boost::shared_ptr<ContactOps::CommonData> commonDataPtr;
207 };
208 
210 
212 
213  OpTreeSearch(boost::shared_ptr<ContactTree> contact_tree_ptr,
214  boost::shared_ptr<ContactOps::CommonData> common_data_ptr,
215  boost::shared_ptr<MatrixDouble> u_h1_ptr, Range r,
216 
217  moab::Interface *post_proc_mesh_ptr,
218  std::vector<EntityHandle> *map_gauss_pts_ptr
219 
220  );
221  MoFEMErrorCode doWork(int side, EntityType type,
223 
224 protected:
225  boost::shared_ptr<ContactTree> contactTreePtr;
226  boost::shared_ptr<ContactOps::CommonData> commonDataPtr;
227  boost::shared_ptr<MatrixDouble> uH1Ptr;
228 
230  std::vector<EntityHandle> *mapGaussPtsPtr = nullptr;
231 
233 };
234 
235 } // namespace EshelbianPlasticity
EshelbianPlasticity::ContactTree::FaceData::FaceData
FaceData()=default
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dP::commonDataPtr
boost::shared_ptr< ContactOps::CommonData > commonDataPtr
Definition: EshelbianContact.hpp:172
EshelbianPlasticity::OpMoveNode
Definition: EshelbianContact.hpp:193
EshelbianPlasticity::ContactTree::buildTree
MoFEMErrorCode buildTree(Range &ents)
Definition: EshelbianContact.cpp:971
EshelbianPlasticity::OpTreeSearch::UOP
FaceElementForcesAndSourcesCore::UserDataOperator UOP
Definition: EshelbianContact.hpp:211
EntityHandle
EshelbianPlasticity::OpConstrainBoundaryHDivLhs_dU::OpConstrainBoundaryHDivLhs_dU
OpConstrainBoundaryHDivLhs_dU(const std::string row_field_name, const std::string col_field_name, boost::shared_ptr< ContactOps::CommonData > common_data_ptr, boost::shared_ptr< ContactTree > contact_tree_ptr)
Definition: EshelbianContact.cpp:773
ContactOps
Definition: EshelbianContact.hpp:10
ContactOps::EntData
EntitiesFieldData::EntData EntData
Definition: EshelbianContact.hpp:12
EshelbianPlasticity::OpMoveNode::UOP
FaceElementForcesAndSourcesCore::UserDataOperator UOP
Definition: EshelbianContact.hpp:195
EshelbianPlasticity::OpConstrainBoundaryL2Rhs::sdfMapRangePtr
boost::shared_ptr< std::map< int, Range > > sdfMapRangePtr
Definition: EshelbianContact.hpp:126
EshelbianPlasticity::OpConstrainBoundaryHDivRhs::commonDataPtr
boost::shared_ptr< ContactOps::CommonData > commonDataPtr
Definition: EshelbianContact.hpp:139
EshelbianPlasticity::ContactTree::getTreeSurfPtr
boost::shared_ptr< OrientedBoxTreeTool > & getTreeSurfPtr()
Definition: EshelbianContact.hpp:41
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
EshelbianPlasticity::ContactTree::FaceData::masterPoint
std::array< double, 3 > masterPoint
Definition: EshelbianContact.hpp:53
EshelbianPlasticity::OpTreeSearch::contactTreePtr
boost::shared_ptr< ContactTree > contactTreePtr
Definition: EshelbianContact.hpp:225
EshelbianPlasticity::OpTreeSearch::OpTreeSearch
OpTreeSearch(boost::shared_ptr< ContactTree > contact_tree_ptr, boost::shared_ptr< ContactOps::CommonData > common_data_ptr, boost::shared_ptr< MatrixDouble > u_h1_ptr, Range r, moab::Interface *post_proc_mesh_ptr, std::vector< EntityHandle > *map_gauss_pts_ptr)
Definition: EshelbianContact.cpp:1058
EshelbianPlasticity
Definition: CGGTonsorialBubbleBase.hpp:11
EshelbianPlasticity::OpConstrainBoundaryHDivLhs_dU::commonDataPtr
boost::shared_ptr< ContactOps::CommonData > commonDataPtr
Definition: EshelbianContact.hpp:189
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
EshelbianPlasticity::ContactTree::postProcess
MoFEMErrorCode postProcess()
function is run at the end of loop
Definition: EshelbianContact.cpp:928
EshelbianPlasticity::OpTreeSearch::contactRange
Range contactRange
Definition: EshelbianContact.hpp:232
OpBase
OpBaseImpl< PETSC, EdgeEleOp > OpBase
Definition: radiation.cpp:29
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dP::contactTreePtr
boost::shared_ptr< ContactTree > contactTreePtr
Definition: EshelbianContact.hpp:173
EshelbianPlasticity::ContactTree::getFaceDataPtr
auto getFaceDataPtr(std::vector< FaceData >::iterator &it, int gg, std::vector< FaceData > *vec_ptr)
Definition: EshelbianContact.hpp:81
EshelbianPlasticity::OpMoveNode::contactTreePtr
boost::shared_ptr< ContactTree > contactTreePtr
Definition: EshelbianContact.hpp:204
EshelbianPlasticity::ContactTree::FaceData
Definition: EshelbianContact.hpp:50
sdf.r
int r
Definition: sdf.py:8
EshelbianPlasticity::ContactTree::ContactTree
ContactTree(MoFEM::Interface &m_field, boost::shared_ptr< moab::Core > core_mesh_ptr, int max_order, std::map< int, Range > &&body_map)
Definition: EshelbianContact.cpp:858
EshelbianPlasticity::ContactTree::thSmallX
Tag thSmallX
Definition: EshelbianContact.hpp:103
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
EshelbianPlasticity::OpMoveNode::OpMoveNode
OpMoveNode(boost::shared_ptr< ContactTree > contact_tree_ptr, boost::shared_ptr< ContactOps::CommonData > common_data_ptr, boost::shared_ptr< MatrixDouble > u_h1_ptr)
Definition: EshelbianContact.cpp:984
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dU::sdfMapRangePtr
boost::shared_ptr< std::map< int, Range > > sdfMapRangePtr
Definition: EshelbianContact.hpp:157
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1975
MoFEM::PostProcBrokenMeshInMoabBase< FaceElementForcesAndSourcesCore >::refElementsMap
std::map< EntityType, PostProcGenerateRefMeshPtr > refElementsMap
Definition: PostProcBrokenMeshInMoabBase.hpp:171
EshelbianPlasticity::ContactTree::MapFaceData
std::map< EntityHandle, std::vector< FaceData > > MapFaceData
Definition: EshelbianContact.hpp:70
EshelbianPlasticity::ContactTree::FaceData::unitRay
std::array< double, 3 > unitRay
Definition: EshelbianContact.hpp:55
EshelbianPlasticity::ContactTree::thEleId
Tag thEleId
Definition: EshelbianContact.hpp:98
EshelbianPlasticity::OpConstrainBoundaryHDivRhs::contactTreePtr
boost::shared_ptr< ContactTree > contactTreePtr
Definition: EshelbianContact.hpp:140
ContactOps::scale
double scale
Definition: EshelbianContact.hpp:22
EshelbianPlasticity::ContactTree::rootSetSurf
EntityHandle rootSetSurf
Definition: EshelbianContact.hpp:96
EshelbianPlasticity::ContactTree::shadowDataMap
MapFaceData shadowDataMap
Definition: EshelbianContact.hpp:107
EshelbianPlasticity::OpTreeSearch::postProcMeshPtr
moab::Interface * postProcMeshPtr
Definition: EshelbianContact.hpp:229
BoundaryEleOp
EshelbianPlasticity::ContactTree::FaceData::slavePointNodes
std::array< double, 9 > slavePointNodes
Definition: EshelbianContact.hpp:64
EshelbianPlasticity::ContactTree::thBodyId
Tag thBodyId
Definition: EshelbianContact.hpp:102
convert.type
type
Definition: convert.py:64
EshelbianPlasticity::ContactTree::getMaxLevel
int getMaxLevel() const
Definition: EshelbianContact.hpp:45
EshelbianPlasticity::OpConstrainBoundaryHDivLhs_dU
Definition: EshelbianContact.hpp:177
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dU::commonDataPtr
boost::shared_ptr< ContactOps::CommonData > commonDataPtr
Definition: EshelbianContact.hpp:155
EshelbianPlasticity::OpConstrainBoundaryHDivRhs::iNtegrate
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data)
Definition: EshelbianContact.cpp:435
EshelbianPlasticity::ContactTree::bodyMap
std::map< int, Range > bodyMap
Definition: EshelbianContact.hpp:109
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dU::iNtegrate
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
Definition: EshelbianContact.cpp:511
EshelbianPlasticity::OpConstrainBoundaryHDivRhs
Definition: EshelbianContact.hpp:129
EshelbianPlasticity::ContactTree::FaceData::gaussPtNb
int gaussPtNb
Definition: EshelbianContact.hpp:51
ContactOps::AssemblyBoundaryEleOp
FormsIntegrators< BoundaryEleOp >::Assembly< A >::OpBase AssemblyBoundaryEleOp
Definition: EshelbianContact.hpp:17
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dU
Definition: EshelbianContact.hpp:143
EshelbianPlasticity::ContactTree::FaceData::masterPointNodes
std::array< double, 9 > masterPointNodes
Definition: EshelbianContact.hpp:62
EshelbianPlasticity::OpConstrainBoundaryHDivRhs::OpConstrainBoundaryHDivRhs
OpConstrainBoundaryHDivRhs(const std::string row_field_name, boost::shared_ptr< ContactOps::CommonData > common_data_ptr, boost::shared_ptr< ContactTree > contact_tree_ptr)
Definition: EshelbianContact.cpp:426
EshelbianPlasticity::OpConstrainBoundaryHDivLhs_dU::iNtegrate
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
Definition: EshelbianContact.cpp:784
EshelbianPlasticity::ContactTree::preProcess
MoFEMErrorCode preProcess()
function is run at the beginning of loop
Definition: EshelbianContact.cpp:922
EshelbianPlasticity::ContactTree::treeSurfPtr
boost::shared_ptr< OrientedBoxTreeTool > treeSurfPtr
Definition: EshelbianContact.hpp:95
EshelbianPlasticity::OpConstrainBoundaryHDivLhs_dU::contactTreePtr
boost::shared_ptr< ContactTree > contactTreePtr
Definition: EshelbianContact.hpp:190
ContactOps::alpha_contact_const
double alpha_contact_const
Definition: EshelbianContact.hpp:20
FaceElementForcesAndSourcesCore
ContactOps.hpp
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dP::OpConstrainBoundaryL2Lhs_dP
OpConstrainBoundaryL2Lhs_dP(const std::string row_field_name, const std::string col_field_name, boost::shared_ptr< ContactOps::CommonData > common_data_ptr, boost::shared_ptr< ContactTree > contact_tree_ptr, boost::shared_ptr< std::map< int, Range >> sdf_map_range_ptr=nullptr)
Definition: EshelbianContact.cpp:638
EshelbianPlasticity::OpConstrainBoundaryL2Rhs::OpConstrainBoundaryL2Rhs
OpConstrainBoundaryL2Rhs(const std::string row_field_name, boost::shared_ptr< ContactOps::CommonData > common_data_ptr, boost::shared_ptr< ContactTree > contact_tree_ptr, boost::shared_ptr< std::map< int, Range >> sdf_map_range_ptr=nullptr)
Definition: EshelbianContact.cpp:293
EshelbianPlasticity::ContactTree::Base
PostProcBrokenMeshInMoabBase< FaceElementForcesAndSourcesCore > Base
Definition: EshelbianContact.hpp:33
ContactOps::cn_contact
double cn_contact
Definition: EshelbianContact.hpp:19
EshelbianPlasticity::ContactTree::findFaceDataVecPtr
auto findFaceDataVecPtr(EntityHandle fe_ent)
Definition: EshelbianContact.hpp:72
EshelbianPlasticity::ContactTree::thTraction
Tag thTraction
Definition: EshelbianContact.hpp:105
EshelbianPlasticity::ContactTree::FaceData::slavePoint
std::array< double, 3 > slavePoint
Definition: EshelbianContact.hpp:52
Range
EshelbianPlasticity::ContactTree::FaceData::masterTractionNodes
std::array< double, 9 > masterTractionNodes
Definition: EshelbianContact.hpp:63
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dP::sdfMapRangePtr
boost::shared_ptr< std::map< int, Range > > sdfMapRangePtr
Definition: EshelbianContact.hpp:174
EshelbianPlasticity::OpTreeSearch::uH1Ptr
boost::shared_ptr< MatrixDouble > uH1Ptr
Definition: EshelbianContact.hpp:227
EshelbianPlasticity::OpConstrainBoundaryL2Rhs
Definition: EshelbianContact.hpp:114
EshelbianPlasticity::ContactTree::FaceData::rayPoint
std::array< double, 3 > rayPoint
Definition: EshelbianContact.hpp:54
EshelbianPlasticity::OpMoveNode::commonDataPtr
boost::shared_ptr< ContactOps::CommonData > commonDataPtr
Definition: EshelbianContact.hpp:206
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dU::contactTreePtr
boost::shared_ptr< ContactTree > contactTreePtr
Definition: EshelbianContact.hpp:156
EshelbianPlasticity::OpMoveNode::doWork
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Definition: EshelbianContact.cpp:991
UserDataOperator
ForcesAndSourcesCore::UserDataOperator UserDataOperator
Definition: HookeElement.hpp:75
EshelbianPlasticity::OpTreeSearch::doWork
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Definition: EshelbianContact.cpp:1072
EshelbianPlasticity::OpMoveNode::uH1Ptr
boost::shared_ptr< MatrixDouble > uH1Ptr
Definition: EshelbianContact.hpp:205
EshelbianPlasticity::ContactTree::FaceData::eleRadius
double eleRadius
Definition: EshelbianContact.hpp:56
EshelbianPlasticity::OpConstrainBoundaryL2Rhs::iNtegrate
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data)
Definition: EshelbianContact.cpp:323
EshelbianPlasticity::OpTreeSearch::mapGaussPtsPtr
std::vector< EntityHandle > * mapGaussPtsPtr
Definition: EshelbianContact.hpp:230
EshelbianPlasticity::ContactTree::maxOrder
const int maxOrder
Definition: EshelbianContact.hpp:111
AssemblyBoundaryEleOp
EshelbianPlasticity::OpConstrainBoundaryL2Rhs::contactTreePtr
boost::shared_ptr< ContactTree > contactTreePtr
Definition: EshelbianContact.hpp:125
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dP::iNtegrate
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
Definition: EshelbianContact.cpp:652
EshelbianPlasticity::ContactTree::getRootSetSurf
auto getRootSetSurf()
Definition: EshelbianContact.hpp:44
EshelbianPlasticity::ContactTree
Definition: EshelbianContact.hpp:30
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dP
Definition: EshelbianContact.hpp:160
ContactOps::alpha_contact_quadratic
double alpha_contact_quadratic
Definition: EshelbianContact.hpp:21
EshelbianPlasticity::OpTreeSearch::commonDataPtr
boost::shared_ptr< ContactOps::CommonData > commonDataPtr
Definition: EshelbianContact.hpp:226
EshelbianPlasticity::OpConstrainBoundaryL2Rhs::commonDataPtr
boost::shared_ptr< ContactOps::CommonData > commonDataPtr
Definition: EshelbianContact.hpp:124
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dU::OpConstrainBoundaryL2Lhs_dU
OpConstrainBoundaryL2Lhs_dU(const std::string row_field_name, const std::string col_field_name, boost::shared_ptr< ContactOps::CommonData > common_data_ptr, boost::shared_ptr< ContactTree > contact_tree_ptr, boost::shared_ptr< std::map< int, Range >> sdf_map_range_ptr=nullptr)
Definition: EshelbianContact.cpp:497
EshelbianPlasticity::ContactTree::FaceData::slaveTractionNodes
std::array< double, 9 > slaveTractionNodes
Definition: EshelbianContact.hpp:65
EshelbianPlasticity::ContactTree::thLargeX
Tag thLargeX
Definition: EshelbianContact.hpp:104
EshelbianPlasticity::OpTreeSearch
Definition: EshelbianContact.hpp:209