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