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 using SideEle = FaceElementForcesAndSourcesCoreOnSide;
16 
18  FormsIntegrators<BoundaryEleOp>::Assembly<A>::OpBase;
19 
20 double cn_contact = 1;
23 double scale = 1;
24 
25 double airplane_ray_distance = 1; // thi is point from which plane send ray.
26  // This is multiple of elem radius.
27 
28 } // namespace ContactOps
29 
30 #include <ContactOps.hpp>
31 
32 namespace EshelbianPlasticity {
33 
35  : public PostProcBrokenMeshInMoabBase<FaceElementForcesAndSourcesCore> {
36 
37  using Base = PostProcBrokenMeshInMoabBase<FaceElementForcesAndSourcesCore>;
38  using Base::refElementsMap;
39 
41  boost::shared_ptr<moab::Core> core_mesh_ptr, int max_order,
42  std::map<int, Range> &&body_map);
45  inline boost::shared_ptr<OrientedBoxTreeTool> &getTreeSurfPtr() {
46  return treeSurfPtr;
47  }
48  inline auto getRootSetSurf() { return rootSetSurf; }
49  int getMaxLevel() const { return refElementsMap.at(MBTRI)->defMaxLevel; }
50 
51  friend struct OpMoveNode;
52  friend struct OpTreeSearch;
53 
54  struct FaceData {
55  int gaussPtNb; //< integration points number
56  std::array<double, 3> slavePoint;
57  std::array<double, 3> masterPoint;
58  std::array<double, 3> rayPoint;
59  std::array<double, 3> unitRay;
60  double eleRadius;
61 
62  // std::vector<int> dofsSlaveIds;
63  // std::vector<double> dofsSlaveCoeff;
64  // std::vector<double> baseSlaveFuncs;
65 
66  std::array<double, 9> masterPointNodes;
67  std::array<double, 9> masterTractionNodes;
68  std::array<double, 9> slavePointNodes;
69  std::array<double, 9> slaveTractionNodes;
70 
71  FaceData() = default;
72  };
73 
74  using MapFaceData = std::map<EntityHandle, std::vector<FaceData>>;
75 
76  inline auto findFaceDataVecPtr(EntityHandle fe_ent) {
77  auto &map_face_data = shadowDataMap;
78  auto it = map_face_data.find(fe_ent);
79  if (it == map_face_data.end()) {
80  return (std::vector<FaceData> *)nullptr;
81  }
82  return &(it->second);
83  }
84 
85  inline auto getFaceDataPtr(std::vector<FaceData>::iterator &it, int gg,
86  std::vector<FaceData> *vec_ptr) {
87  FaceData *face_data_ptr = nullptr;
88  if (it != vec_ptr->end()) {
89  if (it->gaussPtNb == gg) {
90  face_data_ptr = &(*it);
91  ++it;
92  }
93  }
94  return face_data_ptr;
95  }
96 
97 protected:
99  boost::shared_ptr<OrientedBoxTreeTool> treeSurfPtr;
101 
102  Tag thEleId;
103  // Tag thCoeff;
104  // Tag thIds;
105  // Tag thBases;
106  Tag thBodyId;
107  Tag thSmallX;
108  Tag thLargeX;
110 
112 
113  std::map<int, Range> bodyMap;
114 
115  const int maxOrder;
116 };
117 
120  const std::string row_field_name,
121  boost::shared_ptr<ContactOps::CommonData> common_data_ptr,
122  boost::shared_ptr<ContactTree> contact_tree_ptr,
123  boost::shared_ptr<std::map<int, Range>> sdf_map_range_ptr = nullptr);
124 
126 
127 private:
128  boost::shared_ptr<ContactOps::CommonData> commonDataPtr;
129  boost::shared_ptr<ContactTree> contactTreePtr;
130  boost::shared_ptr<std::map<int, Range>> sdfMapRangePtr;
131 };
132 
133 template <AssemblyType A, IntegrationType I>
135 
136 template <AssemblyType A>
138  : public FormsIntegrators<FaceUserDataOperator>::Assembly<A>::OpBrokenBase {
139 
140  using OP = typename FormsIntegrators<FaceUserDataOperator>::Assembly<
142 
144  boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
145  boost::shared_ptr<ContactOps::CommonData> common_data_ptr,
146  boost::shared_ptr<ContactTree> contact_tree_ptr);
147 
148  MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data);
149 
150 private:
151  boost::shared_ptr<ContactOps::CommonData> commonDataPtr;
152  boost::shared_ptr<ContactTree> contactTreePtr;
153 };
154 
156 
158  const std::string row_field_name, const std::string col_field_name,
159  boost::shared_ptr<ContactOps::CommonData> common_data_ptr,
160  boost::shared_ptr<ContactTree> contact_tree_ptr,
161  boost::shared_ptr<std::map<int, Range>> sdf_map_range_ptr = nullptr);
162 
164  EntitiesFieldData::EntData &col_data);
165 
166 private:
167  boost::shared_ptr<ContactOps::CommonData> commonDataPtr;
168  boost::shared_ptr<ContactTree> contactTreePtr;
169  boost::shared_ptr<std::map<int, Range>> sdfMapRangePtr;
170 };
171 
172 template <AssemblyType A, IntegrationType I> struct OpConstrainBoundaryL2Lhs_dP;
173 
174 template <AssemblyType A>
176  : public FormsIntegrators<FaceUserDataOperator>::Assembly<A>::OpBrokenBase {
177 
178  using OP = typename FormsIntegrators<FaceUserDataOperator>::Assembly<
180 
182  std::string row_field_name,
183  boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
184  boost::shared_ptr<ContactOps::CommonData> common_data_ptr,
185  boost::shared_ptr<ContactTree> contact_tree_ptr,
186  boost::shared_ptr<std::map<int, Range>> sdf_map_range_ptr = nullptr);
187 
188  MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data,
189  EntitiesFieldData::EntData &col_data);
190 
191 private:
192  boost::shared_ptr<ContactOps::CommonData> commonDataPtr;
193  boost::shared_ptr<ContactTree> contactTreePtr;
194  boost::shared_ptr<std::map<int, Range>> sdfMapRangePtr;
195 };
196 
197 template <AssemblyType A, IntegrationType I>
199 
200 template <AssemblyType A>
202  : public FormsIntegrators<FaceUserDataOperator>::Assembly<A>::OpBrokenBase {
203 
204  using OP = typename FormsIntegrators<FaceUserDataOperator>::Assembly<
206 
208  boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
209  std::string col_field_name,
210  boost::shared_ptr<ContactOps::CommonData> common_data_ptr,
211  boost::shared_ptr<ContactTree> contact_tree_ptr);
212 
213  MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data,
214  EntitiesFieldData::EntData &col_data);
215 
216 private:
217  boost::shared_ptr<ContactOps::CommonData> commonDataPtr;
218  boost::shared_ptr<ContactTree> contactTreePtr;
219 };
220 
222 
224 
225  OpMoveNode(boost::shared_ptr<ContactTree> contact_tree_ptr,
226  boost::shared_ptr<ContactOps::CommonData> common_data_ptr,
227  boost::shared_ptr<MatrixDouble> u_h1_ptr);
228  MoFEMErrorCode doWork(int side, EntityType type,
230 
231 protected:
232  boost::shared_ptr<ContactTree> contactTreePtr;
233  boost::shared_ptr<MatrixDouble> uH1Ptr;
234  boost::shared_ptr<ContactOps::CommonData> commonDataPtr;
235 };
236 
238 
240 
241  OpTreeSearch(boost::shared_ptr<ContactTree> contact_tree_ptr,
242  boost::shared_ptr<ContactOps::CommonData> common_data_ptr,
243  boost::shared_ptr<MatrixDouble> u_h1_ptr, Range r,
244 
245  moab::Interface *post_proc_mesh_ptr,
246  std::vector<EntityHandle> *map_gauss_pts_ptr
247 
248  );
249  MoFEMErrorCode doWork(int side, EntityType type,
251 
252 protected:
253  boost::shared_ptr<ContactTree> contactTreePtr;
254  boost::shared_ptr<ContactOps::CommonData> commonDataPtr;
255  boost::shared_ptr<MatrixDouble> uH1Ptr;
256 
258  std::vector<EntityHandle> *mapGaussPtsPtr = nullptr;
259 
261 };
262 
263 } // namespace EshelbianPlasticity
ContactOps::airplane_ray_distance
double airplane_ray_distance
Definition: EshelbianContact.hpp:25
EshelbianPlasticity::ContactTree::FaceData::FaceData
FaceData()=default
EshelbianPlasticity::OpMoveNode
Definition: EshelbianContact.hpp:221
EshelbianPlasticity::ContactTree::buildTree
MoFEMErrorCode buildTree(Range &ents)
Definition: EshelbianContact.cpp:1040
EshelbianPlasticity::OpTreeSearch::UOP
FaceElementForcesAndSourcesCore::UserDataOperator UOP
Definition: EshelbianContact.hpp:239
EntityHandle
ContactOps
Definition: contact.cpp:99
ContactOps::EntData
EntitiesFieldData::EntData EntData
Definition: EshelbianContact.hpp:12
EshelbianPlasticity::OpMoveNode::UOP
FaceElementForcesAndSourcesCore::UserDataOperator UOP
Definition: EshelbianContact.hpp:223
EshelbianPlasticity::OpConstrainBoundaryL2Rhs::sdfMapRangePtr
boost::shared_ptr< std::map< int, Range > > sdfMapRangePtr
Definition: EshelbianContact.hpp:130
EshelbianPlasticity::ContactTree::getTreeSurfPtr
boost::shared_ptr< OrientedBoxTreeTool > & getTreeSurfPtr()
Definition: EshelbianContact.hpp:45
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:57
EshelbianPlasticity::OpTreeSearch::contactTreePtr
boost::shared_ptr< ContactTree > contactTreePtr
Definition: EshelbianContact.hpp:253
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:1127
EshelbianPlasticity
Definition: CGGTonsorialBubbleBase.hpp:11
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:997
EshelbianPlasticity::OpTreeSearch::contactRange
Range contactRange
Definition: EshelbianContact.hpp:260
OpBase
OpBaseImpl< PETSC, EdgeEleOp > OpBase
Definition: radiation.cpp:29
EshelbianPlasticity::ContactTree::getFaceDataPtr
auto getFaceDataPtr(std::vector< FaceData >::iterator &it, int gg, std::vector< FaceData > *vec_ptr)
Definition: EshelbianContact.hpp:85
EshelbianPlasticity::OpMoveNode::contactTreePtr
boost::shared_ptr< ContactTree > contactTreePtr
Definition: EshelbianContact.hpp:232
EshelbianPlasticity::ContactTree::FaceData
Definition: EshelbianContact.hpp:54
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:927
EshelbianPlasticity::OpConstrainBoundaryHDivLhs_dU< A, IntegrationType::GAUSS >::commonDataPtr
boost::shared_ptr< ContactOps::CommonData > commonDataPtr
Definition: EshelbianContact.hpp:217
EshelbianPlasticity::ContactTree::thSmallX
Tag thSmallX
Definition: EshelbianContact.hpp:107
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:1053
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dU::sdfMapRangePtr
boost::shared_ptr< std::map< int, Range > > sdfMapRangePtr
Definition: EshelbianContact.hpp:169
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:2010
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:74
EshelbianPlasticity::ContactTree::FaceData::unitRay
std::array< double, 3 > unitRay
Definition: EshelbianContact.hpp:59
EshelbianPlasticity::ContactTree::thEleId
Tag thEleId
Definition: EshelbianContact.hpp:102
ContactOps::scale
double scale
Definition: EshelbianContact.hpp:23
EshelbianPlasticity::ContactTree::rootSetSurf
EntityHandle rootSetSurf
Definition: EshelbianContact.hpp:100
EshelbianPlasticity::ContactTree::shadowDataMap
MapFaceData shadowDataMap
Definition: EshelbianContact.hpp:111
EshelbianPlasticity::OpTreeSearch::postProcMeshPtr
moab::Interface * postProcMeshPtr
Definition: EshelbianContact.hpp:257
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dP< A, IntegrationType::GAUSS >::contactTreePtr
boost::shared_ptr< ContactTree > contactTreePtr
Definition: EshelbianContact.hpp:193
BoundaryEleOp
EshelbianPlasticity::ContactTree::FaceData::slavePointNodes
std::array< double, 9 > slavePointNodes
Definition: EshelbianContact.hpp:68
EshelbianPlasticity::ContactTree::thBodyId
Tag thBodyId
Definition: EshelbianContact.hpp:106
convert.type
type
Definition: convert.py:64
EshelbianPlasticity::ContactTree::getMaxLevel
int getMaxLevel() const
Definition: EshelbianContact.hpp:49
EshelbianPlasticity::OpConstrainBoundaryHDivLhs_dU
Definition: EshelbianContact.hpp:198
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dU::commonDataPtr
boost::shared_ptr< ContactOps::CommonData > commonDataPtr
Definition: EshelbianContact.hpp:167
EshelbianPlasticity::ContactTree::bodyMap
std::map< int, Range > bodyMap
Definition: EshelbianContact.hpp:113
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dU::iNtegrate
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
Definition: EshelbianContact.cpp:545
EshelbianPlasticity::OpConstrainBoundaryHDivRhs
Definition: EshelbianContact.hpp:134
EshelbianPlasticity::ContactTree::FaceData::gaussPtNb
int gaussPtNb
Definition: EshelbianContact.hpp:55
MoFEM::GAUSS
@ GAUSS
Definition: FormsIntegrators.hpp:136
ContactOps::AssemblyBoundaryEleOp
FormsIntegrators< BoundaryEleOp >::Assembly< A >::OpBase AssemblyBoundaryEleOp
Definition: EshelbianContact.hpp:18
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dU
Definition: EshelbianContact.hpp:155
EshelbianPlasticity::ContactTree::FaceData::masterPointNodes
std::array< double, 9 > masterPointNodes
Definition: EshelbianContact.hpp:66
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dP< A, IntegrationType::GAUSS >::sdfMapRangePtr
boost::shared_ptr< std::map< int, Range > > sdfMapRangePtr
Definition: EshelbianContact.hpp:194
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dP< A, IntegrationType::GAUSS >::commonDataPtr
boost::shared_ptr< ContactOps::CommonData > commonDataPtr
Definition: EshelbianContact.hpp:192
EshelbianPlasticity::ContactTree::preProcess
MoFEMErrorCode preProcess()
function is run at the beginning of loop
Definition: EshelbianContact.cpp:991
EshelbianPlasticity::ContactTree::treeSurfPtr
boost::shared_ptr< OrientedBoxTreeTool > treeSurfPtr
Definition: EshelbianContact.hpp:99
ContactOps::alpha_contact_const
double alpha_contact_const
Definition: EshelbianContact.hpp:21
FaceElementForcesAndSourcesCore
ContactOps.hpp
MoFEM::IntegrationType
IntegrationType
Form integrator integration types.
Definition: FormsIntegrators.hpp:136
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:305
EshelbianPlasticity::ContactTree::Base
PostProcBrokenMeshInMoabBase< FaceElementForcesAndSourcesCore > Base
Definition: EshelbianContact.hpp:37
ContactOps::cn_contact
double cn_contact
Definition: contact.cpp:100
EshelbianPlasticity::OpConstrainBoundaryHDivRhs< A, IntegrationType::GAUSS >::commonDataPtr
boost::shared_ptr< ContactOps::CommonData > commonDataPtr
Definition: EshelbianContact.hpp:151
ContactOps::SideEle
PostProcEleByDim< SPACE_DIM >::SideEle SideEle
Definition: PostProcContact.hpp:25
EshelbianPlasticity::ContactTree::findFaceDataVecPtr
auto findFaceDataVecPtr(EntityHandle fe_ent)
Definition: EshelbianContact.hpp:76
EshelbianPlasticity::ContactTree::thTraction
Tag thTraction
Definition: EshelbianContact.hpp:109
EshelbianPlasticity::ContactTree::FaceData::slavePoint
std::array< double, 3 > slavePoint
Definition: EshelbianContact.hpp:56
Range
EshelbianPlasticity::ContactTree::FaceData::masterTractionNodes
std::array< double, 9 > masterTractionNodes
Definition: EshelbianContact.hpp:67
EshelbianPlasticity::OpTreeSearch::uH1Ptr
boost::shared_ptr< MatrixDouble > uH1Ptr
Definition: EshelbianContact.hpp:255
EshelbianPlasticity::OpConstrainBoundaryL2Rhs
Definition: EshelbianContact.hpp:118
EshelbianPlasticity::ContactTree::FaceData::rayPoint
std::array< double, 3 > rayPoint
Definition: EshelbianContact.hpp:58
EshelbianPlasticity::OpMoveNode::commonDataPtr
boost::shared_ptr< ContactOps::CommonData > commonDataPtr
Definition: EshelbianContact.hpp:234
EshelbianPlasticity::OpConstrainBoundaryHDivRhs< A, IntegrationType::GAUSS >::contactTreePtr
boost::shared_ptr< ContactTree > contactTreePtr
Definition: EshelbianContact.hpp:152
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dU::contactTreePtr
boost::shared_ptr< ContactTree > contactTreePtr
Definition: EshelbianContact.hpp:168
EshelbianPlasticity::OpMoveNode::doWork
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Definition: EshelbianContact.cpp:1060
UserDataOperator
ForcesAndSourcesCore::UserDataOperator UserDataOperator
Definition: HookeElement.hpp:75
EshelbianPlasticity::OpTreeSearch::doWork
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Definition: EshelbianContact.cpp:1141
EshelbianPlasticity::OpMoveNode::uH1Ptr
boost::shared_ptr< MatrixDouble > uH1Ptr
Definition: EshelbianContact.hpp:233
EshelbianPlasticity::ContactTree::FaceData::eleRadius
double eleRadius
Definition: EshelbianContact.hpp:60
EshelbianPlasticity::OpConstrainBoundaryL2Rhs::iNtegrate
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data)
Definition: EshelbianContact.cpp:342
EshelbianPlasticity::OpTreeSearch::mapGaussPtsPtr
std::vector< EntityHandle > * mapGaussPtsPtr
Definition: EshelbianContact.hpp:258
EshelbianPlasticity::ContactTree::maxOrder
const int maxOrder
Definition: EshelbianContact.hpp:115
AssemblyBoundaryEleOp
EshelbianPlasticity::OpConstrainBoundaryL2Rhs::contactTreePtr
boost::shared_ptr< ContactTree > contactTreePtr
Definition: EshelbianContact.hpp:129
EshelbianPlasticity::ContactTree::getRootSetSurf
auto getRootSetSurf()
Definition: EshelbianContact.hpp:48
EshelbianPlasticity::ContactTree
Definition: EshelbianContact.hpp:34
EshelbianPlasticity::OpConstrainBoundaryL2Lhs_dP
Definition: EshelbianContact.hpp:172
ContactOps::alpha_contact_quadratic
double alpha_contact_quadratic
Definition: EshelbianContact.hpp:22
OP
EshelbianPlasticity::OpTreeSearch::commonDataPtr
boost::shared_ptr< ContactOps::CommonData > commonDataPtr
Definition: EshelbianContact.hpp:254
OpBrokenBase
EshelbianPlasticity::OpConstrainBoundaryL2Rhs::commonDataPtr
boost::shared_ptr< ContactOps::CommonData > commonDataPtr
Definition: EshelbianContact.hpp:128
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:531
EshelbianPlasticity::ContactTree::FaceData::slaveTractionNodes
std::array< double, 9 > slaveTractionNodes
Definition: EshelbianContact.hpp:69
EshelbianPlasticity::ContactTree::thLargeX
Tag thLargeX
Definition: EshelbianContact.hpp:108
EshelbianPlasticity::OpTreeSearch
Definition: EshelbianContact.hpp:237
EshelbianPlasticity::OpConstrainBoundaryHDivLhs_dU< A, IntegrationType::GAUSS >::contactTreePtr
boost::shared_ptr< ContactTree > contactTreePtr
Definition: EshelbianContact.hpp:218