v0.9.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 extern "C" {
21 }
22 
23 namespace MoFEM {
24 
26  UnknownInterface **iface) const {
28  *iface = NULL;
29  if (uuid == IDD_MOFEMCoreInterface) {
30  *iface = static_cast<CoreInterface *>(const_cast<Core *>(this));
32  } else if (uuid == IDD_MOFEMDeprecatedCoreInterface) {
33  *iface = static_cast<DeprecatedCoreInterface *>(const_cast<Core *>(this));
35  }
36  // Get sub-interface
37  unsigned long int id = uuid.uUId.to_ulong();
38  boost::ptr_map<unsigned long, UnknownInterface>::iterator it;
39  it = iFaces.find(id);
40  if (it != iFaces.end()) {
41  *iface = it->second;
43  }
44  *iface = NULL;
45  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "unknown interface");
47 }
48 
49 bool Core::isGloballyInitialised = false;
50 
51 MoFEMErrorCode Core::Initialize(int *argc, char ***args, const char file[],
52  const char help[]) {
53  ierr = PetscInitialize(argc, args, file, help);
54  CHKERRG(ierr);
55  ierr = PetscPushErrorHandler(mofem_error_handler, PETSC_NULL);
56  CHKERRG(ierr);
57  isGloballyInitialised = true;
58  return MOFEM_SUCCESS;
59 }
60 
62  CHKERRQ(ierr);
63  ierr = PetscPopErrorHandler();
64  CHKERRG(ierr);
65  isGloballyInitialised = false;
66  return PetscFinalize();
67 }
68 
69 // Use SFINAE to decide which template should be run,
70 // if exist getSubInterfaceOptions run this one.
71 template <class T>
72 static auto get_sub_iface_options_imp(T *const ptr, int)
73  -> decltype(ptr->getSubInterfaceOptions()) {
74  return ptr->getSubInterfaceOptions();
75 };
76 
77 // Use SFINAE to decide which template should be run,
78 // if getSubInterfaceOptions not exist run this one.
79 template <class T>
80 static auto get_sub_iface_options_imp(T *const ptr, long) -> MoFEMErrorCode {
81  return 0;
82 };
83 
84 template <class IFACE>
87  CHKERR registerInterface<IFACE>(uid, false);
88  unsigned long int id = uid.uUId.to_ulong();
89  IFACE *ptr = new IFACE(*this);
90 
91  // If sub interface has function getSubInterfaceOptions run
92  // it after construction. getSubInterfaceOptions is used to
93  // get parameters from command line.
94  // See SFINAE:
95  // https://stackoverflow.com/questions/257288/is-it-possible-to-write-a-template-to-check-for-a-functions-existence
96  // https://en.wikipedia.org/wiki/Substitution_failure_is_not_an_error
97  auto get_sub_iface_options = [](auto *const ptr) {
98  return get_sub_iface_options_imp(ptr, 0);
99  };
100  CHKERR get_sub_iface_options(ptr);
101 
102  iFaces.insert(id, ptr);
104 }
105 
106 Core::Core(moab::Interface &moab, MPI_Comm comm, const int verbose,
107  const bool distributed_mesh)
108  : moab(moab), cOmm(0), verbose(verbose),
109  initaliseAndBuildField(PETSC_FALSE),
110  initaliseAndBuildFiniteElements(PETSC_FALSE) {
111 
112  // This is deprecated ONE should use MoFEM::Core::Initialize
113  if (!isGloballyInitialised) {
114  PetscPushErrorHandler(mofem_error_handler, PETSC_NULL);
115  isGloballyInitialised = true;
116  }
117 
118  // Create duplicate communicator
119  wrapMPIComm = boost::make_shared<WrapMPIComm>(comm, cOmm);
120  MPI_Comm_size(cOmm, &sIze);
121  MPI_Comm_rank(cOmm, &rAnk);
122  // CHeck if moab has set communicator if not set communicator interbally
123  ParallelComm *pComm = ParallelComm::get_pcomm(&moab, MYPCOMM_INDEX);
124  if (pComm == NULL) {
125  pComm = new ParallelComm(&moab, cOmm);
126  }
127 
128  // Register interfaces for this implementation
129  ierr = registerInterface<UnknownInterface>(IDD_MOFEMUnknown);
130  CHKERRABORT(comm, ierr);
131  ierr = registerInterface<CoreInterface>(IDD_MOFEMCoreInterface);
132  CHKERRABORT(comm, ierr);
133  ierr = registerInterface<DeprecatedCoreInterface>(
135  CHKERRABORT(comm, ierr);
136 
137  // Register sub-interfaces
139  CHKERRABORT(PETSC_COMM_SELF, ierr);
140 
141  // Register MOFEM events in PETSc
142  PetscLogEventRegister("FE_preProcess", 0, &MOFEM_EVENT_preProcess);
143  PetscLogEventRegister("FE_operator", 0, &MOFEM_EVENT_operator);
144  PetscLogEventRegister("FE_postProcess", 0, &MOFEM_EVENT_postProcess);
145  PetscLogEventRegister("MoFEMCreateMat", 0, &MOFEM_EVENT_createMat);
146 
147  // Initialize database
148  ierr = getTags();
149  CHKERRABORT(cOmm, ierr);
150  ierr = clearMap();
151  CHKERRABORT(cOmm, ierr);
152 
153  basicEntityDataPtr = boost::make_shared<BasicEntityData>(moab);
154  if (distributed_mesh)
155  basicEntityDataPtr->setDistributedMesh();
156  else
157  basicEntityDataPtr->unSetDistributedMesh();
158 
160  CHKERRABORT(cOmm, ierr);
162  CHKERRABORT(cOmm, ierr);
163 
164  // Print version
165  if (verbose > QUIET) {
166  char petsc_version[255];
167  ierr = PetscGetVersion(petsc_version, 255);
168  CHKERRABORT(cOmm, ierr);
169  ierr = PetscPrintf(cOmm, "MoFEM version %d.%d.%d (%s %s) \n",
170  MoFEM_VERSION_MAJOR, MoFEM_VERSION_MINOR,
171  MoFEM_VERSION_BUILD, MOAB_VERSION_STRING, petsc_version);
172  CHKERRABORT(cOmm, ierr);
173  ierr = PetscPrintf(cOmm, "git commit id %s\n", GIT_SHA1_NAME);
174  CHKERRABORT(cOmm, ierr);
175  }
176 }
177 
179  PetscBool is_finalized;
180  PetscFinalized(&is_finalized);
181  // Destroy interfaces
182  iFaces.clear();
183  // This is deprecated ONE should use MoFEM::Core::Initialize
184  if (isGloballyInitialised && is_finalized) {
185  isGloballyInitialised = false;
186  }
187 }
188 
191 
192  iFaces.clear();
193 
194  // Register sub interfaces
195  CHKERR regSubInterface<Simple>(IDD_MOFEMSimple);
196  CHKERR regSubInterface<Basic>(IDD_MOFEMBasic);
197  CHKERR regSubInterface<ProblemsManager>(IDD_MOFEMProblemsManager);
198  CHKERR regSubInterface<MatrixManager>(IDD_MOFEMMatrixManager);
199  CHKERR regSubInterface<ISManager>(IDD_MOFEMISManager);
200  CHKERR regSubInterface<VecManager>(IDD_MOFEMVEC);
201  CHKERR regSubInterface<FieldBlas>(IDD_MOFEMFieldBlas);
202  CHKERR regSubInterface<BitRefManager>(IDD_MOFEMBitRefManager);
203  CHKERR regSubInterface<Tools>(IDD_MOFEMTools);
204  CHKERR regSubInterface<CommInterface>(IDD_MOFEMComm);
205  CHKERR regSubInterface<MeshsetsManager>(IDD_MOFEMMeshsetsManager);
206  CHKERR regSubInterface<CoordSystemsManager>(IDD_MOFEMCoordsSystemsManager);
207  CHKERR regSubInterface<NodeMergerInterface>(IDD_MOFEMNodeMerger);
208  CHKERR regSubInterface<BitLevelCoupler>(IDD_MOFEMBitLevelCoupler);
209  CHKERR regSubInterface<PrismsFromSurfaceInterface>(
211  CHKERR regSubInterface<MeshRefinement>(IDD_MOFEMMeshRefine);
212  CHKERR regSubInterface<PrismInterface>(IDD_MOFEMPrismInterface);
213  CHKERR regSubInterface<CutMeshInterface>(IDD_MOFEMCutMesh);
214  CHKERR regSubInterface<SeriesRecorder>(IDD_MOFEMSeriesRecorder);
215 #ifdef WITH_TETGEN
216  CHKERR regSubInterface<TetGenInterface>(IDD_MOFEMTetGegInterface);
217 #endif
218 #ifdef WITH_MED
219  CHKERR regSubInterface<MedInterface>(IDD_MOFEMMedInterface);
220 #endif
221  CHKERR regSubInterface<FieldEvaluatorInterface>(IDD_MOFEMFieldEvaluator);
222 
224 };
225 
227  if (*fShift >= BITFIELDID_SIZE) {
228  char msg[] = "number of fields exceeded";
229  PetscTraceBackErrorHandler(cOmm, __LINE__, PETSC_FUNCTION_NAME, __FILE__,
230  MOFEM_DATA_INCONSISTENCY, PETSC_ERROR_INITIAL,
231  msg, PETSC_NULL);
232  PetscMPIAbortErrorHandler(cOmm, __LINE__, PETSC_FUNCTION_NAME, __FILE__,
233  MOFEM_DATA_INCONSISTENCY, PETSC_ERROR_INITIAL,
234  msg, PETSC_NULL);
235  }
236  return BitFieldId().set(((*fShift)++) - 1);
237 }
239  assert((unsigned int)*feShift < BitFEId().set().to_ulong());
240  return BitFEId(1 << (((*feShift)++) - 1));
241 }
242 
244  assert((unsigned int)*pShift < BitProblemId().set().to_ulong());
245  return BitProblemId(1 << (((*pShift)++) - 1));
246 }
247 
250  // Cleaning databases in interfaces
251  CHKERR getInterface<SeriesRecorder>()->clearMap();
252  CHKERR getInterface<MeshsetsManager>()->clearMap();
253  CHKERR getInterface<CoordSystemsManager>()->clearMap();
254  CHKERR getInterface<CutMeshInterface>()->clearMap();
255  // Cleaning databases
256  refinedEntities.clear();
257  refinedFiniteElements.clear();
258  fIelds.clear();
259  entsFields.clear();
260  dofsField.clear();
261  finiteElements.clear();
262  entsFiniteElements.clear();
263  entFEAdjacencies.clear();
264  pRoblems.clear();
266 }
267 
270  if (verb == -1)
271  verb = verbose;
272  std::pair<RefEntity_multiIndex::iterator, bool> p_ent;
273  p_ent = refinedEntities.insert(
274  boost::make_shared<RefEntity>(basicEntityDataPtr, prism));
275  if (p_ent.second) {
276  std::pair<RefElement_multiIndex::iterator, bool> p;
277  p = refinedFiniteElements.insert(
278  boost::shared_ptr<RefElement>(new RefElement_PRISM(*p_ent.first)));
279  int num_nodes;
280  const EntityHandle *conn;
281  CHKERR get_moab().get_connectivity(prism, conn, num_nodes, true);
282  Range face_side3, face_side4;
283  CHKERR get_moab().get_adjacencies(conn, 3, 2, false, face_side3);
284  CHKERR get_moab().get_adjacencies(&conn[3], 3, 2, false, face_side4);
285  if (face_side3.size() != 1)
286  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
287  "prism don't have side face 3");
288  if (face_side4.size() != 1)
289  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
290  "prims don't have side face 4");
291  p.first->get()->getSideNumberPtr(*face_side3.begin());
292  p.first->get()->getSideNumberPtr(*face_side4.begin());
293  }
295 }
296 
299 
300  const EntityHandle root_meshset = get_moab().get_root_set();
301  if (root_meshset) {
302  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
303  "Root meshset should be 0");
304  }
305 
306  // Set version
307  {
308  Version version;
309  CHKERR getFileVersion(moab, version);
310  }
311 
312  // Global Variables
313  {
314 
315  auto check_tag_allocated = [](auto &rval) {
317  if (rval == MB_ALREADY_ALLOCATED)
318  rval = MB_SUCCESS;
319  else
320  CHKERRG(rval);
322  };
323 
324  // Fields
325  int def_shift = 1;
326  rval = get_moab().tag_get_handle("_FieldShift", 1, MB_TYPE_INTEGER,
327  th_FieldShift, MB_TAG_CREAT | MB_TAG_MESH,
328  &def_shift);
329  CHKERR check_tag_allocated(rval);
330 
331  const void *tag_data[1];
332  CHKERR get_moab().tag_get_by_ptr(th_FieldShift, &root_meshset, 1, tag_data);
333  fShift = (int *)tag_data[0];
334  // FE
335  rval = get_moab().tag_get_handle("_FEShift", 1, MB_TYPE_INTEGER, th_FEShift,
336  MB_TAG_CREAT | MB_TAG_MESH, &def_shift);
337  CHKERR check_tag_allocated(rval);
338 
339  CHKERR get_moab().tag_get_by_ptr(th_FEShift, &root_meshset, 1, tag_data);
340  feShift = (int *)tag_data[0];
341  // Problem
342  rval = get_moab().tag_get_handle("_ProblemShift", 1, MB_TYPE_INTEGER,
344  MB_TAG_CREAT | MB_TAG_MESH, &def_shift);
345  CHKERR check_tag_allocated(rval);
346 
347  CHKERR get_moab().tag_get_by_ptr(th_ProblemShift, &root_meshset, 1,
348  tag_data);
349  pShift = (int *)tag_data[0];
350  // Safety nets
351  int def_bool = 0;
352  rval = get_moab().tag_get_handle("_MoFEMBuild", 1, MB_TYPE_INTEGER,
353  th_MoFEMBuild, MB_TAG_CREAT | MB_TAG_MESH,
354  &def_bool);
355  CHKERR check_tag_allocated(rval);
356 
357  CHKERR get_moab().tag_get_by_ptr(th_MoFEMBuild, &root_meshset, 1,
358  (const void **)&buildMoFEM);
359  }
360 
361  // Tags saved in vtk-files
362  {
363  const int def_part = -1;
364  CHKERR get_moab().tag_get_handle("PARTITION", 1, MB_TYPE_INTEGER, th_Part,
365  MB_TAG_CREAT | MB_TAG_SPARSE, &def_part);
366  int def_elem_type = MBMAXTYPE;
367  CHKERR get_moab().tag_get_handle("ElemType", 1, MB_TYPE_INTEGER,
368  th_ElemType, MB_TAG_CREAT | MB_TAG_SPARSE,
369  &def_elem_type);
370  }
371 
372  // Tags Ref
373  {
374  EntityHandle def_handle = 0;
375  CHKERR get_moab().tag_get_handle("_RefParentHandle", 1, MB_TYPE_HANDLE,
377  MB_TAG_CREAT | MB_TAG_SPARSE, &def_handle);
378  BitRefLevel def_bit_level = 0;
379  CHKERR get_moab().tag_get_handle(
380  "_RefBitLevel", sizeof(BitRefLevel), MB_TYPE_OPAQUE, th_RefBitLevel,
381  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_bit_level);
382  BitRefLevel def_bit_level_mask = BitRefLevel().set();
383  CHKERR get_moab().tag_get_handle(
384  "_RefBitLevelMask", sizeof(BitRefLevel), MB_TYPE_OPAQUE,
385  th_RefBitLevel_Mask, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
386  &def_bit_level_mask);
387  BitRefEdges def_bit_edge = 0;
388  CHKERR get_moab().tag_get_handle(
389  "_RefBitEdge", sizeof(BitRefEdges), MB_TYPE_OPAQUE, th_RefBitEdge,
390  MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES, &def_bit_edge);
391  const int def_type[] = {0, 0};
392  CHKERR get_moab().tag_get_handle("_RefType", 2, MB_TYPE_INTEGER, th_RefType,
393  MB_TAG_CREAT | MB_TAG_SPARSE, def_type);
394  }
395 
396  // Tags Field
397  {
398  const unsigned long int def_id = 0;
399  CHKERR get_moab().tag_get_handle(
400  "_FieldId", sizeof(BitFieldId), MB_TYPE_OPAQUE, th_FieldId,
401  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
402  FieldSpace def_space = LASTSPACE;
403  CHKERR get_moab().tag_get_handle(
404  "_FieldSpace", sizeof(FieldSpace), MB_TYPE_OPAQUE, th_FieldSpace,
405  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_space);
406  FieldApproximationBase def_base = LASTBASE;
407  CHKERR get_moab().tag_get_handle(
408  "_FieldBase", sizeof(FieldApproximationBase), MB_TYPE_OPAQUE,
409  th_FieldBase, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_base);
410  const int def_val_len = 0;
411  CHKERR get_moab().tag_get_handle(
412  "_FieldName", def_val_len, MB_TYPE_OPAQUE, th_FieldName,
413  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
414  CHKERR get_moab().tag_get_handle(
415  "_FieldName_DataNamePrefix", def_val_len, MB_TYPE_OPAQUE,
417  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
418  }
419 
420  // Tags FE
421  {
422  const unsigned long int def_id = 0;
423  const int def_val_len = 0;
424  CHKERR get_moab().tag_get_handle(
425  "_FEId", sizeof(BitFEId), MB_TYPE_OPAQUE, th_FEId,
426  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
427  CHKERR get_moab().tag_get_handle(
428  "_FEName", def_val_len, MB_TYPE_OPAQUE, th_FEName,
429  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
430  CHKERR get_moab().tag_get_handle(
431  "_FEIdCol", sizeof(BitFieldId), MB_TYPE_OPAQUE, th_FEIdCol,
432  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
433  CHKERR get_moab().tag_get_handle(
434  "_FEIdRow", sizeof(BitFieldId), MB_TYPE_OPAQUE, th_FEIdRow,
435  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
436  CHKERR get_moab().tag_get_handle(
437  "_FEIdData", sizeof(BitFieldId), MB_TYPE_OPAQUE, th_FEIdData,
438  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
439  }
440 
441  // Tags Problem
442  {
443  const unsigned long int def_id = 0;
444  const int def_val_len = 0;
445  CHKERR get_moab().tag_get_handle(
446  "_ProblemId", sizeof(BitProblemId), MB_TYPE_OPAQUE, th_ProblemId,
447  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
448  CHKERR get_moab().tag_get_handle(
449  "_ProblemFEId", sizeof(BitFEId), MB_TYPE_OPAQUE, th_ProblemFEId,
450  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
451  CHKERR get_moab().tag_get_handle(
452  "_ProblemName", def_val_len, MB_TYPE_OPAQUE, th_ProblemName,
453  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
454  DofIdx def_nbdofs = 0;
455  CHKERR get_moab().tag_get_handle(
456  "_ProblemNbDofsRow", sizeof(DofIdx), MB_TYPE_OPAQUE,
457  th_ProblemNbDofsRow, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
458  &def_nbdofs);
459  CHKERR get_moab().tag_get_handle(
460  "_ProblemNbDofsCol", sizeof(DofIdx), MB_TYPE_OPAQUE,
461  th_ProblemNbDofsCol, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
462  &def_nbdofs);
463  CHKERR get_moab().tag_get_handle(
464  "_ProblemLocalNbDofsRow", sizeof(DofIdx), MB_TYPE_OPAQUE,
465  th_ProblemLocalNbDofRow, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
466  &def_nbdofs);
467  CHKERR get_moab().tag_get_handle(
468  "_ProblemGhostNbDofsRow", sizeof(DofIdx), MB_TYPE_OPAQUE,
469  th_ProblemGhostNbDofRow, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
470  &def_nbdofs);
471  CHKERR get_moab().tag_get_handle(
472  "_ProblemLocalNbDofsCol", sizeof(DofIdx), MB_TYPE_OPAQUE,
473  th_ProblemLocalNbDofCol, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
474  &def_nbdofs);
475  CHKERR get_moab().tag_get_handle(
476  "_ProblemGhostNbDofsCol", sizeof(DofIdx), MB_TYPE_OPAQUE,
477  th_ProblemGhostNbDofCol, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
478  &def_nbdofs);
479  }
480 
481  // Meshsets with boundary conditions and material sets
482  MeshsetsManager *meshsets_manager_ptr;
483  CHKERR getInterface(meshsets_manager_ptr);
484  CHKERR meshsets_manager_ptr->getTags(verb);
485 
486  // Series recorder
487  SeriesRecorder *series_recorder_ptr;
488  CHKERR getInterface(series_recorder_ptr);
489  CHKERR series_recorder_ptr->getTags(verb);
490 
491  // Coordinate systems
492  CoordSystemsManager *cs_manger_ptr;
493  CHKERR getInterface(cs_manger_ptr);
494  CHKERR cs_manger_ptr->getTags(verb);
495 
497 }
498 
501  if (verb == -1)
502  verb = verbose;
503  CHKERR clearMap();
505 }
506 
509  if (verb == -1)
510  verb = verbose;
511  CHKERR clearMap();
512  CHKERR getTags(verb);
515 }
516 
518  const bool distributed_mesh) {
520  if (verb == -1)
521  verb = verbose;
522 
523  // clear moab database
524  CHKERR clearMap();
525 
526  // set new reference
527  moab = std::ref(new_moab);
528 
529  // check if moab has set communicator if not set communicator internally
530  ParallelComm *pComm = ParallelComm::get_pcomm(&new_moab, MYPCOMM_INDEX);
531  if (pComm == NULL) {
532  pComm = new ParallelComm(&new_moab, cOmm);
533  }
534 
535  // create MoFEM tags
536  CHKERR getTags();
537 
538  // Create basic entity data struture
539  basicEntityDataPtr = boost::make_shared<BasicEntityData>(moab);
540  if (distributed_mesh)
541  basicEntityDataPtr->setDistributedMesh();
542  else
543  basicEntityDataPtr->unSetDistributedMesh();
544 
545  // Initalise database
547 
549 };
550 
553  if (verb == -1)
554  verb = verbose;
555 
556  CHKERR PetscOptionsBegin(cOmm, optionsPrefix.c_str(), "Mesh cut options",
557  "See MoFEM documentation");
558 
559  CHKERR PetscOptionsBool(
560  "-mofem_init_fields", "Initialise fields on construction", "",
562 
563  CHKERR PetscOptionsBool(
564  "-mofem_init_fields", "Initialise fields on construction", "",
566 
567  // TODO: Add read verbosity level
568  // TODO: Add option to initalise problems ??? - DO WE REALLY NEED THAT
569 
570  ierr = PetscOptionsEnd();
571  CHKERRG(ierr);
572 
574 }
575 
578  if (verb == -1)
579  verb = verbose;
580 
581  CoordSystemsManager *cs_manger_ptr;
582  CHKERR getInterface(cs_manger_ptr);
583 
584  // Initialize coordinate systems
585  CHKERR cs_manger_ptr->initialiseDatabaseFromMesh(verb);
586 
587  Range ref_elems_to_add;
588 
589  // Initialize database
590  Range meshsets;
591  CHKERR get_moab().get_entities_by_type(0, MBENTITYSET, meshsets, false);
592  Range special_meshsets;
593  for (Range::iterator mit = meshsets.begin(); mit != meshsets.end(); mit++) {
594  BitFieldId field_id;
595  // Get bit id form field tag
596  CHKERR get_moab().tag_get_data(th_FieldId, &*mit, 1, &field_id);
597  // Check if meshset if field meshset
598  if (field_id != 0) {
599  std::pair<Field_multiIndex::iterator, bool> p;
600  const char *cs_name;
601  int cs_name_size;
602  boost::shared_ptr<CoordSys> cs_ptr;
603  rval =
604  get_moab().tag_get_by_ptr(cs_manger_ptr->get_th_CoordSysName(), &*mit,
605  1, (const void **)&cs_name, &cs_name_size);
606  if (rval == MB_SUCCESS && cs_name_size)
607  CHKERR cs_manger_ptr->getCoordSysPtr(std::string(cs_name, cs_name_size),
608  cs_ptr);
609  else
610  CHKERR cs_manger_ptr->getCoordSysPtr("UNDEFINED", cs_ptr);
611 
612  p = fIelds.insert(
613  boost::shared_ptr<Field>(new Field(moab, *mit, cs_ptr)));
614  if (verb >= VERBOSE) {
615  std::ostringstream ss;
616  ss << "read field " << **p.first << std::endl;
617  PetscPrintf(cOmm, ss.str().c_str());
618  }
619  if(!p.second) {
620  // Field meshset exists, remove duplicate meshsets from other
621  // processors.
622  Range ents;
623  CHKERR get_moab().get_entities_by_handle(*mit, ents, true);
624  CHKERR get_moab().add_entities((*p.first)->getMeshset(), ents);
625  CHKERR get_moab().delete_entities(&*mit, 1);
626  } else {
627  special_meshsets.insert(*mit);
628  }
629  }
630  // Check for finite elements
631  BitFieldId fe_id;
632  // Get bit id from fe tag
633  CHKERR get_moab().tag_get_data(th_FEId, &*mit, 1, &fe_id);
634  // check if meshset is finite element meshset
635  if (fe_id != 0) {
636  std::pair<FiniteElement_multiIndex::iterator, bool> p =
637  finiteElements.insert(
638  boost::shared_ptr<FiniteElement>(new FiniteElement(moab, *mit)));
639  if (verb >= VERBOSE) {
640  std::ostringstream ss;
641  ss << "read finite element " << **p.first << std::endl;
642  PetscPrintf(cOmm, ss.str().c_str());
643  }
644  Range ents;
645  CHKERR get_moab().get_entities_by_type(*mit, MBENTITYSET, ents, false);
646  CHKERR get_moab().get_entities_by_handle(*mit, ents, true);
647  ref_elems_to_add.merge(ents);
648  if(!p.second) {
649  // Finite element mesh set exist, could be created on other processor.
650  // Remove duplicate.
651  CHKERR get_moab().add_entities((*p.first)->getMeshset(), ents);
652  CHKERR get_moab().delete_entities(&*mit, 1);
653  } else {
654  special_meshsets.insert(*mit);
655  }
656  }
657  BitProblemId problem_id;
658  // get bit id form problem tag
659  CHKERR get_moab().tag_get_data(th_ProblemId, &*mit, 1, &problem_id);
660  // check if meshset if problem meshset
661  if (problem_id != 0) {
662  std::pair<Problem_multiIndex::iterator, bool> p =
663  pRoblems.insert(Problem(moab, *mit));
664  if (verb >= VERBOSE) {
665  std::ostringstream ss;
666  ss << "read problem " << *p.first << " bit ref "
667  << p.first->getBitRefLevel() << " bit mask "
668  << p.first->getMaskBitRefLevel() << std::endl;
669  PetscPrintf(cOmm, ss.str().c_str());
670  }
671  if(!p.second) {
672  // Problem meshset exists, could be created on other processor.
673  // Remove duplicate.
674  Range ents;
675  CHKERR get_moab().get_entities_by_handle(*mit, ents, true);
676  CHKERR get_moab().get_entities_by_type(*mit, MBENTITYSET, ents, true);
677  CHKERR get_moab().add_entities(p.first->meshset, ents);
678  CHKERR get_moab().delete_entities(&*mit, 1);
679  } else {
680  special_meshsets.insert(*mit);
681  }
682  }
683  }
684 
685  // Add entities to database
686  Range bit_ref_ents;
687  CHKERR get_moab().get_entities_by_handle(0, bit_ref_ents, false);
688  bit_ref_ents = subtract(bit_ref_ents, special_meshsets);
689  CHKERR getInterface<BitRefManager>()->filterEntitiesByRefLevel(
690  BitRefLevel().set(), BitRefLevel().set(), bit_ref_ents);
691  CHKERR getInterface<BitRefManager>()->setEntitiesBitRefLevel(bit_ref_ents);
692  CHKERR getInterface<BitRefManager>()->setElementsBitRefLevel(
693  ref_elems_to_add);
694 
695  // Build field entities
696  for (Field_multiIndex::iterator fit = fIelds.begin(); fit != fIelds.end();
697  ++fit) {
698  if ((*fit)->getSpace() != NOSPACE) {
699  Range ents_of_id_meshset;
700  CHKERR get_moab().get_entities_by_handle(fit->get()->getMeshset(),
701  ents_of_id_meshset, false);
702  CHKERR set_field_order(ents_of_id_meshset, fit->get()->getId(), -1, verb);
703  }
704  }
705 
707  CHKERR build_fields(verb);
710  }
711  }
712 
713  if (verb > VERY_NOISY) {
714  list_fields();
716  list_problem();
717  }
718 
719  // Initialize interfaces
720  MeshsetsManager *m_manger_ptr;
721  CHKERR getInterface(m_manger_ptr);
722  CHKERR m_manger_ptr->initialiseDatabaseFromMesh(verb);
723  SeriesRecorder *series_recorder_ptr;
724  CHKERR getInterface(series_recorder_ptr);
725  CHKERR series_recorder_ptr->initialiseDatabaseFromMesh(verb);
726 
728 }
729 
730 // cubit meshsets
731 
734  *fields_ptr = &fIelds;
736 }
737 
739 Core::get_ref_ents(const RefEntity_multiIndex **refined_entities_ptr) const {
741  *refined_entities_ptr = &refinedEntities;
743 }
745  const RefElement_multiIndex **refined_finite_elements_ptr) const {
747  *refined_finite_elements_ptr = &refinedFiniteElements;
749 }
750 
751 MoFEMErrorCode Core::get_problem(const std::string &problem_name,
752  const Problem **problem_ptr) const {
755  const ProblemsByName &problems = pRoblems.get<Problem_mi_tag>();
756  ProblemsByName::iterator p_miit = problems.find(problem_name);
757  if (p_miit == problems.end()) {
758  SETERRQ1(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
759  "problem < %s > not found, (top tip: check spelling)",
760  problem_name.c_str());
761  }
762  *problem_ptr = &*p_miit;
764 }
765 
767 Core::get_problems(const Problem_multiIndex **problems_ptr) const {
769  *problems_ptr = &pRoblems;
771 }
772 
774 Core::get_field_ents(const FieldEntity_multiIndex **field_ents) const {
776  *field_ents = &entsFields;
778 }
781  *dofs_ptr = &dofsField;
783 }
784 
786  MeshsetsManager *meshsets_manager_ptr;
787  getInterface(meshsets_manager_ptr);
788  return meshsets_manager_ptr;
789 }
790 
792  MeshsetsManager *meshsets_manager_ptr;
793  getInterface(meshsets_manager_ptr);
794  return meshsets_manager_ptr;
795 }
796 
797 } // namespace MoFEM
MoFEMErrorCode initialiseDatabaseFromMesh(int verb=0)
Tag th_ProblemNbDofsCol
Definition: Core.hpp:209
static const MOFEMuuid IDD_MOFEMSeriesRecorder
DofEntity_multiIndex dofsField
dofs on fields
Definition: Core.hpp:249
MoFEMErrorCode clearMap()
Cleaning database.
Definition: Core.cpp:248
static const MOFEMuuid IDD_MOFEMCoreInterface
Definition: Interface.hpp:24
Tag th_FieldSpace
Definition: Core.hpp:204
MoFEM interface unique ID.
int sIze
MoFEM communicator size.
Definition: Core.hpp:849
MoFEMErrorCode initialiseDatabaseFromMesh(int verb=DEFAULT_VERBOSITY)
Initialize database getting information on mesh.
Definition: Core.cpp:576
Tag th_FieldName_DataNamePrefix
Definition: Core.hpp:204
static const MOFEMuuid IDD_MOFEMMeshsetsManager
PetscLogEvent MOFEM_EVENT_postProcess
Event for postProcess finite element.
Definition: Core.hpp:837
boost::shared_ptr< WrapMPIComm > wrapMPIComm
Definition: Core.hpp:883
static const MOFEMuuid IDD_MOFEMProblemsManager
multi_index_container< boost::shared_ptr< RefElement >, indexed_by< ordered_unique< tag< Ent_mi_tag >, const_mem_fun< RefElement::interface_type_RefEntity, EntityHandle, &RefElement::getRefEnt > >, ordered_non_unique< tag< EntType_mi_tag >, const_mem_fun< RefElement::interface_type_RefEntity, EntityType, &RefElement::getEntType > > > > RefElement_multiIndex
MPI_Comm cOmm
MoFEM communicator.
Definition: Core.hpp:846
int * fShift
Ptr to tag handle storing last set bit in field ID.
Definition: Core.hpp:887
Tag th_FEIdCol
Definition: Core.hpp:207
RefEntity_multiIndex refinedEntities
refined entities
Definition: Core.hpp:244
Provide data structure for (tensor) field approximation.The Field is intended to provide support for ...
FieldEntity_multiIndex entsFields
entities on fields
Definition: Core.hpp:248
MoFEMErrorCode rebuild_database(int verb=DEFAULT_VERBOSITY)
Clear database and initialize it once again.
Definition: Core.cpp:507
moab::Interface & get_moab()
Definition: Core.hpp:266
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:506
MoFEMErrorCode regSubInterface(const MOFEMuuid &uid)
Register subinterfac in core interface.
Definition: Core.cpp:85
PetscLogEvent MOFEM_EVENT_operator
Event for evaluating operator of finite element.
Definition: Core.hpp:835
keeps data about abstract PRISM finite element
base class for all interface classes
multi_index_container< boost::shared_ptr< FieldEntity >, indexed_by< ordered_unique< tag< Unique_mi_tag >, member< FieldEntity, UId, &FieldEntity::globalUId > >, ordered_non_unique< tag< FieldName_mi_tag >, const_mem_fun< FieldEntity::interface_type_Field, boost::string_ref, &FieldEntity::getNameRef > >, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< FieldEntity, EntityHandle, &FieldEntity::getEnt > >, ordered_non_unique< tag< Composite_Name_And_Ent_mi_tag >, composite_key< FieldEntity, const_mem_fun< FieldEntity::interface_type_Field, boost::string_ref, &FieldEntity::getNameRef >, const_mem_fun< FieldEntity, EntityHandle, &FieldEntity::getEnt > > > > > FieldEntity_multiIndex
MultiIndex container keeps FieldEntity.
Tag th_RefParentHandle
Definition: Core.hpp:201
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:482
static const MOFEMuuid IDD_MOFEMUnknown
IFACE getInterface() const
Get interface pointer to pointer of interface.
MoFEMErrorCode set_moab_interface(moab::Interface &new_moab, int verb=VERBOSE, const bool distributed_mesh=true)
Set the moab interface object.
Definition: Core.cpp:517
Tag th_ProblemFEId
Definition: Core.hpp:208
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:549
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.
MoFEMErrorCode get_fields(const Field_multiIndex **fields_ptr) const
Get fields multi-index from database.
Definition: Core.cpp:732
static const MOFEMuuid IDD_MOFEMBitRefManager
MoFEMErrorCode list_finite_elements() const
list finite elements in database
Definition: FECore.cpp:317
BitIntefaceId uUId
PetscLogEvent MOFEM_EVENT_createMat
Definition: Core.hpp:838
static const MOFEMuuid IDD_MOFEMNodeMerger
Definition: NodeMerger.hpp:23
Tag th_FieldShift
Definition: Core.hpp:212
Interface for managing meshsets containing materials and boundary conditions.
MoFEMErrorCode build_finite_elements(int verb=DEFAULT_VERBOSITY)
Build finite elementsBuild finite element data structures. Have to be run before problem and adjacenc...
Definition: FECore.cpp:804
static const MOFEMuuid IDD_MOFEMVEC
Definition: VecManager.hpp:26
Tag th_Part
Tag for partition number.
Definition: Core.hpp:200
std::bitset< BITPROBLEMID_SIZE > BitProblemId
Problem Id.
Definition: Types.hpp:55
Core(moab::Interface &moab, MPI_Comm comm=PETSC_COMM_WORLD, const int verbose=VERBOSE, const bool distributed_mesh=true)
Definition: Core.cpp:106
static const MOFEMuuid IDD_MOFEMPrismsFromSurface
Tag th_FEName
Definition: Core.hpp:206
Tag th_ElemType
Needed for VTK files.
Definition: Core.hpp:213
MoFEMErrorCode registerSubInterfaces()
Register insterfaces.
Definition: Core.cpp:189
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:513
BitProblemId getProblemShift()
Return unique problem Id.
Definition: Core.cpp:243
std::reference_wrapper< moab::Interface > moab
moab database
Definition: Core.hpp:265
keeps basic data about problemThis is low level structure with information about problem,...
PetscLogEvent MOFEM_EVENT_preProcess
Event for preProcess finite element.
Definition: Core.hpp:833
MoFEMErrorCode list_fields() const
list entities in the field
Definition: FieldCore.cpp:1171
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:21
static const MOFEMuuid IDD_MOFEMSimple
Definition: Simple.hpp:29
virtual const MoFEMErrorCode getFileVersion(moab::Interface &moab, Version &version) const
Get database major version.
FieldSpace in [ 0, LASTSPACE )
Definition: definitions.h:180
MoFEMErrorCode get_ref_finite_elements(const RefElement_multiIndex **refined_finite_elements_ptr) const
Get ref finite elements multi-index form database.
Definition: Core.cpp:744
MoFEMErrorCode getTags(int verb=-1)
get tags handlers used on meshsets
static auto get_sub_iface_options_imp(T *const ptr, int) -> decltype(ptr->getSubInterfaceOptions())
Definition: Core.cpp:72
std::bitset< BITREFEDGES_SIZE > BitRefEdges
Definition: Types.hpp:45
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
Definition: Core.cpp:51
MoFEMErrorCode getTags(int verb=-1)
get tags handlers used on meshsets
MoFEMErrorCode addPrismToDatabase(const EntityHandle prism, int verb=DEFAULT_VERBOSITY)
add prim element
Definition: Core.cpp:268
MoFEMErrorCode clear_database(int verb=DEFAULT_VERBOSITY)
Clear database.
Definition: Core.cpp:499
Tag th_FieldId
Definition: Core.hpp:204
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:84
Tag th_RefBitEdge
Definition: Core.hpp:201
std::bitset< BITFEID_SIZE > BitFEId
Finite element Id.
Definition: Types.hpp:54
Tag th_ProblemName
Definition: Core.hpp:208
PetscBool initaliseAndBuildField
Definition: Core.hpp:901
Tag th_ProblemGhostNbDofCol
Definition: Core.hpp:211
Tag th_ProblemId
Definition: Core.hpp:208
int rAnk
MOFEM communicator rank.
Definition: Core.hpp:850
Tag th_RefType
Definition: Core.hpp:203
Tag th_ProblemNbDofsRow
Definition: Core.hpp:209
MoFEMErrorCode initialiseDatabaseFromMesh(int verb=0)
MoFEMErrorCode getCoordSysPtr(const EntityHandle id, boost::shared_ptr< CoordSys > &cs_ptr)
Get the Coord Sys Ptr object.
BitFEId getFEShift()
Return unique finite element Id.
Definition: Core.cpp:238
FieldApproximationBase
approximation base
Definition: definitions.h:149
Tag th_ProblemGhostNbDofRow
Definition: Core.hpp:210
Finite element definition.
MoFEMErrorCode getTags(int verb=-1)
get tags handlers used on meshsets conating information about coordinate systems
static const MOFEMuuid IDD_MOFEMMeshRefine
MoFEMErrorCode getOptions(int verb=DEFAULT_VERBOSITY)
Get core options from command line.
Definition: Core.cpp:551
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:20
MoFEMErrorCode build_fields(int verb=DEFAULT_VERBOSITY)
Definition: FieldCore.cpp:1140
int * buildMoFEM
keeps flags/semaphores for different stages
Definition: Core.hpp:896
multi_index_container< boost::shared_ptr< DofEntity >, indexed_by< ordered_unique< tag< Unique_mi_tag >, member< DofEntity, UId, &DofEntity::globalUId > >, ordered_non_unique< tag< Composite_Name_And_Ent_And_EntDofIdx_mi_tag >, composite_key< DofEntity, const_mem_fun< DofEntity::interface_type_Field, boost::string_ref, &DofEntity::getNameRef >, const_mem_fun< DofEntity, EntityHandle, &DofEntity::getEnt >, const_mem_fun< DofEntity, DofIdx, &DofEntity::getEntDofIdx > > >, ordered_non_unique< tag< Unique_Ent_mi_tag >, const_mem_fun< DofEntity, const UId &, &DofEntity::getEntGlobalUniqueId > >, ordered_non_unique< tag< FieldName_mi_tag >, const_mem_fun< DofEntity::interface_type_Field, boost::string_ref, &DofEntity::getNameRef > >, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< DofEntity, EntityHandle, &DofEntity::getEnt > >, ordered_non_unique< tag< Composite_Name_And_Ent_mi_tag >, composite_key< DofEntity, const_mem_fun< DofEntity::interface_type_Field, boost::string_ref, &DofEntity::getNameRef >, const_mem_fun< DofEntity, EntityHandle, &DofEntity::getEnt > > >, ordered_non_unique< tag< Composite_Name_And_Type_mi_tag >, composite_key< DofEntity, const_mem_fun< DofEntity::interface_type_Field, boost::string_ref, &DofEntity::getNameRef >, const_mem_fun< DofEntity::interface_type_RefEntity, EntityType, &DofEntity::getEntType > > > > > DofEntity_multiIndex
MultiIndex container keeps DofEntity.
CHKERRQ(ierr)
Tag th_FieldBase
Definition: Core.hpp:204
#define BITFIELDID_SIZE
max number of fields
Definition: definitions.h:285
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:66
FieldEntityEntFiniteElementAdjacencyMap_multiIndex entFEAdjacencies
adjacencies of elements to dofs
Definition: Core.hpp:255
Tag th_MoFEMBuild
Definition: Core.hpp:214
RefElement_multiIndex refinedFiniteElements
refined elements
Definition: Core.hpp:245
int * feShift
Ptr to tag handle storing last set bit in finite element ID.
Definition: Core.hpp:888
MeshsetsManager * get_meshsets_manager_ptr()
get MeshsetsManager pointer
Definition: Core.cpp:785
MoFEMErrorCode get_ref_ents(const RefEntity_multiIndex **refined_entities_ptr) const
Get ref entities multi-index from database.
Definition: Core.cpp:739
Tag th_ProblemLocalNbDofRow
Definition: Core.hpp:210
static const MOFEMuuid IDD_MOFEMBasic
Definition: Basic.hpp:29
FiniteElement_multiIndex finiteElements
finite elements
Definition: Core.hpp:251
Problem_multiIndex pRoblems
problems multi-index
Definition: Core.hpp:257
MoFEMErrorCode getTags(int verb=DEFAULT_VERBOSITY)
Get tag handles.
Definition: Core.cpp:297
static const MOFEMuuid IDD_MOFEMTools
Definition: Tools.hpp:23
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.
Tag th_ProblemLocalNbDofCol
Definition: Core.hpp:211
static bool isGloballyInitialised
Core base globally initialized.
Definition: Core.hpp:897
MoFEMErrorCode list_problem() const
list problems
Tag th_FieldName
Definition: Core.hpp:204
FieldSpace
approximation spaces
Definition: definitions.h:173
Tag th_FEShift
Definition: Core.hpp:212
MoFEMErrorCode get_field_ents(const FieldEntity_multiIndex **field_ents) const
Get field multi index.
Definition: Core.cpp:774
static const MOFEMuuid IDD_MOFEMTetGegInterface
std::bitset< BITFIELDID_SIZE > BitFieldId
Field Id.
Definition: Types.hpp:53
#define CHKERR
Inline error check.
Definition: definitions.h:601
PetscBool initaliseAndBuildFiniteElements
Definition: Core.hpp:904
Field_multiIndex fIelds
fields
Definition: Core.hpp:247
int * pShift
Ptr to tag handle storing last set bit in problem ID.
Definition: Core.hpp:889
static const MOFEMuuid IDD_MOFEMCutMesh
static const MOFEMuuid IDD_MOFEMMatrixManager
static const MOFEMuuid IDD_MOFEMCoordsSystemsManager
static char help[]
boost::shared_ptr< BasicEntityData > basicEntityDataPtr
Definition: Core.hpp:225
#define MYPCOMM_INDEX
default communicator number PCOMM
Definition: definitions.h:290
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:51
MoFEMErrorCode get_problem(const std::string &problem_name, const Problem **problem_ptr) const
Get problem database (data structure)
Definition: Core.cpp:751
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< RefEntity >, indexed_by< ordered_unique< tag< Ent_mi_tag >, member< RefEntity::BasicEntity, EntityHandle, &RefEntity::ent > >, ordered_non_unique< tag< Ent_Ent_mi_tag >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getParentEnt > >, ordered_non_unique< tag< EntType_mi_tag >, const_mem_fun< RefEntity::BasicEntity, EntityType, &RefEntity::getEntType > >, ordered_non_unique< tag< ParentEntType_mi_tag >, const_mem_fun< RefEntity, EntityType, &RefEntity::getParentEntType > >, ordered_non_unique< tag< Composite_EntType_and_ParentEntType_mi_tag >, composite_key< RefEntity, const_mem_fun< RefEntity::BasicEntity, 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::BasicEntity, EntityType, &RefEntity::getEntType >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getParentEnt > > > > > RefEntity_multiIndex
MoFEMErrorCode get_problems(const Problem_multiIndex **problems_ptr) const
Get pointer to problems multi-index.
Definition: Core.cpp:767
MoFEMErrorCode set_field_order(const Range &ents, const BitFieldId id, const ApproximationOrder order, int verb=DEFAULT_VERBOSITY)
Definition: FieldCore.cpp:397
static const MOFEMuuid IDD_MOFEMFieldBlas
Definition: FieldBlas.hpp:26
MoFEMErrorCode get_dofs(const DofEntity_multiIndex **dofs_ptr) const
Get dofs multi index.
Definition: Core.cpp:779
Tag th_ProblemShift
Definition: Core.hpp:212
ParallelComm * pComm
MOAB communicator structure.
Definition: Core.hpp:847
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1791
int verbose
Verbosity level.
Definition: Core.hpp:885
Tag th_RefBitLevel_Mask
Definition: Core.hpp:201
Tag th_FEId
Definition: Core.hpp:206
MoFEMErrorCode initialiseDatabaseFromMesh(int verb=0)
int DofIdx
Index of DOF.
Definition: Types.hpp:29
static const MOFEMuuid IDD_MOFEMFieldEvaluator
boost::ptr_map< unsigned long, UnknownInterface > iFaces
Hash map of pointers to interfaces.
Definition: Core.hpp:894
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:412
static const MOFEMuuid IDD_MOFEMISManager
Definition: ISManager.hpp:26
std::string optionsPrefix
Prefix for options on command line.
Definition: Core.hpp:899
Tag th_RefBitLevel
Definition: Core.hpp:201
EntFiniteElement_multiIndex entsFiniteElements
finite element entities
Definition: Core.hpp:252
static const MOFEMuuid IDD_MOFEMDeprecatedCoreInterface
Definition: Interface.hpp:26
static const MOFEMuuid IDD_MOFEMPrismInterface
Tag th_FEIdData
Definition: Core.hpp:207
DEPRECATED IFace * query_interface() const
static const MOFEMuuid IDD_MOFEMMedInterface
BitFieldId getFieldShift()
Return unique field Id.
Definition: Core.cpp:226
static const MOFEMuuid IDD_MOFEMBitLevelCoupler
Tag th_FEIdRow
Definition: Core.hpp:207
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition: Core.cpp:61
static const MOFEMuuid IDD_MOFEMComm