v0.14.0
Core.cpp
Go to the documentation of this file.
1 /** \file Core.cpp
2  * \brief Multi-index containers, data structures and other low-level functions
3  */
4 
5 
6 #include <MoFEM.hpp>
7 
8 #include "impl/ErrorHandler.cpp"
9 
10 extern "C" {
12 }
13 
14 namespace MoFEM {
15 
16 WrapMPIComm::WrapMPIComm(MPI_Comm comm, bool petsc)
17  : comm(comm), isPetscComm(petsc) {
18  if (isPetscComm) {
19  ierr = PetscCommDuplicate(comm, &duplicatedComm, NULL);
20  CHKERRABORT(comm, ierr);
21  } else {
22  int ierr = MPI_Comm_dup(comm, &duplicatedComm);
23  if (ierr) {
24  THROW_MESSAGE("MPI_Comm_dup not working");
25  }
26  }
27 }
29  if (isPetscComm) {
30  ierr = PetscCommDestroy(&duplicatedComm);
31  CHKERRABORT(comm, ierr);
32  } else {
33  int ierr = MPI_Comm_free(&duplicatedComm);
34  if (ierr) {
35  CHKERRABORT(comm, MOFEM_DATA_INCONSISTENCY);
36  }
37  }
38 }
39 
40 constexpr const int CoreTmp<0>::value;
41 constexpr const int CoreTmp<-1>::value;
42 
43 MoFEMErrorCode Core::query_interface(boost::typeindex::type_index type_index,
44  UnknownInterface **iface) const {
46  *iface = NULL;
47  if (type_index == boost::typeindex::type_id<CoreInterface>()) {
48  *iface = static_cast<CoreInterface *>(const_cast<Core *>(this));
50  } else if (type_index ==
51  boost::typeindex::type_id<DeprecatedCoreInterface>()) {
52  *iface = static_cast<DeprecatedCoreInterface *>(const_cast<Core *>(this));
54  }
55 
56  // Get sub-interface
57  auto it = iFaces.find(type_index);
58  if (it != iFaces.end()) {
59  *iface = it->second;
61  }
62 
63  *iface = NULL;
64  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "unknown interface");
66 }
67 
68 bool Core::isGloballyInitialised = false;
70 PetscBool Core::isInitialized;
71 
72 MoFEMErrorCode Core::Initialize(int *argc, char ***args, const char file[],
73  const char help[]) {
74 
75  MPI_Initialized(&mpiInitialised);
76  if (!mpiInitialised)
77  MPI_Init(argc, args);
78 
79  PetscInitialized(&isInitialized);
80  if (isInitialized == PETSC_FALSE) {
81  PetscInitialize(argc, args, file, help);
82  PetscPushErrorHandler(mofem_error_handler, PETSC_NULL);
83  }
84 
85  LogManager::createDefaultSinks(MPI_COMM_WORLD);
86  PetscVFPrintf = LogManager::logPetscFPrintf;
88  isGloballyInitialised = true;
89 
90  MOFEM_LOG_CHANNEL("WORLD");
91  char petsc_version[255];
92  CHKERR PetscGetVersion(petsc_version, 255);
93  MOFEM_LOG_C("WORLD", Sev::inform, "MoFEM version %d.%d.%d (%s %s)",
94  MoFEM_VERSION_MAJOR, MoFEM_VERSION_MINOR, MoFEM_VERSION_BUILD,
95  MOAB_VERSION_STRING, petsc_version);
96  MOFEM_LOG_C("WORLD", Sev::inform, "git commit id %s", GIT_SHA1_NAME);
97 
98  auto log_time = [&](const auto perefix, auto time) {
99  MOFEM_LOG("WORLD", Sev::inform)
100  << perefix << time.date().year() << "-" << time.date().month() << "-"
101  << time.date().day() << " " << time.time_of_day().hours() << ":"
102  << time.time_of_day().minutes() << ":" << time.time_of_day().seconds();
103  };
104 
105  // Get current system time
106  log_time("Local time: ", boost::posix_time::second_clock::local_time());
107  log_time("UTC time: ", boost::posix_time::second_clock::universal_time());
108 
109  return MOFEM_SUCCESS;
110 }
111 
113  if (isGloballyInitialised) {
114  PetscPopErrorHandler();
115  isGloballyInitialised = false;
116 
117  if (isInitialized == PETSC_FALSE) {
118  PetscBool is_finalized;
119  PetscFinalized(&is_finalized);
120  if (!is_finalized)
121  PetscFinalize();
122  }
123 
124  if (!mpiInitialised) {
125  int mpi_finalized;
126  MPI_Finalized(&mpi_finalized);
127  if (!mpi_finalized)
128  MPI_Finalize();
129  }
130  }
131 
132  return 0;
133 }
134 
135 // Use SFINAE to decide which template should be run,
136 // if exist getSubInterfaceOptions run this one.
137 template <class T>
138 static auto get_sub_iface_options_imp(T *const ptr, int)
139  -> decltype(ptr->getSubInterfaceOptions()) {
140  return ptr->getSubInterfaceOptions();
141 };
142 
143 // Use SFINAE to decide which template should be run,
144 // if getSubInterfaceOptions not exist run this one.
145 template <class T>
146 static auto get_sub_iface_options_imp(T *const ptr, long) -> MoFEMErrorCode {
147  return 0;
148 };
149 
150 template <class T>
151 static auto get_event_options_imp(T *const ptr, int)
152  -> decltype(ptr->getEventOptions()) {
153  return ptr->getEventptions();
154 };
155 
156 // Use SFINAE to decide which template should be run,
157 // if getSubInterfaceOptions not exist run this one.
158 // See SFINAE:
159 // https://stackoverflow.com/questions/257288/is-it-possible-to-write-a-template-to-check-for-a-functions-existence
160 // https://en.wikipedia.org/wiki/Substitution_failure_is_not_an_error
161 template <class T>
162 static auto get_event_options_imp(T *const ptr, long) -> MoFEMErrorCode {
163  return 0;
164 };
165 
166 template <class IFACE> MoFEMErrorCode Core::regSubInterface() {
168  CHKERR registerInterface<IFACE>(true);
169  IFACE *ptr = new IFACE(*this);
170 
171  // If sub interface has function getSubInterfaceOptions run
172  // it after construction. getSubInterfaceOptions is used to
173  // get parameters from command line.
174  auto get_sub_iface_options = [](auto *const ptr) {
175  return get_sub_iface_options_imp(ptr, 0);
176  };
177  CHKERR get_sub_iface_options(ptr);
178 
179  auto type_idx = boost::typeindex::type_id<IFACE>();
180  iFaces.insert(type_idx, ptr);
182 }
183 
184 template <class IFACE> MoFEMErrorCode Core::regEvents() {
186  auto ptr = boost::make_shared<IFACE>();
187  // See SFINAE:
188  // https://stackoverflow.com/questions/257288/is-it-possible-to-write-a-template-to-check-for-a-functions-existence
189  // https://en.wikipedia.org/wiki/Substitution_failure_is_not_an_error
190  auto get_event_options = [](auto *const ptr) {
191  return get_event_options_imp(ptr, 0);
192  };
193  CHKERR get_event_options(ptr.get());
195 }
196 
198  MPI_Comm comm, const int verbose) {
200 
201  // This is deprecated ONE should use MoFEM::Core::Initialize
202  if (!isGloballyInitialised)
203  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
204  "MoFEM globally is not initialised, call MoFEM::Core::Initialize");
205 
206  // Create duplicate communicator
207  wrapMPIMOABComm = boost::make_shared<WrapMPIComm>(comm, false);
208 
209  MPI_Comm_size(mofemComm, &sIze);
210  MPI_Comm_rank(mofemComm, &rAnk);
211 
212  // CHeck if moab has set communicator if not set communicator interbally
213  ParallelComm *pComm = ParallelComm::get_pcomm(&moab, MYPCOMM_INDEX);
214  if (pComm == NULL)
215  pComm = new ParallelComm(&moab, wrapMPIMOABComm->get_comm());
216 
217  // Register interfaces for this implementation
218  CHKERR registerInterface<UnknownInterface>();
219  CHKERR registerInterface<CoreInterface>();
220  CHKERR registerInterface<DeprecatedCoreInterface>();
221 
222  // Register MOFEM events in PETSc
223  PetscLogEventRegister("FE_preProcess", 0, &MOFEM_EVENT_preProcess);
224  PetscLogEventRegister("FE_operator", 0, &MOFEM_EVENT_operator);
225  PetscLogEventRegister("FE_postProcess", 0, &MOFEM_EVENT_postProcess);
226  PetscLogEventRegister("MoFEMCreateMat", 0, &MOFEM_EVENT_createMat);
227 
228  MOFEM_LOG_CHANNEL("WORLD");
229  MOFEM_LOG_CHANNEL("SELF");
230  MOFEM_LOG_CHANNEL("SYNC");
231 
233 }
234 
235 Core::CoreTmp(moab::Interface &moab, ///< MoAB interface
236  MPI_Comm comm, ///< MPI communicator
237  const int verbose ///< Verbosity level
238 
239  )
240  : CoreTmp(moab, comm, verbose, CoreValue<0>()) {
241 
242  // Register sub-interfaces
243  ierr = this->registerSubInterfaces();
244  CHKERRABORT(comm, ierr);
245  ierr = this->clearMap();
246  CHKERRABORT(comm, ierr);
247  ierr = this->getTags();
248  CHKERRABORT(comm, ierr);
249  ierr = this->getOptions(verbose);
250  CHKERRABORT(comm, ierr);
251 
252  this->basicEntityDataPtr = boost::make_shared<BasicEntityData>(moab);
253  setRefEntBasicDataPtr(*this, this->basicEntityDataPtr);
254 
255  ierr = this->initialiseDatabaseFromMesh(verbose);
256  CHKERRABORT(comm, ierr);
257 }
258 
259 CoreTmp<-1>::CoreTmp(moab::Interface &moab, ///< MoAB interface
260  MPI_Comm comm, ///< MPI communicator
261  const int verbose ///< Verbosity level
262 
263  )
264  : CoreTmp<0>(moab, comm, verbose, CoreValue<-1>()) {
265 
266  // Register sub-interfaces
267  ierr = this->registerSubInterfaces();
268  CHKERRABORT(comm, ierr);
269  ierr = this->clearMap();
270  CHKERRABORT(comm, ierr);
271  ierr = this->getTags();
272  CHKERRABORT(comm, ierr);
273  ierr = this->getOptions(verbose);
274  CHKERRABORT(comm, ierr);
275 
276  this->basicEntityDataPtr = boost::make_shared<BasicEntityData>(moab);
277  setRefEntBasicDataPtr(*this, this->basicEntityDataPtr);
278 
279  ierr = this->initialiseDatabaseFromMesh(verbose);
280  CHKERRABORT(comm, ierr);
281 }
282 
284  PetscBool is_finalized;
285  PetscFinalized(&is_finalized);
286  // Destroy interfaces
287  iFaces.clear();
288  // This is deprecated ONE should use MoFEM::Core::Initialize
289  if (isGloballyInitialised && is_finalized) {
290  isGloballyInitialised = false;
291  }
292 }
293 
295  MOFEM_LOG_CHANNEL("WORLD");
297  if (verb == -1)
298  verb = verbose;
299 
300  Range ref_elems_to_add;
301 
302  // Initialize database
303  Range meshsets;
304  CHKERR get_moab().get_entities_by_type(0, MBENTITYSET, meshsets, false);
305  Range special_meshsets;
306  for (auto mit : meshsets) {
307  BitFieldId field_id;
308  // Get bit id form field tag
309  CHKERR get_moab().tag_get_data(th_FieldId, &mit, 1, &field_id);
310  // Check if meshset if field meshset
311  if (field_id != 0) {
312 
313  const void *tag_name;
314  int tag_name_size;
315  CHKERR get_moab().tag_get_by_ptr(
316  th_FieldName, &mit, 1, (const void **)&tag_name, &tag_name_size);
317 
318  if (verb > QUIET)
319  MOFEM_LOG("WORLD", Sev::verbose)
320  << "Read field "
321  << boost::string_ref((char *)tag_name, tag_name_size);
322 
323  auto p = fIelds.insert(boost::make_shared<Field>(moab, mit));
324 
325  if (!p.second) {
326  // Field meshset exists, remove duplicate meshsets from other
327  // processors.
328  Range ents;
329  CHKERR get_moab().get_entities_by_handle(mit, ents, true);
330  CHKERR get_moab().add_entities((*p.first)->getMeshset(), ents);
331  CHKERR get_moab().delete_entities(&mit, 1);
332  } else {
333  special_meshsets.insert(mit);
334  }
335  }
336  // Check for finite elements
337  BitFieldId fe_id;
338  // Get bit id from fe tag
339  CHKERR get_moab().tag_get_data(th_FEId, &mit, 1, &fe_id);
340  // check if meshset is finite element meshset
341  if (fe_id != 0) {
342  std::pair<FiniteElement_multiIndex::iterator, bool> p =
343  finiteElements.insert(
344  boost::shared_ptr<FiniteElement>(new FiniteElement(moab, mit)));
345  if (verb > QUIET)
346  MOFEM_LOG("WORLD", Sev::verbose) << "Read finite element " << **p.first;
347 
348  Range ents;
349  CHKERR get_moab().get_entities_by_type(mit, MBENTITYSET, ents, false);
350  CHKERR get_moab().get_entities_by_handle(mit, ents, true);
351  ref_elems_to_add.merge(ents);
352  if (!p.second) {
353  // Finite element mesh set exist, could be created on other processor.
354  // Remove duplicate.
355  CHKERR get_moab().add_entities((*p.first)->getMeshset(), ents);
356  CHKERR get_moab().delete_entities(&mit, 1);
357  } else {
358  special_meshsets.insert(mit);
359  }
360  }
361  BitProblemId problem_id;
362  // get bit id form problem tag
363  CHKERR get_moab().tag_get_data(th_ProblemId, &mit, 1, &problem_id);
364  // check if meshset if problem meshset
365  if (problem_id != 0) {
366  std::pair<Problem_multiIndex::iterator, bool> p =
367  pRoblems.insert(Problem(moab, mit));
368  if (verb > QUIET) {
369  MOFEM_LOG("WORLD", Sev::verbose) << "Read problem " << *p.first;
370  MOFEM_LOG("WORLD", Sev::noisy)
371  << "\tBitRef " << p.first->getBitRefLevel() << " BitMask "
372  << p.first->getBitRefLevelMask();
373  }
374 
375  if (!p.second) {
376  // Problem meshset exists, could be created on other processor.
377  // Remove duplicate.
378  Range ents;
379  CHKERR get_moab().get_entities_by_handle(mit, ents, true);
380  CHKERR get_moab().get_entities_by_type(mit, MBENTITYSET, ents, true);
381  CHKERR get_moab().add_entities(p.first->meshset, ents);
382  CHKERR get_moab().delete_entities(&mit, 1);
383  } else {
384  special_meshsets.insert(mit);
385  }
386  }
387  }
388 
389  // Add entities to database
390  Range bit_ref_ents;
391  CHKERR get_moab().get_entities_by_handle(0, bit_ref_ents, false);
392  bit_ref_ents = subtract(bit_ref_ents, special_meshsets);
393  CHKERR getInterface<BitRefManager>()->filterEntitiesByRefLevel(
394  BitRefLevel().set(), BitRefLevel().set(), bit_ref_ents);
395  CHKERR getInterface<BitRefManager>()->setEntitiesBitRefLevel(bit_ref_ents);
396  CHKERR getInterface<BitRefManager>()->setElementsBitRefLevel(
397  ref_elems_to_add);
398 
399  // Build field entities
400  for (auto field : fIelds) {
401  if (field->getSpace() != NOSPACE) {
402  Range ents_of_id_meshset;
403  CHKERR get_moab().get_entities_by_handle(field->getMeshset(),
404  ents_of_id_meshset, false);
405  CHKERR set_field_order(ents_of_id_meshset, field->getId(), -1, verb);
406  }
407  }
408 
409  if (initaliseAndBuildField || initaliseAndBuildFiniteElements) {
410  CHKERR build_fields(verb);
411  if (initaliseAndBuildFiniteElements) {
412  CHKERR build_finite_elements(verb);
413  }
414  }
415 
416  if (verb > VERY_NOISY) {
417  list_fields();
418  list_finite_elements();
419  list_problem();
420  }
421 
422  // Initialize interfaces
423  MeshsetsManager *m_manger_ptr;
424  CHKERR getInterface(m_manger_ptr);
425  CHKERR m_manger_ptr->initialiseDatabaseFromMesh(verb);
426  SeriesRecorder *series_recorder_ptr;
427  CHKERR getInterface(series_recorder_ptr);
428  CHKERR series_recorder_ptr->initialiseDatabaseFromMesh(verb);
429 
431 }
432 
435  if (verb == -1)
436  verb = verbose;
437 
438  // clear moab database
439  CHKERR clearMap();
440 
441  // set new reference
442  moab = std::ref(new_moab);
443 
444  // check if moab has set communicator if not set communicator internally
445  ParallelComm *pComm = ParallelComm::get_pcomm(&new_moab, MYPCOMM_INDEX);
446  if (pComm == NULL) {
447  pComm = new ParallelComm(&new_moab, wrapMPIMOABComm->get_comm());
448  }
449 
450  // create MoFEM tags
451  CHKERR getTags();
452 
453  // Create basic entity data struture
454  basicEntityDataPtr = boost::make_shared<BasicEntityData>(moab);
455  setRefEntBasicDataPtr(*this, this->basicEntityDataPtr);
456 
457  // Initalise database
458  CHKERR this->initialiseDatabaseFromMesh(verb);
459 
461 };
462 
465 
466  iFaces.clear();
467 
468  // Register sub interfaces
469  CHKERR regSubInterface<LogManager>();
470  CHKERR regSubInterface<Simple>();
471  CHKERR regSubInterface<OperatorsTester>();
472  CHKERR regSubInterface<PipelineManager>();
473  CHKERR regSubInterface<ProblemsManager>();
474  CHKERR regSubInterface<MatrixManager>();
475  CHKERR regSubInterface<ISManager>();
476  CHKERR regSubInterface<VecManager>();
477  CHKERR regSubInterface<FieldBlas>();
478  CHKERR regSubInterface<BitRefManager>();
479  CHKERR regSubInterface<Tools>();
480  CHKERR regSubInterface<CommInterface>();
481  CHKERR regSubInterface<MeshsetsManager>();
482  CHKERR regSubInterface<NodeMergerInterface>();
483  CHKERR regSubInterface<PrismsFromSurfaceInterface>();
484  CHKERR regSubInterface<MeshRefinement>();
485  CHKERR regSubInterface<PrismInterface>();
486  CHKERR regSubInterface<CutMeshInterface>();
487  CHKERR regSubInterface<SeriesRecorder>();
488 #ifdef WITH_TETGEN
489  CHKERR regSubInterface<TetGenInterface>();
490 #endif
491 #ifdef WITH_MED
492  CHKERR regSubInterface<MedInterface>();
493 #endif
494  CHKERR regSubInterface<FieldEvaluatorInterface>();
495  CHKERR regSubInterface<BcManager>();
496 
497  // Register events
498  CHKERR regEvents<SchurEvents>();
499 
501 };
502 
505  // Cleaning databases in interfaces
506  CHKERR getInterface<SeriesRecorder>()->clearMap();
507  CHKERR getInterface<MeshsetsManager>()->clearMap();
508  CHKERR getInterface<CutMeshInterface>()->clearMap();
509  // Cleaning databases
510  refinedEntities.clear();
511  refinedFiniteElements.clear();
512  fIelds.clear();
513  entsFields.clear();
514  dofsField.clear();
515  finiteElements.clear();
516  entsFiniteElements.clear();
517  entFEAdjacencies.clear();
518  pRoblems.clear();
520 }
521 
524  if (verb == -1)
525  verb = verbose;
526  std::pair<RefEntity_multiIndex::iterator, bool> p_ent;
527  p_ent = refinedEntities.insert(
528  boost::make_shared<RefEntity>(basicEntityDataPtr, prism));
529  if (p_ent.second) {
530  std::pair<RefElement_multiIndex::iterator, bool> p;
531  p = refinedFiniteElements.insert(
532  boost::shared_ptr<RefElement>(new RefElement_PRISM(*p_ent.first)));
533  int num_nodes;
534  const EntityHandle *conn;
535  CHKERR get_moab().get_connectivity(prism, conn, num_nodes, true);
536  Range face_side3, face_side4;
537  CHKERR get_moab().get_adjacencies(conn, 3, 2, false, face_side3);
538  CHKERR get_moab().get_adjacencies(&conn[3], 3, 2, false, face_side4);
539  if (face_side3.size() != 1)
540  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
541  "prism don't have side face 3");
542  if (face_side4.size() != 1)
543  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
544  "prims don't have side face 4");
545  p.first->get()->getSideNumberPtr(*face_side3.begin());
546  p.first->get()->getSideNumberPtr(*face_side4.begin());
547  }
549 }
550 
553 
554  const EntityHandle root_meshset = get_moab().get_root_set();
555  if (root_meshset) {
556  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
557  "Root meshset should be 0");
558  }
559 
560  // Set version
561  {
562  Version version;
563  CHKERR getFileVersion(moab, version);
564  }
565 
566  // Global Variables
567  {
568 
569  auto check_tag_allocated = [](auto &rval) {
571  if (rval == MB_ALREADY_ALLOCATED)
572  rval = MB_SUCCESS;
573  else
574  CHKERRG(rval);
576  };
577 
578  // Safety nets
579  int def_bool = 0;
580  rval = get_moab().tag_get_handle("_MoFEMBuild", 1, MB_TYPE_INTEGER,
581  th_MoFEMBuild, MB_TAG_CREAT | MB_TAG_MESH,
582  &def_bool);
583  CHKERR check_tag_allocated(rval);
584 
585  CHKERR get_moab().tag_get_by_ptr(th_MoFEMBuild, &root_meshset, 1,
586  (const void **)&buildMoFEM);
587  }
588 
589  // Tags saved in vtk-files
590  {
591  const int def_part = -1;
592  CHKERR get_moab().tag_get_handle("PARTITION", 1, MB_TYPE_INTEGER, th_Part,
593  MB_TAG_CREAT | MB_TAG_SPARSE, &def_part);
594  }
595 
596  // Tags Ref
597  {
598 
599  // Fix size of bir ref level tags
600  CHKERR BitRefManager::fixTagSize(get_moab());
601 
602  const int def_part = -1;
603  CHKERR get_moab().tag_get_handle("_MeshsetPartition", 1, MB_TYPE_INTEGER,
604  th_Part, MB_TAG_CREAT | MB_TAG_SPARSE,
605  &def_part);
606  EntityHandle def_handle = 0;
607  CHKERR get_moab().tag_get_handle("_RefParentHandle", 1, MB_TYPE_HANDLE,
608  th_RefParentHandle,
609  MB_TAG_CREAT | MB_TAG_SPARSE, &def_handle);
610  BitRefLevel def_bit_level = 0;
611  CHKERR get_moab().tag_get_handle(
612  "_RefBitLevel", sizeof(BitRefLevel), MB_TYPE_OPAQUE, th_RefBitLevel,
613  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_bit_level);
614  BitRefLevel def_bit_level_mask = BitRefLevel().set();
615  CHKERR get_moab().tag_get_handle(
616  "_RefBitLevelMask", sizeof(BitRefLevel), MB_TYPE_OPAQUE,
617  th_RefBitLevel_Mask, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
618  &def_bit_level_mask);
619  BitRefEdges def_bit_edge = 0;
620  CHKERR get_moab().tag_get_handle(
621  "_RefBitEdge", sizeof(BitRefEdges), MB_TYPE_OPAQUE, th_RefBitEdge,
622  MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES, &def_bit_edge);
623  }
624 
625  // Tags Field
626  {
627  const unsigned long int def_id = 0;
628  CHKERR get_moab().tag_get_handle(
629  "_FieldId", sizeof(BitFieldId), MB_TYPE_OPAQUE, th_FieldId,
630  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
631  FieldSpace def_space = LASTSPACE;
632  CHKERR get_moab().tag_get_handle(
633  "_FieldSpace", sizeof(FieldSpace), MB_TYPE_OPAQUE, th_FieldSpace,
634  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_space);
635  FieldContinuity def_continuity = LASTCONTINUITY;
636  CHKERR get_moab().tag_get_handle(
637  "_FieldContinuity", sizeof(FieldContinuity), MB_TYPE_OPAQUE,
638  th_FieldContinuity, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
639  &def_continuity);
640  FieldApproximationBase def_base = LASTBASE;
641  CHKERR get_moab().tag_get_handle(
642  "_FieldBase", sizeof(FieldApproximationBase), MB_TYPE_OPAQUE,
643  th_FieldBase, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_base);
644  const int def_val_len = 0;
645  CHKERR get_moab().tag_get_handle(
646  "_FieldName", def_val_len, MB_TYPE_OPAQUE, th_FieldName,
647  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
648  CHKERR get_moab().tag_get_handle(
649  "_FieldName_DataNamePrefix", def_val_len, MB_TYPE_OPAQUE,
650  th_FieldName_DataNamePrefix,
651  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
652  }
653 
654  // Tags FE
655  {
656  const unsigned long int def_id = 0;
657  const int def_val_len = 0;
658  CHKERR get_moab().tag_get_handle(
659  "_FEId", sizeof(BitFEId), MB_TYPE_OPAQUE, th_FEId,
660  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
661  CHKERR get_moab().tag_get_handle(
662  "_FEName", def_val_len, MB_TYPE_OPAQUE, th_FEName,
663  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
664  CHKERR get_moab().tag_get_handle(
665  "_FEIdCol", sizeof(BitFieldId), MB_TYPE_OPAQUE, th_FEIdCol,
666  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
667  CHKERR get_moab().tag_get_handle(
668  "_FEIdRow", sizeof(BitFieldId), MB_TYPE_OPAQUE, th_FEIdRow,
669  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
670  CHKERR get_moab().tag_get_handle(
671  "_FEIdData", sizeof(BitFieldId), MB_TYPE_OPAQUE, th_FEIdData,
672  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
673  }
674 
675  // Tags Problem
676  {
677  const unsigned long int def_id = 0;
678  const int def_val_len = 0;
679  CHKERR get_moab().tag_get_handle(
680  "_ProblemId", sizeof(BitProblemId), MB_TYPE_OPAQUE, th_ProblemId,
681  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
682  CHKERR get_moab().tag_get_handle(
683  "_ProblemFEId", sizeof(BitFEId), MB_TYPE_OPAQUE, th_ProblemFEId,
684  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
685  CHKERR get_moab().tag_get_handle(
686  "_ProblemName", def_val_len, MB_TYPE_OPAQUE, th_ProblemName,
687  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
688  DofIdx def_nbdofs = 0;
689  CHKERR get_moab().tag_get_handle(
690  "_ProblemNbDofsRow", sizeof(DofIdx), MB_TYPE_OPAQUE,
691  th_ProblemNbDofsRow, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
692  &def_nbdofs);
693  CHKERR get_moab().tag_get_handle(
694  "_ProblemNbDofsCol", sizeof(DofIdx), MB_TYPE_OPAQUE,
695  th_ProblemNbDofsCol, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
696  &def_nbdofs);
697  CHKERR get_moab().tag_get_handle(
698  "_ProblemLocalNbDofsRow", sizeof(DofIdx), MB_TYPE_OPAQUE,
699  th_ProblemLocalNbDofRow, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
700  &def_nbdofs);
701  CHKERR get_moab().tag_get_handle(
702  "_ProblemGhostNbDofsRow", sizeof(DofIdx), MB_TYPE_OPAQUE,
703  th_ProblemGhostNbDofRow, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
704  &def_nbdofs);
705  CHKERR get_moab().tag_get_handle(
706  "_ProblemLocalNbDofsCol", sizeof(DofIdx), MB_TYPE_OPAQUE,
707  th_ProblemLocalNbDofCol, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
708  &def_nbdofs);
709  CHKERR get_moab().tag_get_handle(
710  "_ProblemGhostNbDofsCol", sizeof(DofIdx), MB_TYPE_OPAQUE,
711  th_ProblemGhostNbDofCol, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
712  &def_nbdofs);
713  }
714 
715  // Meshsets with boundary conditions and material sets
716  MeshsetsManager *meshsets_manager_ptr;
717  CHKERR getInterface(meshsets_manager_ptr);
718  CHKERR meshsets_manager_ptr->getTags(verb);
719 
720  // Series recorder
721  SeriesRecorder *series_recorder_ptr;
722  CHKERR getInterface(series_recorder_ptr);
723  CHKERR series_recorder_ptr->getTags(verb);
724 
726 }
727 
730  if (verb == -1)
731  verb = verbose;
732  CHKERR clearMap();
734 }
735 
738  if (verb == -1)
739  verb = verbose;
740  CHKERR this->clearMap();
741  CHKERR this->getTags(verb);
742  CHKERR this->initialiseDatabaseFromMesh(verb);
744 }
745 
747  return this->setMoabInterface(new_moab, verb);
748 };
749 
751  int verb) {
752  return this->setMoabInterface(new_moab, verb);
753 };
754 
757  if (verb == -1)
758  verb = verbose;
759 
760  CHKERR PetscOptionsBegin(mofemComm, optionsPrefix.c_str(), "Mesh cut options",
761  "See MoFEM documentation");
762 
763  CHKERR PetscOptionsBool(
764  "-mofem_init_fields", "Initialise fields on construction", "",
765  initaliseAndBuildField, &initaliseAndBuildField, NULL);
766 
767  CHKERR PetscOptionsBool(
768  "-mofem_init_fields", "Initialise fields on construction", "",
769  initaliseAndBuildFiniteElements, &initaliseAndBuildFiniteElements, NULL);
770 
771  // TODO: Add read verbosity level
772  // TODO: Add option to initalise problems ??? - DO WE REALLY NEED THAT
773 
774  ierr = PetscOptionsEnd();
775  CHKERRG(ierr);
776 
778 }
779 
780 // cubit meshsets
781 
784  *fields_ptr = &fIelds;
786 }
787 
789 Core::get_ref_ents(const RefEntity_multiIndex **refined_entities_ptr) const {
791  *refined_entities_ptr = &refinedEntities;
793 }
795  const RefElement_multiIndex **refined_finite_elements_ptr) const {
797  *refined_finite_elements_ptr = &refinedFiniteElements;
799 }
800 
801 MoFEMErrorCode Core::get_problem(const std::string &problem_name,
802  const Problem **problem_ptr) const {
805  const ProblemsByName &problems = pRoblems.get<Problem_mi_tag>();
806  ProblemsByName::iterator p_miit = problems.find(problem_name);
807  if (p_miit == problems.end()) {
808  SETERRQ1(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
809  "problem < %s > not found, (top tip: check spelling)",
810  problem_name.c_str());
811  }
812  *problem_ptr = &*p_miit;
814 }
815 
817 Core::get_problems(const Problem_multiIndex **problems_ptr) const {
819  *problems_ptr = &pRoblems;
821 }
822 
824 Core::get_field_ents(const FieldEntity_multiIndex **field_ents) const {
826  *field_ents = &entsFields;
828 }
831  *dofs_ptr = &dofsField;
833 }
834 
838  *fe_ptr = &finiteElements;
840 }
841 
843  const EntFiniteElement_multiIndex **fe_ent_ptr) const {
845  *fe_ent_ptr = &entsFiniteElements;
847 }
848 
850  MeshsetsManager *meshsets_manager_ptr;
851  getInterface(meshsets_manager_ptr);
852  return meshsets_manager_ptr;
853 }
854 
856  MeshsetsManager *meshsets_manager_ptr;
857  getInterface(meshsets_manager_ptr);
858  return meshsets_manager_ptr;
859 }
860 
863  *dofs_elements_adjacency) const {
865  *dofs_elements_adjacency = &entFEAdjacencies;
867 }
868 
871  return &entFEAdjacencies;
872 }
873 
874 const Field_multiIndex *Core::get_fields() const { return &fIelds; }
876  return &refinedEntities;
877 }
879  return &refinedFiniteElements;
880 }
882  return &finiteElements;
883 }
885  return &entsFiniteElements;
886 }
888  return &entsFields;
889 }
890 const DofEntity_multiIndex *Core::get_dofs() const { return &dofsField; }
891 const Problem *Core::get_problem(const std::string problem_name) const {
892  const Problem *prb;
893  CHK_THROW_MESSAGE(get_problem(problem_name, &prb),
894  "Problem of given name not found");
895  return prb;
896 }
897 const Problem_multiIndex *Core::get_problems() const { return &pRoblems; }
898 
899 template <int V, typename std::enable_if<(V >= 0), int>::type * = nullptr>
900 void set_ref_ent_basic_data_ptr_impl(boost::shared_ptr<BasicEntityData> &ptr) {
902 };
903 
904 template <int V, typename std::enable_if<(V < 0), int>::type * = nullptr>
905 void set_ref_ent_basic_data_ptr_impl(boost::shared_ptr<BasicEntityData> &ptr) {
906  return;
907 };
908 
909 void Core::setRefEntBasicDataPtr(MoFEM::Interface &m_field,
910  boost::shared_ptr<BasicEntityData> &ptr) {
911 
912  switch (m_field.getValue()) {
913  case -1:
914  set_ref_ent_basic_data_ptr_impl<-1>(ptr);
915  break;
916  case 0:
917  set_ref_ent_basic_data_ptr_impl<0>(ptr);
918  break;
919  case 1:
920  set_ref_ent_basic_data_ptr_impl<1>(ptr);
921  break;
922  default:
923  THROW_MESSAGE("Core index can vary from -1 to MAX_CORE_TMP");
924  }
925 };
926 
927 boost::shared_ptr<RefEntityTmp<0>>
928 Core::makeSharedRefEntity(MoFEM::Interface &m_field, const EntityHandle ent) {
929 
930  boost::shared_ptr<RefEntityTmp<0>> ref_ent_ptr;
931 
932  switch (m_field.getValue()) {
933  case -1:
934  ref_ent_ptr = boost::shared_ptr<RefEntityTmp<0>>(
935 
936  new RefEntityTmp<-1>(m_field.get_basic_entity_data_ptr(), ent)
937 
938  );
939  break;
940  case 0:
941  ref_ent_ptr = boost::shared_ptr<RefEntityTmp<0>>(
942 
943  new RefEntityTmp<0>(m_field.get_basic_entity_data_ptr(), ent)
944 
945  );
946  break;
947  case 1:
948  ref_ent_ptr = boost::shared_ptr<RefEntityTmp<0>>(
949 
950  new RefEntityTmp<1>(m_field.get_basic_entity_data_ptr(), ent)
951 
952  );
953  break;
954  default:
955  THROW_MESSAGE("Core index can vary from -1 to MAX_CORE_TMP");
956  }
957 
958  return ref_ent_ptr;
959 }
960 
961 boost::shared_ptr<RefEntityTmp<0>>
962 Core::make_shared_ref_entity(const EntityHandle ent) {
963  return this->makeSharedRefEntity(*this, ent);
964 }
965 
966 boost::shared_ptr<RefEntityTmp<0>>
968  return this->makeSharedRefEntity(*this, ent);
969 }
970 
971 } // namespace MoFEM
NOSPACE
@ NOSPACE
Definition: definitions.h:83
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
FieldEntityEntFiniteElementAdjacencyMap_multiIndex
multi_index_container< FieldEntityEntFiniteElementAdjacencyMap, indexed_by< ordered_unique< tag< Composite_Unique_mi_tag >, composite_key< FieldEntityEntFiniteElementAdjacencyMap, const_mem_fun< FieldEntityEntFiniteElementAdjacencyMap, UId, &FieldEntityEntFiniteElementAdjacencyMap::getEntUniqueId >, const_mem_fun< FieldEntityEntFiniteElementAdjacencyMap, UId, &FieldEntityEntFiniteElementAdjacencyMap::getFeUniqueId > > >, ordered_non_unique< tag< Unique_mi_tag >, const_mem_fun< FieldEntityEntFiniteElementAdjacencyMap, UId, &FieldEntityEntFiniteElementAdjacencyMap::getEntUniqueId > >, ordered_non_unique< tag< FE_Unique_mi_tag >, const_mem_fun< FieldEntityEntFiniteElementAdjacencyMap, UId, &FieldEntityEntFiniteElementAdjacencyMap::getFeUniqueId > >, ordered_non_unique< tag< FEEnt_mi_tag >, const_mem_fun< FieldEntityEntFiniteElementAdjacencyMap, EntityHandle, &FieldEntityEntFiniteElementAdjacencyMap::getFeHandle > >, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< FieldEntityEntFiniteElementAdjacencyMap, EntityHandle, &FieldEntityEntFiniteElementAdjacencyMap::getEntHandle > > > > FieldEntityEntFiniteElementAdjacencyMap_multiIndex
MultiIndex container keeps Adjacencies Element and dof entities adjacencies and vice versa.
Definition: AdjacencyMultiIndices.hpp:114
MoFEM::CoreTmp< 0 >::get_meshsets_manager_ptr
MeshsetsManager * get_meshsets_manager_ptr()
get MeshsetsManager pointer
Definition: Core.cpp:849
MoFEM::CoreTmp< 0 >::getOptions
MoFEMErrorCode getOptions(int verb=DEFAULT_VERBOSITY)
Get core options from command line.
Definition: Core.cpp:755
MoFEM::CoreTmp< 0 >::addPrismToDatabase
MoFEMErrorCode addPrismToDatabase(const EntityHandle prism, int verb=DEFAULT_VERBOSITY)
add prim element
Definition: Core.cpp:522
MoFEM::CoreTmp< 0 >::setMoabInterface
MoFEMErrorCode setMoabInterface(moab::Interface &new_moab, int verb=VERBOSE)
Definition: Core.cpp:433
MYPCOMM_INDEX
#define MYPCOMM_INDEX
default communicator number PCOMM
Definition: definitions.h:228
MoFEM::CoreTmp< 0 >
Core (interface) class.
Definition: Core.hpp:82
LASTBASE
@ LASTBASE
Definition: definitions.h:69
MoFEM::CoreTmp< 0 >::registerSubInterfaces
MoFEMErrorCode registerSubInterfaces()
Register insterfaces.
Definition: Core.cpp:463
MOFEM_LOG_CHANNEL
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
Definition: LogManager.hpp:284
EntityHandle
MoFEM::Problem_mi_tag
Definition: TagMultiIndices.hpp:70
MoFEM::CoreTmp< 0 >::get_problems
const Problem_multiIndex * get_problems() const
Get the problems object.
Definition: Core.cpp:897
convert.args
args
Definition: convert.py:66
CHK_THROW_MESSAGE
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
Definition: definitions.h:609
MoFEM::SeriesRecorder
Definition: SeriesRecorder.hpp:25
MoFEM::CoreTmp< 0 >::set_moab_interface
MoFEMErrorCode set_moab_interface(moab::Interface &new_moab, int verb=VERBOSE)
Set the moab interface object.
Definition: Core.cpp:746
MoFEM::RefElement_multiIndex
multi_index_container< boost::shared_ptr< RefElement >, indexed_by< ordered_unique< tag< Ent_mi_tag >, const_mem_fun< RefElement::interface_type_RefEntity, EntityHandle, &RefElement::getEnt > > > > RefElement_multiIndex
Definition: RefElementMultiIndices.hpp:180
help
static char help[]
Definition: activate_deactivate_dofs.cpp:13
MoFEM::Types::BitProblemId
std::bitset< BITPROBLEMID_SIZE > BitProblemId
Problem Id.
Definition: Types.hpp:44
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
mofem_error_handler
static PetscErrorCode mofem_error_handler(MPI_Comm comm, int line, const char *fun, const char *file, PetscErrorCode n, PetscErrorType p, const char *mess, void *ctx)
Definition: ErrorHandler.cpp:6
LASTCONTINUITY
@ LASTCONTINUITY
Definition: definitions.h:102
VERY_NOISY
@ VERY_NOISY
Definition: definitions.h:225
MoFEM::Types::BitFieldId
std::bitset< BITFIELDID_SIZE > BitFieldId
Field Id.
Definition: Types.hpp:42
MoFEM.hpp
MOFEM_SUCCESS
@ MOFEM_SUCCESS
Definition: definitions.h:30
MoFEM::CoreTmp< 0 >::Finalize
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition: Core.cpp:112
MoFEM::CoreTmp< 0 >::clearMap
MoFEMErrorCode clearMap()
Cleaning database.
Definition: Core.cpp:503
MoFEM::RefEntity_multiIndex
multi_index_container< boost::shared_ptr< RefEntity >, indexed_by< ordered_unique< tag< Ent_mi_tag >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getEnt > >, ordered_non_unique< tag< Ent_Ent_mi_tag >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getParentEnt > >, ordered_non_unique< tag< Composite_EntType_and_ParentEntType_mi_tag >, composite_key< RefEntity, const_mem_fun< RefEntity, EntityType, &RefEntity::getEntType >, const_mem_fun< RefEntity, EntityType, &RefEntity::getParentEntType > > >, ordered_non_unique< tag< Composite_ParentEnt_And_EntType_mi_tag >, composite_key< RefEntity, const_mem_fun< RefEntity, EntityType, &RefEntity::getEntType >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getParentEnt > > > > > RefEntity_multiIndex
Definition: RefEntsMultiIndices.hpp:760
MoFEM::Types::BitFEId
std::bitset< BITFEID_SIZE > BitFEId
Finite element Id.
Definition: Types.hpp:43
THROW_MESSAGE
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
Definition: definitions.h:574
MoFEM::LogManager::logPetscFPrintf
static PetscErrorCode logPetscFPrintf(FILE *fd, const char format[], va_list Argp)
Use to handle PETSc output.
Definition: LogManager.cpp:411
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
MoFEM::BitRefManager::fixTagSize
static MoFEMErrorCode fixTagSize(moab::Interface &moab, bool *changed=nullptr)
Fix tag size when BITREFLEVEL_SIZE of core library is different than file BITREFLEVEL_SIZE.
Definition: BitRefManager.cpp:1232
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:2010
MoFEM::MeshsetsManager::initialiseDatabaseFromMesh
MoFEMErrorCode initialiseDatabaseFromMesh(int verb=DEFAULT_VERBOSITY)
Definition: MeshsetsManager.cpp:65
FieldSpace
FieldSpace
approximation spaces
Definition: definitions.h:82
MoFEM::Exceptions::rval
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:74
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
MoFEM
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
MoFEM::CoreTmp< 0 >::regEvents
MoFEMErrorCode regEvents()
Register petsc events.
Definition: Core.cpp:184
MoFEM::CoreTmp::CoreTmp
CoreTmp(moab::Interface &moab, MPI_Comm comm=PETSC_COMM_WORLD, const int verbose=VERBOSE)
Definition: CoreTemplates.hpp:48
MoFEM::CoreTmp< 0 >::query_interface
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Getting interface of core database.
Definition: Core.cpp:43
FieldContinuity
FieldContinuity
Field continuity.
Definition: definitions.h:99
MOFEM_LOG_C
#define MOFEM_LOG_C(channel, severity, format,...)
Definition: LogManager.hpp:311
MoFEM::CoreTmp
Definition: Core.hpp:36
MoFEM::CoreTmp< 0 >::mpiInitialised
static int mpiInitialised
mpi was initialised by other agent
Definition: Core.hpp:1057
convert.type
type
Definition: convert.py:64
MoFEM::CoreTmp< 0 >::regSubInterface
MoFEMErrorCode regSubInterface()
Register sub-interfaces in core interface.
Definition: Core.cpp:166
MoFEM::Version
Definition: UnknownInterface.hpp:12
MoFEM::CoreTmp< 0 >::get_ref_finite_elements
const RefElement_multiIndex * get_ref_finite_elements() const
Get the ref finite elements object.
Definition: Core.cpp:878
MoFEM::CoreTmp< 0 >::isGloballyInitialised
static bool isGloballyInitialised
Core base globally initialized.
Definition: Core.hpp:1056
macro_is_deprecated_using_deprecated_function
void macro_is_deprecated_using_deprecated_function()
Is used to indicate that macro is deprecated Do nothing just triggers error at the compilation.
Definition: Core.cpp:11
LASTSPACE
@ LASTSPACE
FieldSpace in [ 0, LASTSPACE )
Definition: definitions.h:89
MoFEM::WrapMPIComm::duplicatedComm
MPI_Comm duplicatedComm
Definition: Core.hpp:27
MoFEM::CoreTmp< 0 >::get_finite_elements
const FiniteElement_multiIndex * get_finite_elements() const
Get the finite elements object.
Definition: Core.cpp:881
ErrorHandler.cpp
MoFEM::CoreTmp< 0 >::isInitialized
static PetscBool isInitialized
petsc was initialised by other agent
Definition: Core.hpp:1058
MoFEM::CoreTmp< 0 >::~CoreTmp
~CoreTmp()
Definition: Core.cpp:283
MoFEM::LogManager::getOptions
static MoFEMErrorCode getOptions()
Get logger option.
Definition: LogManager.cpp:152
MOFEM_OPERATION_UNSUCCESSFUL
@ MOFEM_OPERATION_UNSUCCESSFUL
Definition: definitions.h:34
MoFEM::WrapMPIComm::WrapMPIComm
WrapMPIComm(MPI_Comm comm, bool petsc)
Definition: Core.cpp:16
MoFEM::FieldEntity_multiIndex
multi_index_container< boost::shared_ptr< FieldEntity >, indexed_by< ordered_unique< tag< Unique_mi_tag >, member< FieldEntity, UId, &FieldEntity::localUId > >, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< FieldEntity::interface_type_RefEntity, EntityHandle, &FieldEntity::getEnt > > > > FieldEntity_multiIndex
Definition: FieldEntsMultiIndices.hpp:489
MoFEM::FiniteElement
Finite element definition.
Definition: FEMultiIndices.hpp:26
Problem_multiIndex
multi_index_container< Problem, indexed_by< ordered_unique< tag< Meshset_mi_tag >, member< Problem, EntityHandle, &Problem::meshset > >, hashed_unique< tag< BitProblemId_mi_tag >, const_mem_fun< Problem, BitProblemId, &Problem::getId >, HashBit< BitProblemId >, EqBit< BitProblemId > >, hashed_unique< tag< Problem_mi_tag >, const_mem_fun< Problem, std::string, &Problem::getName > > > > Problem_multiIndex
MultiIndex for entities for Problem.
Definition: ProblemsMultiIndices.hpp:657
MoFEM::CoreTmp< 0 >::CoreTmp
CoreTmp(moab::Interface &moab, MPI_Comm comm=PETSC_COMM_WORLD, const int verbose=VERBOSE)
Definition: Core.cpp:235
MoFEM::WrapMPIComm::comm
MPI_Comm comm
Definition: Core.hpp:26
MoFEM::MeshsetsManager::getTags
MoFEMErrorCode getTags(int verb=-1)
get tags handlers used on meshsets
Definition: MeshsetsManager.cpp:247
MoFEM::UnknownInterface
base class for all interface classes
Definition: UnknownInterface.hpp:34
MoFEM::SeriesRecorder::initialiseDatabaseFromMesh
MoFEMErrorCode initialiseDatabaseFromMesh(int verb=0)
Definition: SeriesRecorder.cpp:47
MoFEM::set_ref_ent_basic_data_ptr_impl
void set_ref_ent_basic_data_ptr_impl(boost::shared_ptr< BasicEntityData > &ptr)
Definition: Core.cpp:900
MoFEM::CoreValue
Definition: Core.hpp:34
Range
MoFEM::CoreTmp< 0 >::Initialize
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
Definition: Core.cpp:72
MOFEM_LOG
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:308
MoFEM::CoreTmp< 0 >::get_problem
MoFEMErrorCode get_problem(const std::string &problem_name, const Problem **problem_ptr) const
Get problem database (data structure)
Definition: Core.cpp:801
MoFEM::RefElement_PRISM
keeps data about abstract PRISM finite element
Definition: RefElementMultiIndices.hpp:66
MoFEM::CoreTmp< 0 >::get_ents_elements_adjacency
const FieldEntityEntFiniteElementAdjacencyMap_multiIndex * get_ents_elements_adjacency() const
Get the dofs elements adjacency object.
Definition: Core.cpp:870
MoFEM::CoreTmp< 0 >::getTags
MoFEMErrorCode getTags(int verb=DEFAULT_VERBOSITY)
Get tag handles.
Definition: Core.cpp:551
Field_multiIndex
multi_index_container< boost::shared_ptr< Field >, indexed_by< hashed_unique< tag< BitFieldId_mi_tag >, const_mem_fun< Field, const BitFieldId &, &Field::getId >, HashBit< BitFieldId >, EqBit< BitFieldId > >, ordered_unique< tag< Meshset_mi_tag >, member< Field, EntityHandle, &Field::meshSet > >, ordered_unique< tag< FieldName_mi_tag >, const_mem_fun< Field, boost::string_ref, &Field::getNameRef > >, ordered_non_unique< tag< BitFieldId_space_mi_tag >, const_mem_fun< Field, FieldSpace, &Field::getSpace > > > > Field_multiIndex
Field_multiIndex for Field.
Definition: FieldMultiIndices.hpp:508
MoFEM::CoreTmp< 0 >::get_ents_finite_elements
const EntFiniteElement_multiIndex * get_ents_finite_elements() const
Get the ents finite elements object.
Definition: Core.cpp:884
MoFEM::Types::BitRefEdges
std::bitset< BITREFEDGES_SIZE > BitRefEdges
Definition: Types.hpp:34
MoFEM::WrapMPIComm::~WrapMPIComm
~WrapMPIComm()
Definition: Core.cpp:28
MoFEM::Exceptions::ierr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76
MoFEM::CoreTmp< 0 >::get_field_ents
const FieldEntity_multiIndex * get_field_ents() const
Get the field ents object.
Definition: Core.cpp:887
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
MoFEM::CoreTmp< 0 >::coreGenericConstructor
MoFEMErrorCode coreGenericConstructor(moab::Interface &moab, MPI_Comm comm, const int verbose)
Definition: Core.cpp:197
MoFEM::SeriesRecorder::getTags
MoFEMErrorCode getTags(int verb=-1)
get tags handlers used on meshsets
Definition: SeriesRecorder.cpp:28
MoFEM::MeshsetsManager
Interface for managing meshsets containing materials and boundary conditions.
Definition: MeshsetsManager.hpp:104
MoFEM::LogManager::createDefaultSinks
static void createDefaultSinks(MPI_Comm comm)
Create default sinks.
Definition: LogManager.cpp:313
MoFEM::CoreTmp< 0 >::get_dofs
const DofEntity_multiIndex * get_dofs() const
Get the dofs object.
Definition: Core.cpp:890
MoFEM::WrapMPIComm::isPetscComm
bool isPetscComm
Definition: Core.hpp:28
FieldApproximationBase
FieldApproximationBase
approximation base
Definition: definitions.h:58
MoFEM::CoreTmp< 0 >::clear_database
MoFEMErrorCode clear_database(int verb=DEFAULT_VERBOSITY)
Clear database.
Definition: Core.cpp:728
MoFEM::CoreTmp::set_moab_interface
MoFEMErrorCode set_moab_interface(moab::Interface &new_moab, int verb)
Definition: CoreTemplates.hpp:20
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::CoreTmp< 0 >::rebuild_database
MoFEMErrorCode rebuild_database(int verb=DEFAULT_VERBOSITY)
Clear database and initialize it once again.
Definition: Core.cpp:736
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:453
QUIET
@ QUIET
Definition: definitions.h:221
MoFEM::Problem
keeps basic data about problem
Definition: ProblemsMultiIndices.hpp:54
MoFEM::CoreInterface
Interface.
Definition: Interface.hpp:27
DofEntity_multiIndex
multi_index_container< boost::shared_ptr< DofEntity >, indexed_by< ordered_unique< tag< Unique_mi_tag >, const_mem_fun< DofEntity, UId, &DofEntity::getLocalUniqueId > >, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< DofEntity, EntityHandle, &DofEntity::getEnt > > > > DofEntity_multiIndex
MultiIndex container keeps DofEntity.
Definition: DofsMultiIndices.hpp:317
MoFEM::CoreTmp< 0 >::get_fields
const Field_multiIndex * get_fields() const
Get the fields object.
Definition: Core.cpp:874
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEM::get_sub_iface_options_imp
static auto get_sub_iface_options_imp(T *const ptr, int) -> decltype(ptr->getSubInterfaceOptions())
Definition: Core.cpp:138
MoFEM::RefEntityTmp
Definition: RefEntsMultiIndices.hpp:118
EntFiniteElement_multiIndex
multi_index_container< boost::shared_ptr< EntFiniteElement >, indexed_by< ordered_unique< tag< Unique_mi_tag >, const_mem_fun< EntFiniteElement, UId, &EntFiniteElement::getLocalUniqueId > >, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< EntFiniteElement::interface_type_RefEntity, EntityHandle, &EntFiniteElement::getEnt > > > > EntFiniteElement_multiIndex
MultiIndex container for EntFiniteElement.
Definition: FEMultiIndices.hpp:800
CHKERRG
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:496
MoFEM::CoreTmp< 0 >::get_ref_ents
const RefEntity_multiIndex * get_ref_ents() const
Get the ref ents object.
Definition: Core.cpp:875
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
MoFEM::CoreTmp< 0 >::initialiseDatabaseFromMesh
MoFEMErrorCode initialiseDatabaseFromMesh(int verb=DEFAULT_VERBOSITY)
Initialize database getting information on mesh.
Definition: Core.cpp:294
MoFEM::get_event_options_imp
static auto get_event_options_imp(T *const ptr, int) -> decltype(ptr->getEventOptions())
Definition: Core.cpp:151
MoFEM::Types::DofIdx
int DofIdx
Index of DOF.
Definition: Types.hpp:18