v0.14.0
Simple.cpp
Go to the documentation of this file.
1 /** \file Simple.cpp
2  * \brief Implementation of simple interface
3  * \ingroup mofem_simple_interface
4  */
5 
6 namespace MoFEM {
7 
8 MoFEMErrorCode Simple::query_interface(boost::typeindex::type_index type_index,
9  UnknownInterface **iface) const {
10  *iface = const_cast<Simple *>(this);
11  return 0;
12 }
13 
14 template <int DIM>
16  static_assert(DIM == 2 || DIM == 3, "not implemented");
17  return MOFEM_NOT_IMPLEMENTED;
18 }
19 
20 template <>
21 MoFEMErrorCode Simple::setSkeletonAdjacency<2>(std::string fe_name) {
22  Interface &m_field = cOre;
24 
26  boost::make_shared<ParentFiniteElementAdjacencyFunctionSkeleton<1>>(
29  fe_name, MBEDGE, *parentAdjSkeletonFunctionDim1);
30 
32 }
33 
34 template <>
35 MoFEMErrorCode Simple::setSkeletonAdjacency<3>(std::string fe_name) {
36  Interface &m_field = cOre;
38 
40  boost::make_shared<ParentFiniteElementAdjacencyFunctionSkeleton<2>>(
42 
44  fe_name, MBTRI, *parentAdjSkeletonFunctionDim2);
46  fe_name, MBQUAD, *parentAdjSkeletonFunctionDim2);
47 
49 }
50 
51 template <>
52 MoFEMErrorCode Simple::setSkeletonAdjacency<-1>(std::string fe_name) {
54 
55  switch (getDim()) {
56  case 1:
57  THROW_MESSAGE("Not implemented");
58  case 2:
59  return setSkeletonAdjacency<2>(fe_name);
60  case 3:
61  return setSkeletonAdjacency<3>(fe_name);
62  default:
63  THROW_MESSAGE("Not implemented");
64  }
66 }
68  static_assert(DIM == 2 || DIM == 3, "not implemented");
69  return MOFEM_NOT_IMPLEMENTED;
70 }
71 
72 template <> MoFEMErrorCode Simple::setParentAdjacency<3>() {
73  Interface &m_field = cOre;
75 
77  boost::make_shared<ParentFiniteElementAdjacencyFunction<3>>(
80  boost::make_shared<ParentFiniteElementAdjacencyFunction<2>>(
82 
87  if (addBoundaryFE || !boundaryFields.empty()) {
92  }
93  if (addSkeletonFE || !skeletonFields.empty()) {
98  }
99 
101 }
102 
103 template <> MoFEMErrorCode Simple::setParentAdjacency<2>() {
104  Interface &m_field = cOre;
106 
108  boost::make_shared<ParentFiniteElementAdjacencyFunction<2>>(
111  boost::make_shared<ParentFiniteElementAdjacencyFunction<1>>(
113 
118  if (addBoundaryFE || !boundaryFields.empty())
121  if (addSkeletonFE || !skeletonFields.empty())
124 
126 }
127 
130  switch (getDim()) {
131  case 1:
132  THROW_MESSAGE("Not implemented");
133  case 2:
134  return setParentAdjacency<2>();
135  case 3:
136  return setParentAdjacency<3>();
137  default:
138  THROW_MESSAGE("Not implemented");
139  }
141 }
142 
143 MoFEMErrorCode Simple::setSkeletonAdjacency(int dim, std::string fe_name) {
145  if (dim == -1)
146  dim = getDim();
147 
148  if (fe_name.empty())
149  fe_name = skeletonFE;
150 
151  switch (dim) {
152  case 2:
153  return setSkeletonAdjacency<2>(fe_name);
154  case 3:
155  return setSkeletonAdjacency<3>(fe_name);
156  default:
157  SETERRQ(PETSC_COMM_WORLD, MOFEM_NOT_IMPLEMENTED, "Not implemented");
158  }
160 }
161 
162 Simple::Simple(const Core &core)
163  : cOre(const_cast<Core &>(core)), bitLevel(BitRefLevel().set(0)),
164  bitLevelMask(BitRefLevel().set()), meshSet(0), boundaryMeshset(0),
165  skeletonMeshset(0), nameOfProblem("SimpleProblem"), domainFE("dFE"),
166  boundaryFE("bFE"), skeletonFE("sFE"), dIm(-1), addSkeletonFE(false),
167  addBoundaryFE(false), addParentAdjacencies(false),
168  bitAdjParent(BitRefLevel().set()), bitAdjParentMask(BitRefLevel().set()),
169  bitAdjEnt(BitRefLevel().set()), bitAdjEntMask(BitRefLevel().set()) {
170  PetscLogEventRegister("SimpSetUp", 0, &MOFEM_EVENT_SimpleSetUP);
171  PetscLogEventRegister("SimpLoadMesh", 0, &MOFEM_EVENT_SimpleLoadMesh);
172  PetscLogEventRegister("SimpBuildFields", 0, &MOFEM_EVENT_SimpleBuildFields);
173  PetscLogEventRegister("SimpBuildFEs", 0,
175  PetscLogEventRegister("SimpSetUp", 0, &MOFEM_EVENT_SimpleBuildProblem);
176  PetscLogEventRegister("SimpKSPSolve", 0, &MOFEM_EVENT_SimpleKSPSolve);
177  strcpy(meshFileName, "mesh.h5m");
178 }
179 
181  PetscBool flg = PETSC_TRUE;
183  ierr = PetscOptionsBegin(PETSC_COMM_WORLD, "", "Simple interface options",
184  "none");
185  CHKERRG(ierr);
186  ierr = PetscOptionsString("-file_name", "file name", "", "mesh.h5m",
187  meshFileName, 255, &flg);
188  CHKERRG(ierr);
189  ierr = PetscOptionsEnd();
190  CHKERRG(ierr);
192 }
193 
194 MoFEMErrorCode Simple::loadFile(const std::string options,
195  const std::string mesh_file_name,
196  LoadFileFunc loadFunc) {
197  Interface &m_field = cOre;
199  PetscLogEventBegin(MOFEM_EVENT_SimpleLoadMesh, 0, 0, 0, 0);
200 
201  if (!mesh_file_name.empty())
202  strcpy(meshFileName, mesh_file_name.c_str());
203 
204  // Invoke the boost function, passing in required arguments
205  CHKERR loadFunc(m_field, meshFileName, options.c_str());
206  CHKERR m_field.rebuild_database();
207 
208  // determine problem dimension
209  if (dIm == -1) {
210  int nb_ents_3d;
211  CHKERR m_field.get_moab().get_number_entities_by_dimension(
212  meshSet, 3, nb_ents_3d, true);
213  if (nb_ents_3d > 0) {
214  dIm = 3;
215  } else {
216  int nb_ents_2d;
217  CHKERR m_field.get_moab().get_number_entities_by_dimension(
218  meshSet, 2, nb_ents_2d, true);
219  if (nb_ents_2d > 0) {
220  dIm = 2;
221  } else {
222  dIm = 1;
223  }
224  }
225  }
226 
227  if (!boundaryMeshset)
229  if (!skeletonMeshset)
231  if (addSkeletonFE)
233 
234  if (bitLevel.any()) {
235  Range ents;
236  CHKERR m_field.get_moab().get_entities_by_dimension(meshSet, dIm, ents,
237  true);
238  CHKERR m_field.getInterface<BitRefManager>()->setBitRefLevel(ents, bitLevel,
239  false);
240  } else {
241  MOFEM_LOG("WORLD", Sev::warning) << "BitRefLevel is none and not set";
242  CHKERR m_field.getInterface<BitRefManager>()->addToDatabaseBitRefLevelByDim(
243  dIm, BitRefLevel().set(), BitRefLevel().set());
244  }
245 
246  PetscLogEventEnd(MOFEM_EVENT_SimpleLoadMesh, 0, 0, 0, 0);
248 }
249 
252  Interface &m_field = cOre;
253  if (m_field.get_comm_size() == 1)
255  else
256  CHKERR loadFile("PARALLEL=READ_PART;"
257  "PARALLEL_RESOLVE_SHARED_ENTS;"
258  "PARTITION=PARALLEL_PARTITION;",
259  meshFileName);
261 }
262 
264 Simple::addDomainField(const std::string &name, const FieldSpace space,
265  const FieldApproximationBase base,
266  const FieldCoefficientsNumber nb_of_coefficients,
267  const TagType tag_type, const enum MoFEMTypes bh,
268  int verb) {
269 
270  Interface &m_field = cOre;
272  CHKERR m_field.add_field(name, space, base, nb_of_coefficients, tag_type, bh,
273  verb);
274  if (space == NOFIELD)
275  noFieldFields.push_back(name);
276  else
277  domainFields.push_back(name);
279 }
280 
282 Simple::addDomainBrokenField(const std::string &name, const FieldSpace space,
283  const FieldApproximationBase base,
284  const FieldCoefficientsNumber nb_of_coefficients,
285  const TagType tag_type, const enum MoFEMTypes bh,
286  int verb) {
287 
288  Interface &m_field = cOre;
290 
291  auto get_side_map_hcurl = [&]() {
292  return std::vector<
293 
294  std::pair<EntityType,
295  std::function<MoFEMErrorCode(BaseFunction::DofsSideMap &)>
296 
297  >>{
298 
299  {MBTRI,
300  [&](BaseFunction::DofsSideMap &dofs_side_map) -> MoFEMErrorCode {
302  dofs_side_map);
303  }}
304 
305  };
306  };
307 
308  auto get_side_map_hdiv = [&]() {
309  return std::vector<
310 
311  std::pair<EntityType,
312  std::function<MoFEMErrorCode(BaseFunction::DofsSideMap &)>
313 
314  >>{
315 
316  {MBTET,
317  [&](BaseFunction::DofsSideMap &dofs_side_map) -> MoFEMErrorCode {
319  dofs_side_map);
320  }}
321 
322  };
323  };
324 
325  auto get_side_map = [&](auto space) {
326  switch (space) {
327  case HCURL:
328  return get_side_map_hcurl();
329  case HDIV:
330  return get_side_map_hdiv();
331  default:
332  MOFEM_LOG_CHANNEL("WORLD");
333  MOFEM_LOG("WORLD", Sev::warning)
334  << "Side dof map for broken space <" << space << "> not implemented";
335  }
336  return std::vector<
337 
338  std::pair<EntityType,
339  std::function<MoFEMErrorCode(BaseFunction::DofsSideMap &)>
340 
341  >>{};
342  };
343 
344  CHKERR m_field.add_broken_field(name, space, base, nb_of_coefficients,
345  get_side_map(space), tag_type, bh, verb);
346  if (space == NOFIELD)
347  noFieldFields.push_back(name);
348  else
349  domainFields.push_back(name);
351 }
352 
354 Simple::addBoundaryField(const std::string &name, const FieldSpace space,
355  const FieldApproximationBase base,
356  const FieldCoefficientsNumber nb_of_coefficients,
357  const TagType tag_type, const enum MoFEMTypes bh,
358  int verb) {
359  Interface &m_field = cOre;
361  CHKERR m_field.add_field(name, space, base, nb_of_coefficients, tag_type, bh,
362  verb);
363  boundaryFields.push_back(name);
364  if (space == NOFIELD)
365  SETERRQ(
366  PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
367  "NOFIELD space for boundary filed not implemented in Simple interface");
369 }
370 
372 Simple::addSkeletonField(const std::string &name, const FieldSpace space,
373  const FieldApproximationBase base,
374  const FieldCoefficientsNumber nb_of_coefficients,
375  const TagType tag_type, const enum MoFEMTypes bh,
376  int verb) {
377 
378  Interface &m_field = cOre;
380  CHKERR m_field.add_field(name, space, base, nb_of_coefficients, tag_type, bh,
381  verb);
382  skeletonFields.push_back(name);
383  if (space == NOFIELD)
384  SETERRQ(
385  PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
386  "NOFIELD space for boundary filed not implemented in Simple interface");
387 
389 }
390 
392 Simple::addDataField(const std::string &name, const FieldSpace space,
393  const FieldApproximationBase base,
394  const FieldCoefficientsNumber nb_of_coefficients,
395  const TagType tag_type, const enum MoFEMTypes bh,
396  int verb) {
397 
398  Interface &m_field = cOre;
400  CHKERR m_field.add_field(name, space, base, nb_of_coefficients, tag_type, bh,
401  verb);
402  if (space == NOFIELD)
403  noFieldDataFields.push_back(name);
404  else
405  dataFields.push_back(name);
407 }
408 
409 MoFEMErrorCode Simple::removeDomainField(const std::string &name) {
411 
412  auto remove_field_from_list = [&](auto &vec) {
413  auto it = std::find(vec.begin(), vec.end(), name);
414  if (it != vec.end())
415  vec.erase(it);
416  };
417 
418  remove_field_from_list(noFieldFields);
419  remove_field_from_list(domainFields);
420 
422 }
423 
424 MoFEMErrorCode Simple::removeBoundaryField(const std::string &name) {
426 
427  auto remove_field_from_list = [&](auto &vec) {
428  auto it = std::find(vec.begin(), vec.end(), name);
429  if (it != vec.end())
430  vec.erase(it);
431  };
432 
433  remove_field_from_list(boundaryFields);
434 
436 }
437 
438 MoFEMErrorCode Simple::removeSkeletonField(const std::string &name) {
440 
441  auto remove_field_from_list = [&](auto &vec) {
442  auto it = std::find(vec.begin(), vec.end(), name);
443  if (it != vec.end())
444  vec.erase(it);
445  };
446 
447  remove_field_from_list(skeletonFields);
448 
450 }
451 
453  Interface &m_field = cOre;
455 
456  auto clear_rows_and_cols = [&](auto &fe_name) {
458  auto fe_ptr = m_field.get_finite_elements();
459  auto &fe_by_name = const_cast<FiniteElement_multiIndex *>(fe_ptr)
460  ->get<FiniteElement_name_mi_tag>();
461  auto it_fe = fe_by_name.find(fe_name);
462  if (it_fe != fe_by_name.end()) {
463 
464  if (!fe_by_name.modify(it_fe, FiniteElement_row_change_bit_reset()))
465  SETERRQ(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
466  "modification unsuccessful");
467 
468  if (!fe_by_name.modify(it_fe, FiniteElement_col_change_bit_reset()))
469  SETERRQ(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
470  "modification unsuccessful");
471  }
473  };
474  CHKERR clear_rows_and_cols(domainFE);
475  CHKERR clear_rows_and_cols(boundaryFE);
476  CHKERR clear_rows_and_cols(skeletonFE);
477 
478  // Define finite elements
480 
481  auto add_fields = [&](auto &fe_name, auto &fields) {
483  for (auto &field : fields) {
484  CHKERR m_field.modify_finite_element_add_field_row(fe_name, field);
485  CHKERR m_field.modify_finite_element_add_field_col(fe_name, field);
486  CHKERR m_field.modify_finite_element_add_field_data(fe_name, field);
487  }
489  };
490 
491  auto add_data_fields = [&](auto &fe_name, auto &fields) {
493  for (auto &field : fields)
494  CHKERR m_field.modify_finite_element_add_field_data(fe_name, field);
496  };
497 
498  CHKERR add_fields(domainFE, domainFields);
499  CHKERR add_data_fields(domainFE, dataFields);
500  CHKERR add_fields(domainFE, noFieldFields);
501  CHKERR add_data_fields(domainFE, noFieldDataFields);
502 
503  if (addBoundaryFE || !boundaryFields.empty()) {
505  CHKERR add_fields(boundaryFE, domainFields);
506  if (!boundaryFields.empty())
507  CHKERR add_fields(boundaryFE, boundaryFields);
508  CHKERR add_data_fields(boundaryFE, dataFields);
509  CHKERR add_data_fields(boundaryFE, noFieldDataFields);
510  CHKERR add_fields(boundaryFE, noFieldFields);
511  }
512  if (addSkeletonFE || !skeletonFields.empty()) {
514  CHKERR add_fields(skeletonFE, domainFields);
515  if (!skeletonFields.empty())
516  CHKERR add_fields(skeletonFE, skeletonFields);
517  CHKERR add_data_fields(skeletonFE, dataFields);
518  CHKERR add_data_fields(skeletonFE, noFieldDataFields);
519  CHKERR add_fields(skeletonFE, noFieldFields);
520  }
522 }
523 
524 MoFEMErrorCode Simple::defineProblem(const PetscBool is_partitioned) {
525  Interface &m_field = cOre;
527  // Create dm instance
528  dM = createDM(m_field.get_comm(), "DMMOFEM");
529  // set dm data structure which created mofem data structures
530  CHKERR DMMoFEMCreateMoFEM(dM, &m_field, nameOfProblem.c_str(), bitLevel,
531  bitLevelMask);
532  CHKERR DMSetFromOptions(dM);
534  if (addBoundaryFE || !boundaryFields.empty()) {
536  }
537  if (addSkeletonFE || !skeletonFields.empty()) {
539  }
541  CHKERR DMMoFEMSetIsPartitioned(dM, is_partitioned);
543 }
544 
546  const int order, const Range *ents) {
548  fieldsOrder.emplace_back(field_name, order,
549  ents == NULL ? Range() : Range(*ents),
550  ents == NULL ? false : true);
552 }
553 
555  Interface &m_field = cOre;
557  PetscLogEventBegin(MOFEM_EVENT_SimpleBuildFields, 0, 0, 0, 0);
558 
559  auto comm_interface_ptr = m_field.getInterface<CommInterface>();
560  auto bit_ref_ptr = m_field.getInterface<BitRefManager>();
561 
562  // Add entities to the fields
563  auto add_ents_to_field = [&](auto meshset, auto dim, auto &fields) {
565  for (auto &field : fields) {
566  CHKERR m_field.add_ents_to_field_by_dim(meshset, dim, field);
567  CHKERR comm_interface_ptr->synchroniseFieldEntities(field, 0);
568  }
570  };
571 
572  auto make_no_field_ents = [&](auto &fields) {
574  for (auto &field : fields) {
575  std::array<double, 6> coords = {0, 0, 0, 0, 0, 0};
576  CHKERR m_field.create_vertices_and_add_to_field(field, coords.data(), 1);
577  CHKERR comm_interface_ptr->makeFieldEntitiesMultishared(field, 0);
578  CHKERR bit_ref_ptr->setFieldEntitiesBitRefLevel(field, bitLevel);
579  }
581  };
582 
583  CHKERR add_ents_to_field(meshSet, dIm, domainFields);
584  CHKERR add_ents_to_field(meshSet, dIm, dataFields);
585  CHKERR add_ents_to_field(boundaryMeshset, dIm - 1, boundaryFields);
586  CHKERR add_ents_to_field(skeletonMeshset, dIm - 1, skeletonFields);
587 
588  std::set<std::string> nofield_fields;
589  for (auto &f : noFieldFields)
590  nofield_fields.insert(f);
591  for (auto &f : noFieldDataFields)
592  nofield_fields.insert(f);
593 
594  CHKERR make_no_field_ents(nofield_fields);
595 
596  // Set order
597 
598  auto get_field_ptr = [&](auto &f) { return m_field.get_field_structure(f); };
599  for (auto &t : fieldsOrder) {
600  const auto f = std::get<0>(t);
601  const auto order = std::get<1>(t);
602 
603  MOFEM_TAG_AND_LOG("WORLD", Sev::inform, "Simple")
604  << "Set order to field " << f << " order " << order;
605  MOFEM_LOG_CHANNEL("SYNC");
606  if (std::get<3>(t)) {
607  MOFEM_TAG_AND_LOG("SYNC", Sev::verbose, "Simple")
608  << "To ents: " << std::endl
609  << std::get<2>(t) << std::endl;
610  }
611  MOFEM_LOG_SEVERITY_SYNC(m_field.get_comm(), Sev::verbose);
612 
613  if (std::get<3>(t)) {
614 
615  CHKERR m_field.set_field_order(std::get<2>(t), f, order);
616 
617  } else {
618  auto f_ptr = get_field_ptr(f);
619 
620  if (f_ptr->getSpace() == H1) {
621  if (f_ptr->getApproxBase() == AINSWORTH_BERNSTEIN_BEZIER_BASE) {
622  CHKERR m_field.set_field_order(meshSet, MBVERTEX, f, order);
623  } else {
624  CHKERR m_field.set_field_order(meshSet, MBVERTEX, f, 1);
625  }
626  }
627 
628  for (auto d = 1; d <= dIm; ++d) {
629  for (EntityType t = CN::TypeDimensionMap[d].first;
630  t <= CN::TypeDimensionMap[d].second; ++t) {
631  CHKERR m_field.set_field_order(meshSet, t, f, order);
632  }
633  }
634  }
635  }
636  MOFEM_LOG_CHANNEL("WORLD");
637  // Build fields
638  CHKERR m_field.build_fields();
639  PetscLogEventEnd(MOFEM_EVENT_SimpleBuildFields, 0, 0, 0, 0);
641 }
642 
644  Interface &m_field = cOre;
646  PetscLogEventBegin(MOFEM_EVENT_SimpleBuildFiniteElements, 0, 0, 0, 0);
647  // Add finite elements
649  true);
651  if (addBoundaryFE || boundaryFields.size()) {
653  boundaryFE, true);
655  }
656  if (addSkeletonFE || skeletonFields.size()) {
658  skeletonFE, true);
660  }
661  for (std::vector<std::string>::iterator fit = otherFEs.begin();
662  fit != otherFEs.end(); ++fit) {
663  CHKERR m_field.build_finite_elements(*fit);
664  }
665  PetscLogEventEnd(MOFEM_EVENT_SimpleBuildFiniteElements, 0, 0, 0, 0);
667 }
668 
670  Interface &m_field = cOre;
672  PetscLogEventBegin(MOFEM_EVENT_SimpleBuildProblem, 0, 0, 0, 0);
674  // Set problem by the DOFs on the fields rather that by adding DOFs on the
675  // elements
676  m_field.getInterface<ProblemsManager>()->buildProblemFromFields = PETSC_TRUE;
678  m_field.getInterface<ProblemsManager>()->buildProblemFromFields = PETSC_FALSE;
679  PetscLogEventEnd(MOFEM_EVENT_SimpleBuildProblem, 0, 0, 0, 0);
681 }
682 
683 MoFEMErrorCode Simple::setUp(const PetscBool is_partitioned) {
685 
686  PetscLogEventBegin(MOFEM_EVENT_SimpleSetUP, 0, 0, 0, 0);
687 
689 
690  if (addSkeletonFE || !skeletonFields.empty()) {
692  if (addBoundaryFE || !boundaryFields.empty()) {
694  }
695  }
696 
699 
700  CHKERR defineProblem(is_partitioned);
704 
705  PetscLogEventEnd(MOFEM_EVENT_SimpleSetUP, 0, 0, 0, 0);
707 }
708 
710  Interface &m_field = cOre;
712  PetscLogEventBegin(MOFEM_EVENT_SimpleBuildProblem, 0, 0, 0, 0);
713 
714  if (!only_dm) {
717  if (addSkeletonFE || !skeletonFields.empty()) {
719  if (addBoundaryFE || !boundaryFields.empty()) {
721  }
722  }
726  }
727 
729 
730  const Problem *problem_ptr;
731  CHKERR DMMoFEMGetProblemPtr(dM, &problem_ptr);
732  const auto problem_name = problem_ptr->getName();
733  CHKERR m_field.modify_problem_ref_level_set_bit(problem_name, bitLevel);
734  CHKERR m_field.modify_problem_mask_ref_level_set_bit(problem_name,
735  bitLevelMask);
736 
737  // Set problem by the DOFs on the fields rather that by adding DOFs on the
738  // elements
739  m_field.getInterface<ProblemsManager>()->buildProblemFromFields = PETSC_TRUE;
741  m_field.getInterface<ProblemsManager>()->buildProblemFromFields = PETSC_FALSE;
742 
743  PetscLogEventEnd(MOFEM_EVENT_SimpleBuildProblem, 0, 0, 0, 0);
745 }
746 
749  CHKERR PetscObjectReference(getPetscObject(dM.get()));
750  *dm = dM.get();
752 }
753 
754 /**
755  * @brief Delete dm
756  *
757  * @return MoFEMErrorCode
758  */
761  dM.reset();
763 }
764 
765 /**
766  * @brief Delete finite elements
767  *
768  * @return MoFEMErrorCode
769  */
771  Interface &m_field = cOre;
773  for (auto fe : {domainFE, boundaryFE, skeletonFE}) {
774  if (m_field.check_finite_element(fe)) {
775  CHKERR m_field.delete_finite_element(fe);
776  }
777  }
779 }
780 
782 Simple::addFieldToEmptyFieldBlocks(const std::string row_field,
783  const std::string col_field) const {
784  Interface &m_field = cOre;
787  getProblemName(), row_field, col_field);
789 }
790 
792  Interface &m_field = cOre;
794  ParallelComm *pcomm =
795  ParallelComm::get_pcomm(&m_field.get_moab(), MYPCOMM_INDEX);
796 
797  auto get_skin = [&](auto meshset) {
798  // filter not owned entities, those are not on boundary
799 
800  Range domain_ents;
801  CHKERR m_field.get_moab().get_entities_by_dimension(meshset, dIm,
802  domain_ents, true);
803  CHKERR pcomm->filter_pstatus(domain_ents,
804  PSTATUS_SHARED | PSTATUS_MULTISHARED,
805  PSTATUS_NOT, -1, nullptr);
806 
807  Skinner skin(&m_field.get_moab());
808  Range domain_skin;
809  CHKERR skin.find_skin(0, domain_ents, false, domain_skin);
810  CHKERR pcomm->filter_pstatus(domain_skin,
811  PSTATUS_SHARED | PSTATUS_MULTISHARED,
812  PSTATUS_NOT, -1, nullptr);
813  return domain_skin;
814  };
815 
816  auto create_boundary_meshset = [&](auto &&domain_skin) {
818  // create boundary meshset
819  if (boundaryMeshset != 0) {
821  }
822  CHKERR m_field.get_moab().create_meshset(MESHSET_SET, boundaryMeshset);
823  CHKERR m_field.get_moab().add_entities(boundaryMeshset, domain_skin);
824  for (int dd = 0; dd != dIm - 1; dd++) {
825  Range adj;
826  CHKERR m_field.get_moab().get_adjacencies(domain_skin, dd, false, adj,
827  moab::Interface::UNION);
828  CHKERR m_field.get_moab().add_entities(boundaryMeshset, adj);
829  }
831  };
832 
833  CHKERR create_boundary_meshset(get_skin(meshSet));
834 
836 }
837 
839  Interface &m_field = cOre;
841 
842  ParallelComm *pcomm =
843  ParallelComm::get_pcomm(&m_field.get_moab(), MYPCOMM_INDEX);
844 
845  auto create_skeleton_meshset = [&](auto meshset) {
847  // create boundary meshset
848  if (skeletonMeshset != 0) {
850  }
851  Range boundary_ents, skeleton_ents;
852  CHKERR m_field.get_moab().get_entities_by_dimension(boundaryMeshset,
853  dIm - 1, boundary_ents);
854  Range domain_ents;
855  CHKERR m_field.get_moab().get_entities_by_dimension(meshset, dIm,
856  domain_ents, true);
857  CHKERR m_field.get_moab().get_adjacencies(
858  domain_ents, dIm - 1, false, skeleton_ents, moab::Interface::UNION);
859  skeleton_ents = subtract(skeleton_ents, boundary_ents);
860  CHKERR pcomm->filter_pstatus(skeleton_ents, PSTATUS_NOT_OWNED, PSTATUS_NOT,
861  -1, nullptr);
862  CHKERR m_field.get_moab().create_meshset(MESHSET_SET, skeletonMeshset);
863  CHKERR m_field.get_moab().add_entities(skeletonMeshset, skeleton_ents);
865  };
866 
867  CHKERR create_skeleton_meshset(meshSet);
868 
870 }
871 
873  Interface &m_field = cOre;
875  MOFEM_LOG("WORLD", Sev::verbose) << "Exchange ghost cells";
876 
877  ParallelComm *pcomm =
878  ParallelComm::get_pcomm(&m_field.get_moab(), MYPCOMM_INDEX);
879  if (pcomm == NULL)
880  pcomm = new ParallelComm(&m_field.get_moab(), m_field.get_comm());
881 
882  CHKERR pcomm->exchange_ghost_cells(getDim(), getDim() - 1, 1,
883  3 /**get all adjacent ghosted entities */,
884  true, true, meshSet ? &meshSet : nullptr);
885 
886  Range shared;
887  CHKERR m_field.get_moab().get_entities_by_dimension(0, dIm, shared);
888  for (auto d = dIm - 1; d >= 0; --d) {
889  CHKERR m_field.get_moab().get_adjacencies(shared, d, false, shared,
890  moab::Interface::UNION);
891  }
892  CHKERR pcomm->filter_pstatus(shared, PSTATUS_SHARED | PSTATUS_MULTISHARED,
893  PSTATUS_OR, -1, &shared);
894  Tag part_tag = pcomm->part_tag();
895  CHKERR pcomm->exchange_tags(part_tag, shared);
896  CHKERR m_field.getInterface<CommInterface>()->resolveParentEntities(shared,
897  VERBOSE);
898 
900 }
901 
902 } // namespace MoFEM
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
MoFEM::UnknownInterface::getInterface
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
Definition: UnknownInterface.hpp:93
MoFEM::CoreInterface::modify_finite_element_adjacency_table
virtual MoFEMErrorCode modify_finite_element_adjacency_table(const std::string &fe_name, const EntityType type, ElementAdjacencyFunct function)=0
modify finite element table, only for advanced user
MoFEM::Simple::boundaryFields
std::vector< std::string > boundaryFields
boundary fields
Definition: Simple.hpp:544
MoFEM::Simple::parentAdjFunctionDim1
boost::shared_ptr< ParentFiniteElementAdjacencyFunction< 1 > > parentAdjFunctionDim1
Definition: Simple.hpp:581
MoFEM::Simple::setSkeletonAdjacency
MoFEMErrorCode setSkeletonAdjacency(int dim=-1, std::string fe_name="")
Set the skeleton adjacency object.
Definition: Simple.cpp:143
MYPCOMM_INDEX
#define MYPCOMM_INDEX
default communicator number PCOMM
Definition: definitions.h:228
MoFEM::Simple::otherFEs
std::vector< std::string > otherFEs
Other finite elements.
Definition: Simple.hpp:559
MoFEM::CoreTmp< 0 >
Core (interface) class.
Definition: Core.hpp:82
MoFEM::Simple::addParentAdjacencies
bool addParentAdjacencies
If set to true parent adjacencies are build.
Definition: Simple.hpp:536
H1
@ H1
continuous field
Definition: definitions.h:85
MoFEM::Simple::addBoundaryFE
bool addBoundaryFE
Add boundary FE.
Definition: Simple.hpp:535
MOFEM_LOG_SEVERITY_SYNC
#define MOFEM_LOG_SEVERITY_SYNC(comm, severity)
Synchronise "SYNC" on curtain severity level.
Definition: LogManager.hpp:352
MoFEM::Simple::exchangeGhostCells
MoFEMErrorCode exchangeGhostCells()
Definition: Simple.cpp:872
MoFEM::Simple::fieldsOrder
std::list< std::tuple< std::string, int, Range, bool > > fieldsOrder
Definition: Simple.hpp:551
MoFEM::CoreInterface::modify_problem_ref_level_set_bit
virtual MoFEMErrorCode modify_problem_ref_level_set_bit(const std::string &name_problem, const BitRefLevel &bit)=0
set ref level for problem
MOFEM_LOG_CHANNEL
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
Definition: LogManager.hpp:284
MoFEM::ProblemsManager
Problem manager is used to build and partition problems.
Definition: ProblemsManager.hpp:21
MoFEM::Simple::Simple
Simple(const MoFEM::Core &core)
Definition: Simple.cpp:162
MoFEM::Simple::parentAdjFunctionDim2
boost::shared_ptr< ParentFiniteElementAdjacencyFunction< 2 > > parentAdjFunctionDim2
Definition: Simple.hpp:579
MoFEM::Simple::query_interface
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Definition: Simple.cpp:8
MoFEM::Simple::noFieldFields
std::vector< std::string > noFieldFields
NOFIELD field name.
Definition: Simple.hpp:547
MoFEM::BaseFunction::DofsSideMap
multi_index_container< DofsSideMapData, indexed_by< ordered_non_unique< tag< TypeSide_mi_tag >, composite_key< DofsSideMapData, member< DofsSideMapData, EntityType, &DofsSideMapData::type >, member< DofsSideMapData, int, &DofsSideMapData::side > >>, ordered_unique< tag< EntDofIdx_mi_tag >, member< DofsSideMapData, int, &DofsSideMapData::dof > > > > DofsSideMap
Map entity stype and side to element/entity dof index.
Definition: BaseFunction.hpp:73
MoFEM::Simple::meshSet
EntityHandle meshSet
domain meshset
Definition: Simple.hpp:530
MoFEM::FiniteElement_row_change_bit_reset
Reset field from row.
Definition: FEMultiIndices.hpp:954
MoFEM::CoreInterface::get_comm
virtual MPI_Comm & get_comm() const =0
MoFEM::CoreInterface::modify_finite_element_add_field_row
virtual MoFEMErrorCode modify_finite_element_add_field_row(const std::string &fe_name, const std::string name_row)=0
set field row which finite element use
MoFEM::Simple::getDM
SmartPetscObj< DM > getDM()
Return smart DM object.
Definition: Simple.hpp:302
MoFEM::Simple::createBoundaryMeshset
MoFEMErrorCode createBoundaryMeshset()
Definition: Simple.cpp:791
MoFEM::CoreInterface::get_field_structure
virtual const Field * get_field_structure(const std::string &name, enum MoFEMTypes bh=MF_EXIST) const =0
get field structure
MoFEM::Simple::meshFileName
char meshFileName[255]
mesh file name
Definition: Simple.hpp:561
MoFEM::Simple::MOFEM_EVENT_SimpleKSPSolve
PetscLogEvent MOFEM_EVENT_SimpleKSPSolve
Definition: Simple.hpp:528
MoFEM::Simple::buildProblem
MoFEMErrorCode buildProblem()
Build problem.
Definition: Simple.cpp:669
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
MoFEM::CoreInterface::create_vertices_and_add_to_field
virtual MoFEMErrorCode create_vertices_and_add_to_field(const std::string name, const double coords[], int size, int verb=DEFAULT_VERBOSITY)=0
Create a vertices and add to field object.
MoFEM::Simple::MOFEM_EVENT_SimpleBuildFields
PetscLogEvent MOFEM_EVENT_SimpleBuildFields
Definition: Simple.hpp:525
MoFEM::getPetscObject
PetscObject getPetscObject(T obj)
Definition: PetscSmartObj.hpp:9
MoFEM::Simple::loadFile
MoFEMErrorCode loadFile(const std::string options, const std::string mesh_file_name, LoadFileFunc loadFunc=defaultLoadFileFunc)
Load mesh file.
Definition: Simple.cpp:194
MoFEM::DMSetUp_MoFEM
PetscErrorCode DMSetUp_MoFEM(DM dm)
Definition: DMMoFEM.cpp:1303
MoFEM::Simple::dIm
int dIm
dimension of problem
Definition: Simple.hpp:562
MoFEM::CoreInterface::add_broken_field
virtual MoFEMErrorCode add_broken_field(const std::string name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_of_coefficients, const std::vector< std::pair< EntityType, std::function< MoFEMErrorCode(BaseFunction::DofsSideMap &)>> > list_dof_side_map, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
Add field.
MoFEM::CoreInterface::get_finite_elements
virtual const FiniteElement_multiIndex * get_finite_elements() const =0
Get the finite elements object.
MoFEM::Simple::addSkeletonFE
bool addSkeletonFE
Add skeleton FE.
Definition: Simple.hpp:534
MoFEM::Simple::nameOfProblem
std::string nameOfProblem
problem name
Definition: Simple.hpp:554
MoFEM::Simple::parentAdjSkeletonFunctionDim2
boost::shared_ptr< ParentFiniteElementAdjacencyFunctionSkeleton< 2 > > parentAdjSkeletonFunctionDim2
Definition: Simple.hpp:584
MoFEM::Simple
Simple interface for fast problem set-up.
Definition: Simple.hpp:27
MoFEM::CoreInterface::modify_problem_mask_ref_level_set_bit
virtual MoFEMErrorCode modify_problem_mask_ref_level_set_bit(const std::string &name_problem, const BitRefLevel &bit)=0
set dof mask ref level for problem
THROW_MESSAGE
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
Definition: definitions.h:574
MoFEM::CoreInterface::add_ents_to_field_by_dim
virtual MoFEMErrorCode add_ents_to_field_by_dim(const Range &ents, const int dim, 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:497
order
constexpr int order
Definition: dg_projection.cpp:18
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
MoFEM::Simple::addSkeletonField
MoFEMErrorCode addSkeletonField(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_ZERO, int verb=-1)
Add field on skeleton.
Definition: Simple.cpp:372
MoFEM::Simple::removeDomainField
MoFEMErrorCode removeDomainField(const std::string &name)
Remove field form domain.
Definition: Simple.cpp:409
MoFEM::Simple::MOFEM_EVENT_SimpleLoadMesh
PetscLogEvent MOFEM_EVENT_SimpleLoadMesh
Definition: Simple.hpp:524
MoFEM::Simple::deleteDM
MoFEMErrorCode deleteDM()
Delete dm.
Definition: Simple.cpp:759
MoFEM::Simple::getOptions
MoFEMErrorCode getOptions()
get options
Definition: Simple.cpp:180
MoFEM::CoreInterface::rebuild_database
virtual MoFEMErrorCode rebuild_database(int verb=DEFAULT_VERBOSITY)=0
Clear database and initialize it once again.
MoFEM::Simple::bitLevelMask
BitRefLevel bitLevelMask
BitRefLevel of the problem.
Definition: Simple.hpp:521
MoFEM::Simple::dataFields
std::vector< std::string > dataFields
Data fields.
Definition: Simple.hpp:546
FieldSpace
FieldSpace
approximation spaces
Definition: definitions.h:82
VERBOSE
@ VERBOSE
Definition: definitions.h:222
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
MoFEM::Simple::bitAdjEntMask
BitRefLevel bitAdjEntMask
bit ref level for parent parent
Definition: Simple.hpp:541
MoFEM::CoreInterface::add_finite_element
virtual MoFEMErrorCode add_finite_element(const std::string &fe_name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
add finite element
MoFEM::CoreInterface::get_moab
virtual moab::Interface & get_moab()=0
MoFEM
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
MoFEM::CoreInterface::modify_finite_element_add_field_col
virtual MoFEMErrorCode modify_finite_element_add_field_col(const std::string &fe_name, const std::string name_row)=0
set field col which finite element use
MoFEM::Simple::deleteFiniteElements
MoFEMErrorCode deleteFiniteElements()
Delete finite elements.
Definition: Simple.cpp:770
MoFEM::createDM
auto createDM(MPI_Comm comm, const std::string dm_type_name)
Creates smart DM object.
Definition: PetscSmartObj.hpp:141
MoFEM::Simple::domainFE
std::string domainFE
domain finite element
Definition: Simple.hpp:555
MoFEM::CoreInterface::build_finite_elements
virtual MoFEMErrorCode build_finite_elements(int verb=DEFAULT_VERBOSITY)=0
Build finite elements.
MoFEM::Types::FieldCoefficientsNumber
int FieldCoefficientsNumber
Number of field coefficients.
Definition: Types.hpp:27
MoFEM::Simple::MOFEM_EVENT_SimpleBuildFiniteElements
PetscLogEvent MOFEM_EVENT_SimpleBuildFiniteElements
Definition: Simple.hpp:526
MoFEM::Simple::LoadFileFunc
boost::function< MoFEMErrorCode(Interface &, const char *, const char *)> LoadFileFunc
Definition: Simple.hpp:43
MoFEM::Simple::createSkeletonMeshset
MoFEMErrorCode createSkeletonMeshset()
Definition: Simple.cpp:838
MoFEM::TriPolynomialBase::setDofsSideMap
static MoFEMErrorCode setDofsSideMap(const FieldSpace space, const FieldContinuity continuity, const FieldApproximationBase base, DofsSideMap &)
Set map of dof to side number.
Definition: TriPolynomialBase.cpp:1228
MoFEM::Simple::boundaryFE
std::string boundaryFE
boundary finite element
Definition: Simple.hpp:556
MoFEM::Simple::addDomainField
MoFEMErrorCode addDomainField(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_ZERO, int verb=-1)
Add field on domain.
Definition: Simple.cpp:264
MoFEM::CoreInterface::delete_finite_element
virtual MoFEMErrorCode delete_finite_element(const std::string name, int verb=DEFAULT_VERBOSITY)=0
delete finite element from mofem database
MoFEM::CoreInterface::get_comm_size
virtual int get_comm_size() const =0
MoFEM::Simple::parentAdjFunctionDim3
boost::shared_ptr< ParentFiniteElementAdjacencyFunction< 3 > > parentAdjFunctionDim3
Definition: Simple.hpp:577
MoFEM::Simple::bitAdjParentMask
BitRefLevel bitAdjParentMask
bit ref level for parent parent
Definition: Simple.hpp:539
MoFEM::Simple::skeletonFE
std::string skeletonFE
skeleton finite element
Definition: Simple.hpp:557
MoFEM::Simple::removeBoundaryField
MoFEMErrorCode removeBoundaryField(const std::string &name)
Remove field form boundary.
Definition: Simple.cpp:424
MOFEM_OPERATION_UNSUCCESSFUL
@ MOFEM_OPERATION_UNSUCCESSFUL
Definition: definitions.h:34
MoFEM::Simple::bitAdjEnt
BitRefLevel bitAdjEnt
bit ref level for parent
Definition: Simple.hpp:540
MoFEM::CoreInterface::add_ents_to_finite_element_by_dim
virtual MoFEMErrorCode add_ents_to_finite_element_by_dim(const EntityHandle entities, const int dim, const std::string &name, const bool recursive=true)=0
add entities to finite element
t
constexpr double t
plate stiffness
Definition: plate.cpp:58
MoFEM::DMMoFEMCreateMoFEM
PetscErrorCode DMMoFEMCreateMoFEM(DM dm, MoFEM::Interface *m_field_ptr, const char problem_name[], const MoFEM::BitRefLevel bit_level, const MoFEM::BitRefLevel bit_mask=MoFEM::BitRefLevel().set())
Must be called by user to set MoFEM data structures.
Definition: DMMoFEM.cpp:114
MoFEM::CoreInterface::modify_finite_element_add_field_data
virtual MoFEMErrorCode modify_finite_element_add_field_data(const std::string &fe_name, const std::string name_field)=0
set finite element field data
MoFEM::Simple::addDataField
MoFEMErrorCode addDataField(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_ZERO, int verb=-1)
Add field on domain.
Definition: Simple.cpp:392
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
AINSWORTH_BERNSTEIN_BEZIER_BASE
@ AINSWORTH_BERNSTEIN_BEZIER_BASE
Definition: definitions.h:64
mesh_file_name
char mesh_file_name[255]
Definition: mesh_smoothing.cpp:22
MoFEM::Simple::setFieldOrder
MoFEMErrorCode setFieldOrder(const std::string field_name, const int order, const Range *ents=NULL)
Set field order.
Definition: Simple.cpp:545
MoFEM::Simple::buildFiniteElements
MoFEMErrorCode buildFiniteElements()
Build finite elements.
Definition: Simple.cpp:643
MoFEM::UnknownInterface
base class for all interface classes
Definition: UnknownInterface.hpp:34
Range
MoFEM::TetPolynomialBase::setDofsSideMap
static MoFEMErrorCode setDofsSideMap(const FieldSpace space, const FieldContinuity continuity, const FieldApproximationBase base, DofsSideMap &)
Set map of dof to side number.
Definition: TetPolynomialBase.cpp:2102
FTensor::dd
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: ddTensor0.hpp:33
MF_ZERO
@ MF_ZERO
Definition: definitions.h:111
MOFEM_TAG_AND_LOG
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
Definition: LogManager.hpp:362
MOFEM_LOG
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:308
MoFEM::Simple::domainFields
std::vector< std::string > domainFields
domain fields
Definition: Simple.hpp:543
MoFEM::CommInterface
Managing BitRefLevels.
Definition: CommInterface.hpp:21
HenckyOps::f
auto f
Definition: HenckyOps.hpp:15
MoFEM::Simple::addDomainBrokenField
MoFEMErrorCode addDomainBrokenField(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_ZERO, int verb=-1)
Add broken field on domain.
Definition: Simple.cpp:282
DISCONTINUOUS
@ DISCONTINUOUS
Broken continuity (No effect on L2 space)
Definition: definitions.h:101
MoFEM::Simple::skeletonFields
std::vector< std::string > skeletonFields
fields on the skeleton
Definition: Simple.hpp:545
MoFEM::Exceptions::ierr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76
HCURL
@ HCURL
field with continuous tangents
Definition: definitions.h:86
MoFEM::DMMoFEMGetProblemPtr
PetscErrorCode DMMoFEMGetProblemPtr(DM dm, const MoFEM::Problem **problem_ptr)
Get pointer to problem data structure.
Definition: DMMoFEM.cpp:426
MoFEM::Simple::bitLevel
BitRefLevel bitLevel
BitRefLevel of the problem.
Definition: Simple.hpp:520
MoFEM::Simple::defineFiniteElements
MoFEMErrorCode defineFiniteElements()
Define finite elements.
Definition: Simple.cpp:452
MoFEM::Simple::getDim
int getDim() const
Get the problem dimension.
Definition: Simple.hpp:312
MoFEM::Simple::buildFields
MoFEMErrorCode buildFields()
Build fields.
Definition: Simple.cpp:554
MoFEM::CoreInterface::build_fields
virtual MoFEMErrorCode build_fields(int verb=DEFAULT_VERBOSITY)=0
MoFEM::Simple::bitAdjParent
BitRefLevel bitAdjParent
bit ref level for parent
Definition: Simple.hpp:538
MoFEM::Simple::noFieldDataFields
std::vector< std::string > noFieldDataFields
NOFIELD field name.
Definition: Simple.hpp:548
sdf_hertz_2d_axisymm_plane.d
float d
Definition: sdf_hertz_2d_axisymm_plane.py:4
FieldApproximationBase
FieldApproximationBase
approximation base
Definition: definitions.h:58
MoFEMTypes
MoFEMTypes
Those types control how functions respond on arguments, f.e. error handling.
Definition: definitions.h:110
MoFEM::Simple::addBoundaryField
MoFEMErrorCode addBoundaryField(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_ZERO, int verb=-1)
Add field on boundary.
Definition: Simple.cpp:354
MoFEM::Simple::reSetUp
MoFEMErrorCode reSetUp(bool only_dm=false)
Rebuild internal MoFEM data structures.
Definition: Simple.cpp:709
FiniteElement_multiIndex
multi_index_container< boost::shared_ptr< FiniteElement >, indexed_by< hashed_unique< tag< FiniteElement_Meshset_mi_tag >, member< FiniteElement, EntityHandle, &FiniteElement::meshset > >, hashed_unique< tag< BitFEId_mi_tag >, const_mem_fun< FiniteElement, BitFEId, &FiniteElement::getId >, HashBit< BitFEId >, EqBit< BitFEId > >, ordered_unique< tag< FiniteElement_name_mi_tag >, const_mem_fun< FiniteElement, boost::string_ref, &FiniteElement::getNameRef > > > > FiniteElement_multiIndex
MultiIndex for entities for FiniteElement.
Definition: FEMultiIndices.hpp:849
MoFEM::BitRefManager
Managing BitRefLevels.
Definition: BitRefManager.hpp:21
MoFEM::Simple::boundaryMeshset
EntityHandle boundaryMeshset
meshset with boundary
Definition: Simple.hpp:531
MoFEM::Simple::parentAdjSkeletonFunctionDim1
boost::shared_ptr< ParentFiniteElementAdjacencyFunctionSkeleton< 1 > > parentAdjSkeletonFunctionDim1
Definition: Simple.hpp:586
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
MoFEM::CoreInterface::build_adjacencies
virtual MoFEMErrorCode build_adjacencies(const Range &ents, int verb=DEFAULT_VERBOSITY)=0
build adjacencies
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
MoFEM::Simple::defineProblem
MoFEMErrorCode defineProblem(const PetscBool is_partitioned=PETSC_TRUE)
define problem
Definition: Simple.cpp:524
MoFEM::Problem
keeps basic data about problem
Definition: ProblemsMultiIndices.hpp:54
MoFEM::CoreInterface::check_finite_element
virtual bool check_finite_element(const std::string &name) const =0
Check if finite element is in database.
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::Simple::dM
SmartPetscObj< DM > dM
Discrete manager (interface to PETSc/MoFEM functions)
Definition: Simple.hpp:565
MoFEM::Simple::setParentAdjacency
MoFEMErrorCode setParentAdjacency()
Definition: Simple.cpp:67
MoFEM::Simple::setUp
MoFEMErrorCode setUp(const PetscBool is_partitioned=PETSC_TRUE)
Setup problem.
Definition: Simple.cpp:683
MoFEM::Problem::getName
auto getName() const
Definition: ProblemsMultiIndices.hpp:372
MoFEM::Simple::getProblemName
const std::string getProblemName() const
Get the Problem Name.
Definition: Simple.hpp:389
MoFEM::Simple::addFieldToEmptyFieldBlocks
MoFEMErrorCode addFieldToEmptyFieldBlocks(const std::string row_field, const std::string col_field) const
add empty block to problem
Definition: Simple.cpp:782
MoFEM::Simple::cOre
MoFEM::Core & cOre
Definition: Simple.hpp:518
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEM::Simple::skeletonMeshset
EntityHandle skeletonMeshset
skeleton meshset with boundary
Definition: Simple.hpp:532
MoFEM::Simple::MOFEM_EVENT_SimpleSetUP
PetscLogEvent MOFEM_EVENT_SimpleSetUP
Definition: Simple.hpp:523
HDIV
@ HDIV
field with continuous normal traction
Definition: definitions.h:87
MOFEM_NOT_IMPLEMENTED
@ MOFEM_NOT_IMPLEMENTED
Definition: definitions.h:32
MoFEM::FiniteElement_col_change_bit_reset
Reset field from column.
Definition: FEMultiIndices.hpp:944
CHKERRG
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:496
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.
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
NOFIELD
@ NOFIELD
scalar or vector of scalars describe (no true field)
Definition: definitions.h:84
MoFEM::DMMoFEMSetIsPartitioned
PetscErrorCode DMMoFEMSetIsPartitioned(DM dm, PetscBool is_partitioned)
Definition: DMMoFEM.cpp:1123
MoFEM::Simple::MOFEM_EVENT_SimpleBuildProblem
PetscLogEvent MOFEM_EVENT_SimpleBuildProblem
Definition: Simple.hpp:527
MoFEM::Simple::removeSkeletonField
MoFEMErrorCode removeSkeletonField(const std::string &name)
Remove field form skeleton.
Definition: Simple.cpp:438