v0.14.0
MortarContactInterface.cpp
Go to the documentation of this file.
1 
2 
3 #ifdef __cplusplus
4 extern "C" {
5 #endif
6 #include <phg-quadrule/quad.h>
7 #ifdef __cplusplus
8 }
9 #endif
10 
11 #include <Mortar.hpp>
12 
13 std::vector<BitRefLevel> &MortarContactInterface::getBitRefLevelVector() {
14  return bitLevels;
15 }
16 
17 boost::ptr_deque<MoFEM::ForcesAndSourcesCore::UserDataOperator> &
19  return fePostProcSimpleContact->getOpPtrVector();
20 }
21 
24 
25  CHKERR PetscOptionsBegin(PETSC_COMM_WORLD, "", "Mortar Config", "none");
26 
27  CHKERR PetscOptionsInt(
28  "-order_contact",
29  "approximation order of spatial positions in contact interface", "", 1,
30  &orderContact, PETSC_NULL);
31  CHKERR PetscOptionsInt("-ho_levels_num", "number of higher order levels", "",
32  0, &nbHoLevels, PETSC_NULL);
33  CHKERR PetscOptionsInt("-order_lambda",
34  "approximation order of Lagrange multipliers", "", 1,
35  &orderLambda, PETSC_NULL);
36  isPartitioned = PETSC_FALSE;
37  CHKERR PetscOptionsBool("-is_partitioned",
38  "set if mesh is partitioned (this result that each "
39  "process keeps only part of the mes",
40  "", PETSC_FALSE, &isPartitioned, PETSC_NULL);
41 
42  CHKERR PetscOptionsReal("-cn_value", "default regularisation cn value", "",
43  1., &cnValue, PETSC_NULL);
44 
45  CHKERR PetscOptionsReal("-post_proc_gap_tol",
46  "gap tolerance for post processing", "", 0.,
47  &postProcGapTol, PETSC_NULL);
48 
49  CHKERR PetscOptionsBool("-is_newton_cotes",
50  "set if Newton-Cotes quadrature rules are used", "",
51  PETSC_FALSE, &isNewtonCotes, PETSC_NULL);
52  CHKERR PetscOptionsBool("-convect", "set to convect integration pts", "",
53  PETSC_FALSE, &convectPts, PETSC_NULL);
54  CHKERR PetscOptionsBool("-print_contact_state",
55  "output number of active gp at every iteration", "",
56  PETSC_FALSE, &printContactState, PETSC_NULL);
57  CHKERR PetscOptionsBool("-alm_flag", "if set use ALM, if not use C-function",
58  "", PETSC_FALSE, &almFlag, PETSC_NULL);
59  CHKERR PetscOptionsBool("-debug", "output debug files", "", PETSC_FALSE,
60  &dEbug, PETSC_NULL);
61 
62  int order = 1;
63  CHKERR PetscOptionsInt("-order", "approximation order of spatial positions",
64  "", 1, &order, PETSC_NULL);
65  CHKERR this->setPositionFieldOrder(order);
66 
67  ierr = PetscOptionsEnd();
68  CHKERRQ(ierr);
69 
71 }
72 
75  auto &moab = mField.get_moab();
76 
77  bitLevels.push_back(BitRefLevel().set(0));
78  CHKERR mField.getInterface<BitRefManager>()->setBitRefLevelByDim(
79  0, 3, bitLevels.back());
80 
81  Range meshset_level0;
82  CHKERR mField.getInterface<BitRefManager>()->getEntitiesByRefLevel(
83  bitLevels.back(), BitRefLevel().set(), meshset_level0);
84  MOFEM_LOG("WORLD", Sev::verbose)
85  << "Meshset_level0 " << meshset_level0.size();
86 
87  contactCommondataMultiIndex = boost::make_shared<contactMIndex>();
88 
90 
91  for (auto &contact_surface_pair : contactSurfacePairs) {
92  slaveTris.merge(contact_surface_pair.first);
93  masterTris.merge(contact_surface_pair.second);
94 
95  ContactSearchKdTree contact_search_kd_tree(mField);
96 
97  CHKERR contact_search_kd_tree.buildTree(contact_surface_pair.second);
98 
99  CHKERR contact_search_kd_tree.contactSearchAlgorithm(
100  contact_surface_pair.second, contact_surface_pair.first,
102  }
103 
104  if (!masterTris.empty() && isPartitioned)
105  SETERRQ(PETSC_COMM_WORLD, MOFEM_NOT_IMPLEMENTED,
106  "Partitioned mesh is not supported with mortar contact");
107 
108  EntityHandle meshset_slave_master_prisms;
109  CHKERR moab.create_meshset(MESHSET_SET, meshset_slave_master_prisms);
110  CHKERR
111  moab.add_entities(meshset_slave_master_prisms, contactPrisms);
112  CHKERR mField.getInterface<BitRefManager>()->setBitRefLevelByDim(
113  meshset_slave_master_prisms, 3, bitLevels.back());
114 
115  if (dEbug)
116  CHKERR moab.write_mesh("slave_master_prisms.vtk",
117  &meshset_slave_master_prisms, 1);
118 
119  Range tris_from_prism;
120  // find actual masters and slave used
121  CHKERR mField.get_moab().get_adjacencies(
122  contactPrisms, 2, true, tris_from_prism, moab::Interface::UNION);
123 
124  tris_from_prism = tris_from_prism.subset_by_type(MBTRI);
125  slaveTris = intersect(tris_from_prism, slaveTris);
126 
127  if (dEbug) {
128  EntityHandle mshs_surf_slave;
129  CHKERR mField.get_moab().create_meshset(MESHSET_SET, mshs_surf_slave);
130  CHKERR mField.get_moab().add_entities(mshs_surf_slave, slaveTris);
131  CHKERR mField.get_moab().write_mesh("surf_slave.vtk", &mshs_surf_slave, 1);
132  // EntityHandle meshset_tri_slave;
133  // CHKERR mField.get_moab().create_meshset(MESHSET_SET, meshset_tri_slave);
134  }
135 
137 }
138 
141  auto &moab = mField.get_moab();
142 
145 
147 
149  MB_TAG_SPARSE, MF_ZERO);
154  CHKERR mField.set_field_order(0, MBVERTEX, meshNodeField, 1);
155  }
156 
158  // FIXME: TODO: we need to discuss how to
159  if (oRder < 0)
160  SETERRQ(PETSC_COMM_WORLD, MOFEM_DATA_INCONSISTENCY,
161  "set appropriate position field order, "
162  "setPositionFieldOrder(int order)");
163 
164  // Declare problem add entities (by tets) to the field
166  MB_TAG_SPARSE, MF_ZERO);
171  CHKERR mField.set_field_order(0, MBVERTEX, positionField, 1);
172  }
173 
175  MB_TAG_SPARSE, MF_ZERO);
177  CHKERR mField.set_field_order(0, MBTRI, "LAGMULT", orderLambda);
178  CHKERR mField.set_field_order(0, MBEDGE, "LAGMULT", orderLambda);
179  CHKERR mField.set_field_order(0, MBVERTEX, "LAGMULT", 1);
180 
181  auto set_contact_order = [&]() {
183  Range contact_tris, contact_edges;
184  CHKERR moab.get_adjacencies(contactPrisms, 2, false, contact_tris,
185  moab::Interface::UNION);
186  contact_tris = contact_tris.subset_by_type(MBTRI);
187  CHKERR moab.get_adjacencies(contact_tris, 1, false, contact_edges,
188  moab::Interface::UNION);
189  Range ho_ents;
190  ho_ents.merge(contact_tris);
191  ho_ents.merge(contact_edges);
192  for (int ll = 0; ll != nbHoLevels; ll++) {
193  Range ents, verts, tets;
194  CHKERR moab.get_connectivity(ho_ents, verts, true);
195  CHKERR moab.get_adjacencies(verts, 3, false, tets,
196  moab::Interface::UNION);
197  tets = tets.subset_by_type(MBTET);
198  for (auto d : {1, 2}) {
199  CHKERR moab.get_adjacencies(tets, d, false, ents,
200  moab::Interface::UNION);
201  }
202  ho_ents = unite(ho_ents, ents);
203  ho_ents = unite(ho_ents, tets);
204  }
205 
207 
209  };
210 
211  if (orderContact > oRder)
212  CHKERR set_contact_order();
213 
215 }
216 
218 
221 
222  contactProblemPtr = boost::make_shared<MortarContactProblem>(
223  mField, contactCommondataMultiIndex, boost::make_shared<double>(cnValue),
224  isNewtonCotes);
225 
226  // add fields to the global matrix by adding the element
227  contactProblemPtr->addMortarContactElement(
228  "CONTACT_ELEM", positionField, "LAGMULT", contactPrisms, meshNodeField);
229  contactProblemPtr->addPostProcContactElement(
230  "CONTACT_POST_PROC", positionField, "LAGMULT", meshNodeField, slaveTris);
231 
233 }
234 
236  return this->getBitRefLevelVector().back();
237 };
238 
241 
242  this->dM = dm;
243 
244  CHKERR DMMoFEMAddElement(this->dM, "CONTACT_ELEM");
245  CHKERR DMMoFEMAddElement(this->dM, "CONTACT_POST_PROC");
246 
247  auto simple = mField.getInterface<Simple>();
248  simple->getOtherFiniteElements().push_back("CONTACT_ELEM");
249  simple->getOtherFiniteElements().push_back("CONTACT_POST_PROC");
250 
252 }
253 
254 template <typename T, bool RHS>
257 
258  if (!dM)
259  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
260  "DM not defined, addElementsToDM(dm) first");
261 
262  auto &moab = mField.get_moab();
263 
264  auto make_contact_element = [&]() {
265  return boost::make_shared<MortarContactProblem::MortarContactElement>(
267  };
268 
269  auto make_convective_master_element = [&]() {
270  return boost::make_shared<
273  };
274 
275  auto make_convective_slave_element = [&]() {
276  return boost::make_shared<
279  };
280 
281  auto make_contact_common_data = [&]() {
282  return boost::make_shared<MortarContactProblem::CommonDataMortarContact>(
283  mField);
284  };
285 
286  auto get_contact_rhs = [&](auto make_element, bool is_alm = false,
287  bool is_displacements = false) {
288  auto fe_rhs_simple_contact = make_element();
289  auto common_data_mortar_contact = make_contact_common_data();
290  if (printContactState) {
291  fe_rhs_simple_contact->contactStateVec =
292  common_data_mortar_contact->gaussPtsStateVec;
293  }
294  fe_rhs_simple_contact->getOpPtrVector().push_back(
296  contactProblemPtr->setContactOperatorsRhs(
297  fe_rhs_simple_contact, common_data_mortar_contact, positionField,
298  "LAGMULT", is_alm, false, "", is_displacements);
299  fe_rhs_simple_contact->getOpPtrVector().push_back(
300  new OpUnSetBc(positionField));
301  return fe_rhs_simple_contact;
302  };
303 
304  auto get_master_traction_rhs = [&](auto make_element, bool is_alm = false,
305  bool is_displacements = false) {
306  auto fe_rhs_simple_contact = make_element();
307  fe_rhs_simple_contact->getOpPtrVector().push_back(
309  auto common_data_mortar_contact = make_contact_common_data();
310  contactProblemPtr->setMasterForceOperatorsRhs(
311  fe_rhs_simple_contact, common_data_mortar_contact, positionField,
312  "LAGMULT", is_alm, false, "", is_displacements);
313  fe_rhs_simple_contact->getOpPtrVector().push_back(
314  new OpUnSetBc(positionField));
315  return fe_rhs_simple_contact;
316  };
317 
318  auto get_master_traction_lhs = [&](auto make_element, bool is_alm = false,
319  bool is_displacements = false) {
320  auto fe_lhs_simple_contact = make_element();
321  auto common_data_mortar_contact = make_contact_common_data();
322  fe_lhs_simple_contact->getOpPtrVector().push_back(
324  contactProblemPtr->setMasterForceOperatorsLhs(
325  fe_lhs_simple_contact, common_data_mortar_contact, positionField,
326  "LAGMULT", is_alm, false, "", is_displacements);
327  fe_lhs_simple_contact->getOpPtrVector().push_back(
328  new OpUnSetBc(positionField));
329  return fe_lhs_simple_contact;
330  };
331 
332  auto get_master_help_traction_lhs = [&](auto make_element,
333  bool is_alm = false,
334  bool is_displacements = false) {
335  auto fe_lhs_simple_contact = make_element();
336  auto common_data_mortar_contact = make_contact_common_data();
337  fe_lhs_simple_contact->getOpPtrVector().push_back(
339  contactProblemPtr->setMasterForceOperatorsLhs(
340  fe_lhs_simple_contact, common_data_mortar_contact, positionField,
341  "LAGMULT", is_alm, false, "", is_displacements);
342  fe_lhs_simple_contact->getOpPtrVector().push_back(
343  new OpUnSetBc(positionField));
344  return fe_lhs_simple_contact;
345  };
346 
347  auto get_contact_lhs = [&](auto make_element, bool is_alm = false,
348  bool is_displacements = false) {
349  auto fe_lhs_simple_contact = make_element();
350  auto common_data_mortar_contact = make_contact_common_data();
351  fe_lhs_simple_contact->getOpPtrVector().push_back(
353  contactProblemPtr->setContactOperatorsLhs(
354  fe_lhs_simple_contact, common_data_mortar_contact, positionField,
355  "LAGMULT", is_alm, false, "", is_displacements);
356  fe_lhs_simple_contact->getOpPtrVector().push_back(
357  new OpUnSetBc(positionField));
358  return fe_lhs_simple_contact;
359  };
360 
361  auto get_contact_help_lhs = [&](auto make_element, bool is_alm = false,
362  bool is_displacements = false) {
363  auto fe_lhs_simple_contact = make_element();
364  auto common_data_mortar_contact = make_contact_common_data();
365  fe_lhs_simple_contact->getOpPtrVector().push_back(
367  contactProblemPtr->setContactOperatorsLhs(
368  fe_lhs_simple_contact, common_data_mortar_contact, positionField,
369  "LAGMULT", is_alm, false, "", is_displacements);
370  fe_lhs_simple_contact->getOpPtrVector().push_back(
371  new OpUnSetBc(positionField));
372  return fe_lhs_simple_contact;
373  };
374 
375  auto set_solver_pipelines = [&](PetscErrorCode (*function)(
376  DM, const std::string,
377  boost::shared_ptr<MoFEM::FEMethod>,
378  boost::shared_ptr<MoFEM::BasicMethod>,
379  boost::shared_ptr<MoFEM::BasicMethod>),
380  PetscErrorCode (*jacobian)(
381  DM, const std::string,
382  boost::shared_ptr<MoFEM::FEMethod>,
383  boost::shared_ptr<MoFEM::BasicMethod>,
384  boost::shared_ptr<MoFEM::BasicMethod>)) {
386 
387  if (convectPts) {
388  if (RHS) {
389 
390  CHKERR function(this->dM, "CONTACT_ELEM",
391  get_contact_rhs(make_convective_master_element, almFlag,
393  PETSC_NULL, PETSC_NULL);
394  CHKERR function(this->dM, "CONTACT_ELEM",
395  get_master_traction_rhs(make_convective_slave_element,
397  PETSC_NULL, PETSC_NULL);
398  } else {
399  if (jacobian) {
400 
401  CHKERR jacobian(this->dM, "CONTACT_ELEM",
402  get_contact_help_lhs(make_convective_master_element,
404  PETSC_NULL, PETSC_NULL);
405 
406  CHKERR jacobian(
407  this->dM, "CONTACT_ELEM",
408  get_master_help_traction_lhs(make_convective_slave_element),
409  PETSC_NULL, PETSC_NULL);
410  }
411  }
412  } else {
413  if (RHS) {
414 
415  CHKERR function(
416  this->dM, "CONTACT_ELEM",
417  get_contact_rhs(make_contact_element, almFlag, isDisplacementField),
418  PETSC_NULL, PETSC_NULL);
419  CHKERR function(this->dM, "CONTACT_ELEM",
420  get_master_traction_rhs(make_contact_element, almFlag,
422  PETSC_NULL, PETSC_NULL);
423  } else {
424  if (jacobian) {
425 
426  CHKERR jacobian(this->dM, "CONTACT_ELEM",
427  get_contact_lhs(make_contact_element, almFlag,
429  PETSC_NULL, PETSC_NULL);
430  CHKERR jacobian(this->dM, "CONTACT_ELEM",
431  get_master_traction_lhs(make_contact_element, almFlag,
433  PETSC_NULL, PETSC_NULL);
434  }
435  }
436  }
437 
439  };
440 
441  if constexpr (std::is_same_v<T, SNES>) {
442 
443  CHKERR set_solver_pipelines(&DMMoFEMSNESSetFunction,
445  } else if (std::is_same_v<T, TS>) {
446 
447  switch (type) {
448  case IM:
449  CHKERR set_solver_pipelines(&DMMoFEMTSSetIFunction,
451  break;
452  case IM2:
453  CHKERR set_solver_pipelines(&DMMoFEMTSSetI2Function,
455  break;
456  case EX:
457  CHKERR set_solver_pipelines(&DMMoFEMTSSetRHSFunction,
458  nullptr);
459  break;
460  default:
461  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
462  "This TS is not yet implemented for contact");
463  break;
464  }
465 
466  } else
467  static_assert(!std::is_same_v<T, KSP>,
468  "this solver has not been implemented for contact yet");
469 
470  if (!commonDataPostProc) {
471  commonDataPostProc = make_contact_common_data();
472  if (convectPts)
473  fePostProcSimpleContact = make_convective_master_element();
474  else
475  fePostProcSimpleContact = make_contact_element();
476 
478 
479  contactProblemPtr->setContactOperatorsForPostProc(
481  "LAGMULT", moabPostProcMesh, almFlag, false, "", false, postProcSurface,
483  }
484 
486 }
487 
488 template <>
490 MortarContactInterface::setupSolverFunction<TS>(const TSType type) {
492  CHKERR setupSolverImpl<TS, true>(type);
494 }
495 template <>
497 MortarContactInterface::setupSolverFunction<SNES>(const TSType type) {
499  CHKERR setupSolverImpl<SNES, true>(type);
501 }
502 template <>
504 MortarContactInterface::setupSolverJacobian<SNES>(const TSType type) {
506  CHKERR setupSolverImpl<SNES, false>(type);
508 }
509 template <>
511 MortarContactInterface::setupSolverJacobian<TS>(const TSType type) {
513  CHKERR setupSolverImpl<TS, false>(type);
515 }
516 
519  CHKERR this->setupSolverFunction<SNES>();
521 }
524  CHKERR this->setupSolverJacobian<SNES>();
526 }
530  CHKERR this->setupSolverFunction<TS>(type);
532 }
536  CHKERR this->setupSolverJacobian<TS>(type);
538 }
539 
542 
543  moabPostProcMesh.delete_mesh();
544  if (!commonDataPostProc)
545  SETERRQ(
546  PETSC_COMM_WORLD, MOFEM_DATA_INCONSISTENCY,
547  "you need to setup the solver first to use postProcessContactState");
548  CHKERR VecZeroEntries(commonDataPostProc->gaussPtsStateVec);
549  CHKERR VecZeroEntries(commonDataPostProc->contactAreaVec);
551 
552  auto get_contact_data = [&](auto vec, std::array<double, 2> &data) {
554  CHKERR VecAssemblyBegin(vec);
555  CHKERR VecAssemblyEnd(vec);
556  const double *array;
557  CHKERR VecGetArrayRead(vec, &array);
558  if (mField.get_comm_rank() == 0) {
559  for (int i : {0, 1})
560  data[i] = array[i];
561  }
562  CHKERR VecRestoreArrayRead(vec, &array);
564  };
565 
566  CHKERR get_contact_data(commonDataPostProc->gaussPtsStateVec, nbGaussPts);
567  CHKERR get_contact_data(commonDataPostProc->contactAreaVec, contactArea);
568 
569  if (mField.get_comm_rank() == 0) {
570  MOFEM_LOG_C("WORLD", Sev::verbose, "Active gauss pts: %d out of %d",
571  (int)nbGaussPts[0], (int)nbGaussPts[1]);
572 
573  if (!postProcSurface.empty())
574  MOFEM_LOG("WORLD", Sev::inform)
575  << "Computing contact area only on the post process surface";
576  if (postProcGapTol > std::numeric_limits<double>::epsilon())
577  MOFEM_LOG_C("WORLD", Sev::inform, "Using gap tolerance %3.3f",
579 
580  MOFEM_LOG_C("WORLD", Sev::inform, "Active contact area: %3.3f out of %3.3f",
581  contactArea[0], contactArea[1]);
582  }
583 
584  auto out_file_name = "out_contact_integ_pts_" + to_string(step) + ".h5m";
585  MOFEM_LOG_C("WORLD", Sev::verbose, "out file %s", out_file_name.c_str());
586  CHKERR moabPostProcMesh.write_file(out_file_name.c_str(), "MOAB",
587  "PARALLEL=WRITE_PART");
588 
590 }
591 
594 
595  if (masterTris.empty())
597 
598  this->postProcessContactState(step);
599 
600  if (!postProcContactPtr) {
601  postProcContactPtr = boost::make_shared<PostProcFaceOnRefinedMesh>(mField);
602  CHKERR postProcContactPtr->generateReferenceElementMesh();
604  CHKERR postProcContactPtr->addFieldValuesPostProc("LAGMULT");
605  CHKERR postProcContactPtr->addFieldValuesPostProc(positionField);
606  CHKERR postProcContactPtr->addFieldValuesPostProc(meshNodeField);
607  }
608  CHKERR DMoFEMLoopFiniteElements(this->dM, "CONTACT_POST_PROC",
610 
611  auto out_file_name = "out_contact_" + to_string(step) + ".h5m";
612  MOFEM_LOG_C("WORLD", Sev::verbose, "out file %s", out_file_name.c_str());
613  CHKERR postProcContactPtr->writeFile(out_file_name.c_str());
614 
616 }
617 
620  oRder = order;
622 }
623 
627 }
628 
631 
632  std::map<std::string, Range> slave_surface_map, master_surface_map;
633 
634  auto fill_surface_map = [&](auto &surface_map, std::string surface_name) {
636 
638  if (it->getName().compare(0, surface_name.size(), surface_name) == 0) {
639  Range tris;
640  CHKERR mField.get_moab().get_entities_by_type(it->meshset, MBTRI, tris,
641  true);
642  std::string key = it->getName().substr(surface_name.size());
643  auto res = surface_map.insert(std::pair<std::string, Range>(key, tris));
644  if (!res.second) {
645  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
646  "Contact surface name %s used more than once",
647  it->getName().c_str());
648  }
649  }
650  }
651 
653  };
654 
655  CHKERR fill_surface_map(slave_surface_map, "MORTAR_SLAVE");
656  CHKERR fill_surface_map(master_surface_map, "MORTAR_MASTER");
657 
658  for (const auto &[key, slave_range] : slave_surface_map) {
659  auto master_search = master_surface_map.find(key);
660  if (master_search != master_surface_map.end()) {
661  contactSurfacePairs.push_back(
662  std::pair<Range, Range>(slave_range, master_search->second));
663  master_surface_map.erase(master_search);
664  } else {
665  SETERRQ2(
666  PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
667  "Cannot find pairing contact surface MORTAR_MASTER%s for existing "
668  "surface MORTAR_SLAVE%s",
669  key.c_str(), key.c_str());
670  }
671  }
672 
673  if (!master_surface_map.empty()) {
674  std::string key = master_surface_map.begin()->first;
675  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
676  "Cannot find pairing contact surface MORTAR_SLAVE%s for existing "
677  "surface MORTAR_MASTER%s",
678  key.c_str(), key.c_str());
679  }
680 
682 }
683 
686 
687  std::string surface_name = "MORTAR_POST_PROC";
688 
690  if (it->getName().compare(0, surface_name.size(), surface_name) == 0) {
691  Range tris;
692  CHKERR mField.get_moab().get_entities_by_type(it->meshset, MBTRI, tris,
693  true);
694  postProcSurface.merge(tris);
695  }
696  }
697 
699 }
GenericElementInterface::EX
@ EX
Definition: GenericElementInterface.hpp:16
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
MoFEM::UnknownInterface::getInterface
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.
Definition: UnknownInterface.hpp:93
MoFEM::addHOOpsFace3D
MoFEMErrorCode addHOOpsFace3D(const std::string field, E &e, bool hcurl, bool hdiv)
Definition: HODataOperators.hpp:789
MortarContactInterface::isDisplacementField
bool isDisplacementField
Definition: MortarContactInterface.hpp:52
MortarContactProblem::MortarConvectSlaveContactElement
Element used to integrate on master surfaces. It convects integration points on slaves,...
Definition: MortarContactProblem.hpp:311
MortarContactInterface::orderContact
PetscInt orderContact
Definition: MortarContactInterface.hpp:30
H1
@ H1
continuous field
Definition: definitions.h:85
MortarContactInterface::nbHoLevels
PetscInt nbHoLevels
Definition: MortarContactInterface.hpp:32
sdf_hertz.d
float d
Definition: sdf_hertz.py:5
EntityHandle
MortarContactInterface::contactPrisms
Range contactPrisms
Definition: MortarContactInterface.hpp:42
MortarContactInterface::isPartitioned
PetscBool isPartitioned
Definition: MortarContactInterface.hpp:38
MortarContactInterface::dEbug
PetscBool dEbug
Definition: MortarContactInterface.hpp:37
MortarContactInterface::commonDataPostProc
boost::shared_ptr< MortarContactProblem::CommonDataMortarContact > commonDataPostProc
Definition: MortarContactInterface.hpp:64
Mortar.hpp
MortarContactInterface::almFlag
PetscBool almFlag
Definition: MortarContactInterface.hpp:36
MortarContactInterface::masterTris
Range masterTris
Definition: MortarContactInterface.hpp:43
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
MortarContactInterface::isNewtonCotes
PetscBool isNewtonCotes
Definition: MortarContactInterface.hpp:33
ContactSearchKdTree
Definition: ContactSearchKdTree.hpp:18
MoFEM::CoreInterface::get_comm_rank
virtual int get_comm_rank() const =0
out_file_name
char out_file_name[255]
Definition: initial_diffusion.cpp:53
MortarContactInterface::setPositionFieldOrder
MoFEMErrorCode setPositionFieldOrder(int order)
Definition: MortarContactInterface.cpp:618
MortarContactInterface::contactProblemPtr
boost::shared_ptr< MortarContactProblem > contactProblemPtr
Definition: MortarContactInterface.hpp:41
MortarContactInterface::contactArea
std::array< double, 2 > contactArea
Definition: MortarContactInterface.hpp:69
MoFEM::Simple
Simple interface for fast problem set-up.
Definition: Simple.hpp:27
MortarContactInterface::getBitRefLevel
BitRefLevel getBitRefLevel() override
Definition: MortarContactInterface.cpp:235
MoFEM::CoreInterface::add_ents_to_field_by_type
virtual MoFEMErrorCode add_ents_to_field_by_type(const Range &ents, const EntityType type, const std::string &name, int verb=DEFAULT_VERBOSITY)=0
Add entities to field meshset.
MoFEM::DMMoFEMAddElement
PetscErrorCode DMMoFEMAddElement(DM dm, std::string fe_name)
add element to dm
Definition: DMMoFEM.cpp:501
order
constexpr int order
Definition: dg_projection.cpp:18
MortarContactInterface::mField
MoFEM::Interface & mField
Definition: MortarContactInterface.hpp:24
MortarContactInterface::postProcSurface
Range postProcSurface
Definition: MortarContactInterface.hpp:46
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:535
MortarContactInterface::moabPostProcMesh
moab::Interface & moabPostProcMesh
Definition: MortarContactInterface.hpp:67
MoFEM::CoreInterface::get_moab
virtual moab::Interface & get_moab()=0
MoFEM::DMMoFEMTSSetIJacobian
PetscErrorCode DMMoFEMTSSetIJacobian(DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
set TS Jacobian evaluation function
Definition: DMMoFEM.cpp:857
MortarContactInterface::setupElementEntities
MoFEMErrorCode setupElementEntities()
Definition: MortarContactInterface.cpp:73
MortarContactInterface::contactCommondataMultiIndex
boost::shared_ptr< contactMIndex > contactCommondataMultiIndex
Definition: MortarContactInterface.hpp:58
MortarContactInterface::meshNodeField
string meshNodeField
Definition: MortarContactInterface.hpp:50
MoFEM::DMMoFEMTSSetI2Jacobian
PetscErrorCode DMMoFEMTSSetI2Jacobian(DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
set TS Jacobian evaluation function
Definition: DMMoFEM.cpp:1021
MortarContactInterface::setOperators
MoFEMErrorCode setOperators() override
Definition: MortarContactInterface.cpp:217
MOFEM_LOG_C
#define MOFEM_LOG_C(channel, severity, format,...)
Definition: LogManager.hpp:311
MoFEM::DMMoFEMTSSetI2Function
PetscErrorCode DMMoFEMTSSetI2Function(DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
set TS implicit function evaluation function
Definition: DMMoFEM.cpp:979
MortarContactInterface::setupSolverImpl
MoFEMErrorCode setupSolverImpl(const TSType type=IM)
Definition: MortarContactInterface.cpp:255
MortarContactInterface::postProcessElement
MoFEMErrorCode postProcessElement(int step) override
Definition: MortarContactInterface.cpp:592
simple
void simple(double P1[], double P2[], double P3[], double c[], const int N)
Definition: acoustic.cpp:69
MoFEM::CoreInterface::add_field
virtual MoFEMErrorCode add_field(const std::string &name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_of_coefficients, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
Add field.
convert.type
type
Definition: convert.py:64
MortarContactInterface::bitLevels
std::vector< BitRefLevel > bitLevels
Definition: MortarContactInterface.hpp:55
MortarContactInterface::getPostProcSimpleContactPipeline
boost::ptr_deque< MoFEM::ForcesAndSourcesCore::UserDataOperator > & getPostProcSimpleContactPipeline()
Definition: MortarContactInterface.cpp:18
MortarContactInterface::positionField
string positionField
Definition: MortarContactInterface.hpp:49
MoFEM::DMMoFEMSNESSetJacobian
PetscErrorCode DMMoFEMSNESSetJacobian(DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
set SNES Jacobian evaluation function
Definition: DMMoFEM.cpp:763
MortarContactInterface::slaveTris
Range slaveTris
Definition: MortarContactInterface.hpp:43
MortarContactInterface::setupSolverJacobianSNES
MoFEMErrorCode setupSolverJacobianSNES() override
Definition: MortarContactInterface.cpp:522
MortarContactInterface::nbGaussPts
std::array< double, 2 > nbGaussPts
Definition: MortarContactInterface.hpp:68
MoFEM::CoreInterface::check_field
virtual bool check_field(const std::string &name) const =0
check if field is in database
MortarContactInterface::postProcGapTol
double postProcGapTol
Definition: MortarContactInterface.hpp:47
MortarContactInterface::postProcessContactState
MoFEMErrorCode postProcessContactState(int step)
Definition: MortarContactInterface.cpp:540
GenericElementInterface::mBoundaryMarker
BcMarkerPtr mBoundaryMarker
Definition: GenericElementInterface.hpp:20
MortarContactInterface::oRder
PetscInt oRder
Definition: MortarContactInterface.hpp:29
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
ContactSearchKdTree::contactSearchAlgorithm
PetscErrorCode contactSearchAlgorithm(Range &range_surf_master, Range &range_surf_slave, boost::shared_ptr< ContactCommonData_multiIndex > contact_commondata_multi_index, Range &range_slave_master_prisms)
Definition: ContactSearchKdTree.hpp:114
MortarContactInterface::convectPts
PetscBool convectPts
Definition: MortarContactInterface.hpp:34
MoFEM::OpUnSetBc
Definition: FormsIntegrators.hpp:49
Range
MoFEM::DMMoFEMTSSetRHSFunction
PetscErrorCode DMMoFEMTSSetRHSFunction(DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
set TS the right hand side function
Definition: DMMoFEM.cpp:886
MortarContactInterface::postProcContactPtr
boost::shared_ptr< PostProcFaceOnRefinedMesh > postProcContactPtr
Definition: MortarContactInterface.hpp:59
MF_ZERO
@ MF_ZERO
Definition: definitions.h:98
MOFEM_LOG
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:308
_IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_
#define _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet having a particular BC meshset in a moFEM field.
Definition: MeshsetsManager.hpp:71
ContactSearchKdTree::buildTree
MoFEMErrorCode buildTree(Range &range_surf_master)
Definition: ContactSearchKdTree.hpp:28
MortarContactInterface::getCommandLineParameters
MoFEMErrorCode getCommandLineParameters() override
Definition: MortarContactInterface.cpp:22
BLOCKSET
@ BLOCKSET
Definition: definitions.h:148
MortarContactInterface::getBitRefLevelVector
std::vector< BitRefLevel > & getBitRefLevelVector()
Definition: MortarContactInterface.cpp:13
MoFEM::Exceptions::ierr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76
AINSWORTH_LEGENDRE_BASE
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:60
MoFEM::OpSetBc
Set indices on entities on finite element.
Definition: FormsIntegrators.hpp:38
MoFEM::DMMoFEMTSSetIFunction
PetscErrorCode DMMoFEMTSSetIFunction(DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
set TS implicit function evaluation function
Definition: DMMoFEM.cpp:804
MortarContactInterface::orderLambda
PetscInt orderLambda
Definition: MortarContactInterface.hpp:31
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
GenericElementInterface::TSType
TSType
Definition: GenericElementInterface.hpp:16
MortarContactInterface::addElementFields
MoFEMErrorCode addElementFields() override
Definition: MortarContactInterface.cpp:139
MortarContactInterface::cnValue
double cnValue
Definition: MortarContactInterface.hpp:28
MortarContactInterface::findContactSurfacePairs
MoFEMErrorCode findContactSurfacePairs()
Definition: MortarContactInterface.cpp:629
MortarContactInterface::setupSolverJacobianTS
MoFEMErrorCode setupSolverJacobianTS(const TSType type) override
Definition: MortarContactInterface.cpp:534
MortarContactInterface::addElementsToDM
MoFEMErrorCode addElementsToDM(SmartPetscObj< DM > dm) override
Definition: MortarContactInterface.cpp:239
MortarContactProblem::MortarConvectMasterContactElement
Element used to integrate on slave surfaces. It convects integration points on slaves,...
Definition: MortarContactProblem.hpp:282
MoFEM::BitRefManager
Managing BitRefLevels.
Definition: BitRefManager.hpp:21
MoFEM::Types::BitRefLevel
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:40
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440
MortarContactInterface::setupSolverFunctionTS
MoFEMErrorCode setupSolverFunctionTS(const TSType type) override
Definition: MortarContactInterface.cpp:528
MoFEM::CoreInterface::set_field_order
virtual MoFEMErrorCode set_field_order(const EntityHandle meshset, const EntityType type, const std::string &name, const ApproximationOrder order, int verb=DEFAULT_VERBOSITY)=0
Set order approximation of the entities in the field.
MoFEM::SmartPetscObj< DM >
MortarContactInterface::fePostProcSimpleContact
boost::shared_ptr< MortarContactProblem::MortarContactElement > fePostProcSimpleContact
Definition: MortarContactInterface.hpp:62
MoFEM::DMoFEMLoopFiniteElements
PetscErrorCode DMoFEMLoopFiniteElements(DM dm, const char fe_name[], MoFEM::FEMethod *method, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
Executes FEMethod for finite elements in DM.
Definition: DMMoFEM.cpp:590
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
MortarContactInterface::dM
SmartPetscObj< DM > dM
Definition: MortarContactInterface.hpp:25
MOFEM_NOT_IMPLEMENTED
@ MOFEM_NOT_IMPLEMENTED
Definition: definitions.h:32
MortarContactInterface::setupSolverFunctionSNES
MoFEMErrorCode setupSolverFunctionSNES() override
Definition: MortarContactInterface.cpp:517
GenericElementInterface::IM2
@ IM2
Definition: GenericElementInterface.hpp:16
MortarContactInterface::createElements
MoFEMErrorCode createElements() override
Definition: MortarContactInterface.cpp:219
MortarContactInterface::printContactState
PetscBool printContactState
Definition: MortarContactInterface.hpp:35
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
MortarContactInterface::findPostProcSurface
MoFEMErrorCode findPostProcSurface()
Definition: MortarContactInterface.cpp:684
MoFEM::DMMoFEMSNESSetFunction
PetscErrorCode DMMoFEMSNESSetFunction(DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
set SNES residual evaluation function
Definition: DMMoFEM.cpp:722
GenericElementInterface::IM
@ IM
Definition: GenericElementInterface.hpp:16
quad.h
MortarContactInterface::updateElementVariables
MoFEMErrorCode updateElementVariables() override
Definition: MortarContactInterface.cpp:624
MortarContactInterface::contactSurfacePairs
std::vector< std::pair< Range, Range > > contactSurfacePairs
Definition: MortarContactInterface.hpp:44