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