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