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  FieldApproximationBase def_base = LASTBASE;
636  CHKERR get_moab().tag_get_handle(
637  "_FieldBase", sizeof(FieldApproximationBase), MB_TYPE_OPAQUE,
638  th_FieldBase, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_base);
639  const int def_val_len = 0;
640  CHKERR get_moab().tag_get_handle(
641  "_FieldName", def_val_len, MB_TYPE_OPAQUE, th_FieldName,
642  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
643  CHKERR get_moab().tag_get_handle(
644  "_FieldName_DataNamePrefix", def_val_len, MB_TYPE_OPAQUE,
645  th_FieldName_DataNamePrefix,
646  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
647  }
648 
649  // Tags FE
650  {
651  const unsigned long int def_id = 0;
652  const int def_val_len = 0;
653  CHKERR get_moab().tag_get_handle(
654  "_FEId", sizeof(BitFEId), MB_TYPE_OPAQUE, th_FEId,
655  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
656  CHKERR get_moab().tag_get_handle(
657  "_FEName", def_val_len, MB_TYPE_OPAQUE, th_FEName,
658  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
659  CHKERR get_moab().tag_get_handle(
660  "_FEIdCol", sizeof(BitFieldId), MB_TYPE_OPAQUE, th_FEIdCol,
661  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
662  CHKERR get_moab().tag_get_handle(
663  "_FEIdRow", sizeof(BitFieldId), MB_TYPE_OPAQUE, th_FEIdRow,
664  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
665  CHKERR get_moab().tag_get_handle(
666  "_FEIdData", sizeof(BitFieldId), MB_TYPE_OPAQUE, th_FEIdData,
667  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
668  }
669 
670  // Tags Problem
671  {
672  const unsigned long int def_id = 0;
673  const int def_val_len = 0;
674  CHKERR get_moab().tag_get_handle(
675  "_ProblemId", sizeof(BitProblemId), MB_TYPE_OPAQUE, th_ProblemId,
676  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
677  CHKERR get_moab().tag_get_handle(
678  "_ProblemFEId", sizeof(BitFEId), MB_TYPE_OPAQUE, th_ProblemFEId,
679  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
680  CHKERR get_moab().tag_get_handle(
681  "_ProblemName", def_val_len, MB_TYPE_OPAQUE, th_ProblemName,
682  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
683  DofIdx def_nbdofs = 0;
684  CHKERR get_moab().tag_get_handle(
685  "_ProblemNbDofsRow", sizeof(DofIdx), MB_TYPE_OPAQUE,
686  th_ProblemNbDofsRow, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
687  &def_nbdofs);
688  CHKERR get_moab().tag_get_handle(
689  "_ProblemNbDofsCol", sizeof(DofIdx), MB_TYPE_OPAQUE,
690  th_ProblemNbDofsCol, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
691  &def_nbdofs);
692  CHKERR get_moab().tag_get_handle(
693  "_ProblemLocalNbDofsRow", sizeof(DofIdx), MB_TYPE_OPAQUE,
694  th_ProblemLocalNbDofRow, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
695  &def_nbdofs);
696  CHKERR get_moab().tag_get_handle(
697  "_ProblemGhostNbDofsRow", sizeof(DofIdx), MB_TYPE_OPAQUE,
698  th_ProblemGhostNbDofRow, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
699  &def_nbdofs);
700  CHKERR get_moab().tag_get_handle(
701  "_ProblemLocalNbDofsCol", sizeof(DofIdx), MB_TYPE_OPAQUE,
702  th_ProblemLocalNbDofCol, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
703  &def_nbdofs);
704  CHKERR get_moab().tag_get_handle(
705  "_ProblemGhostNbDofsCol", sizeof(DofIdx), MB_TYPE_OPAQUE,
706  th_ProblemGhostNbDofCol, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
707  &def_nbdofs);
708  }
709 
710  // Meshsets with boundary conditions and material sets
711  MeshsetsManager *meshsets_manager_ptr;
712  CHKERR getInterface(meshsets_manager_ptr);
713  CHKERR meshsets_manager_ptr->getTags(verb);
714 
715  // Series recorder
716  SeriesRecorder *series_recorder_ptr;
717  CHKERR getInterface(series_recorder_ptr);
718  CHKERR series_recorder_ptr->getTags(verb);
719 
721 }
722 
725  if (verb == -1)
726  verb = verbose;
727  CHKERR clearMap();
729 }
730 
733  if (verb == -1)
734  verb = verbose;
735  CHKERR this->clearMap();
736  CHKERR this->getTags(verb);
737  CHKERR this->initialiseDatabaseFromMesh(verb);
739 }
740 
742  return this->setMoabInterface(new_moab, verb);
743 };
744 
746  int verb) {
747  return this->setMoabInterface(new_moab, verb);
748 };
749 
752  if (verb == -1)
753  verb = verbose;
754 
755  CHKERR PetscOptionsBegin(mofemComm, optionsPrefix.c_str(), "Mesh cut options",
756  "See MoFEM documentation");
757 
758  CHKERR PetscOptionsBool(
759  "-mofem_init_fields", "Initialise fields on construction", "",
760  initaliseAndBuildField, &initaliseAndBuildField, NULL);
761 
762  CHKERR PetscOptionsBool(
763  "-mofem_init_fields", "Initialise fields on construction", "",
764  initaliseAndBuildFiniteElements, &initaliseAndBuildFiniteElements, NULL);
765 
766  // TODO: Add read verbosity level
767  // TODO: Add option to initalise problems ??? - DO WE REALLY NEED THAT
768 
769  ierr = PetscOptionsEnd();
770  CHKERRG(ierr);
771 
773 }
774 
775 // cubit meshsets
776 
779  *fields_ptr = &fIelds;
781 }
782 
784 Core::get_ref_ents(const RefEntity_multiIndex **refined_entities_ptr) const {
786  *refined_entities_ptr = &refinedEntities;
788 }
790  const RefElement_multiIndex **refined_finite_elements_ptr) const {
792  *refined_finite_elements_ptr = &refinedFiniteElements;
794 }
795 
796 MoFEMErrorCode Core::get_problem(const std::string &problem_name,
797  const Problem **problem_ptr) const {
800  const ProblemsByName &problems = pRoblems.get<Problem_mi_tag>();
801  ProblemsByName::iterator p_miit = problems.find(problem_name);
802  if (p_miit == problems.end()) {
803  SETERRQ1(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
804  "problem < %s > not found, (top tip: check spelling)",
805  problem_name.c_str());
806  }
807  *problem_ptr = &*p_miit;
809 }
810 
812 Core::get_problems(const Problem_multiIndex **problems_ptr) const {
814  *problems_ptr = &pRoblems;
816 }
817 
819 Core::get_field_ents(const FieldEntity_multiIndex **field_ents) const {
821  *field_ents = &entsFields;
823 }
826  *dofs_ptr = &dofsField;
828 }
829 
833  *fe_ptr = &finiteElements;
835 }
836 
838  const EntFiniteElement_multiIndex **fe_ent_ptr) const {
840  *fe_ent_ptr = &entsFiniteElements;
842 }
843 
845  MeshsetsManager *meshsets_manager_ptr;
846  getInterface(meshsets_manager_ptr);
847  return meshsets_manager_ptr;
848 }
849 
851  MeshsetsManager *meshsets_manager_ptr;
852  getInterface(meshsets_manager_ptr);
853  return meshsets_manager_ptr;
854 }
855 
858  *dofs_elements_adjacency) const {
860  *dofs_elements_adjacency = &entFEAdjacencies;
862 }
863 
866  return &entFEAdjacencies;
867 }
868 
869 const Field_multiIndex *Core::get_fields() const { return &fIelds; }
871  return &refinedEntities;
872 }
874  return &refinedFiniteElements;
875 }
877  return &finiteElements;
878 }
880  return &entsFiniteElements;
881 }
883  return &entsFields;
884 }
885 const DofEntity_multiIndex *Core::get_dofs() const { return &dofsField; }
886 const Problem *Core::get_problem(const std::string problem_name) const {
887  const Problem *prb;
888  CHK_THROW_MESSAGE(get_problem(problem_name, &prb),
889  "Problem of given name not found");
890  return prb;
891 }
892 const Problem_multiIndex *Core::get_problems() const { return &pRoblems; }
893 
894 template <int V, typename std::enable_if<(V >= 0), int>::type * = nullptr>
895 void set_ref_ent_basic_data_ptr_impl(boost::shared_ptr<BasicEntityData> &ptr) {
897 };
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) {
901  return;
902 };
903 
904 void Core::setRefEntBasicDataPtr(MoFEM::Interface &m_field,
905  boost::shared_ptr<BasicEntityData> &ptr) {
906 
907  switch (m_field.getValue()) {
908  case -1:
909  set_ref_ent_basic_data_ptr_impl<-1>(ptr);
910  break;
911  case 0:
912  set_ref_ent_basic_data_ptr_impl<0>(ptr);
913  break;
914  case 1:
915  set_ref_ent_basic_data_ptr_impl<1>(ptr);
916  break;
917  default:
918  THROW_MESSAGE("Core index can vary from -1 to MAX_CORE_TMP");
919  }
920 };
921 
922 boost::shared_ptr<RefEntityTmp<0>>
923 Core::makeSharedRefEntity(MoFEM::Interface &m_field, const EntityHandle ent) {
924 
925  boost::shared_ptr<RefEntityTmp<0>> ref_ent_ptr;
926 
927  switch (m_field.getValue()) {
928  case -1:
929  ref_ent_ptr = boost::shared_ptr<RefEntityTmp<0>>(
930 
931  new RefEntityTmp<-1>(m_field.get_basic_entity_data_ptr(), ent)
932 
933  );
934  break;
935  case 0:
936  ref_ent_ptr = boost::shared_ptr<RefEntityTmp<0>>(
937 
938  new RefEntityTmp<0>(m_field.get_basic_entity_data_ptr(), ent)
939 
940  );
941  break;
942  case 1:
943  ref_ent_ptr = boost::shared_ptr<RefEntityTmp<0>>(
944 
945  new RefEntityTmp<1>(m_field.get_basic_entity_data_ptr(), ent)
946 
947  );
948  break;
949  default:
950  THROW_MESSAGE("Core index can vary from -1 to MAX_CORE_TMP");
951  }
952 
953  return ref_ent_ptr;
954 }
955 
956 boost::shared_ptr<RefEntityTmp<0>>
957 Core::make_shared_ref_entity(const EntityHandle ent) {
958  return this->makeSharedRefEntity(*this, ent);
959 }
960 
961 boost::shared_ptr<RefEntityTmp<0>>
963  return this->makeSharedRefEntity(*this, ent);
964 }
965 
966 } // 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:447
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:844
MoFEM::CoreTmp< 0 >::getOptions
MoFEMErrorCode getOptions(int verb=DEFAULT_VERBOSITY)
Get core options from command line.
Definition: Core.cpp:750
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:215
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:892
convert.args
args
Definition: convert.py:66
CHK_THROW_MESSAGE
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
Definition: definitions.h:596
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:741
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
VERY_NOISY
@ VERY_NOISY
Definition: definitions.h:212
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:561
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:1975
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:535
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
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:1011
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:873
MoFEM::CoreTmp< 0 >::isGloballyInitialised
static bool isGloballyInitialised
Core base globally initialized.
Definition: Core.hpp:1010
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:876
ErrorHandler.cpp
MoFEM::CoreTmp< 0 >::isInitialized
static PetscBool isInitialized
petsc was initialised by other agent
Definition: Core.hpp:1012
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:653
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:244
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:895
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:796
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:865
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:467
MoFEM::CoreTmp< 0 >::get_ents_finite_elements
const EntFiniteElement_multiIndex * get_ents_finite_elements() const
Get the ents finite elements object.
Definition: Core.cpp:879
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:882
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:885
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:723
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:731
MoFEM::Types::BitRefLevel
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:40
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440
QUIET
@ QUIET
Definition: definitions.h:208
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:869
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
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:483
MoFEM::CoreTmp< 0 >::get_ref_ents
const RefEntity_multiIndex * get_ref_ents() const
Get the ref ents object.
Definition: Core.cpp:870
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
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