17 : comm(comm), isPetscComm(petsc) {
41constexpr const int CoreTmp<-1>::value;
47 if (type_index == boost::typeindex::type_id<CoreInterface>()) {
50 }
else if (type_index ==
51 boost::typeindex::type_id<DeprecatedCoreInterface>()) {
57 auto it = iFaces.find(type_index);
58 if (it != iFaces.end()) {
75 MPI_Initialized(&mpiInitialised);
79 PetscInitialized(&isInitialized);
80 if (isInitialized == PETSC_FALSE) {
81 for (
int i = 0;
i < *argc - 1; ++
i) {
82 if (std::strcmp((*args)[
i],
"-param_file") == 0) {
83 file = (*args)[
i + 1];
87 PetscInitialize(argc, args, file,
help);
94 isGloballyInitialised =
true;
97 char petsc_version[255];
98 CHKERR PetscGetVersion(petsc_version, 255);
99 MOFEM_LOG_C(
"WORLD", Sev::inform,
"MoFEM version %d.%d.%d (%s %s)",
100 MoFEM_VERSION_MAJOR, MoFEM_VERSION_MINOR, MoFEM_VERSION_BUILD,
101 MOAB_VERSION_STRING, petsc_version);
102 MOFEM_LOG_C(
"WORLD", Sev::inform,
"git commit id %s", GIT_SHA1_NAME);
104 auto log_time = [&](
const auto perefix,
auto time) {
106 << perefix << time.date().year() <<
"-" << time.date().month() <<
"-"
107 << time.date().day() <<
" " << time.time_of_day().hours() <<
":"
108 << time.time_of_day().minutes() <<
":" << time.time_of_day().seconds();
112 log_time(
"Local time: ", boost::posix_time::second_clock::local_time());
113 log_time(
"UTC time: ", boost::posix_time::second_clock::universal_time());
119 if (isGloballyInitialised) {
120 PetscPopErrorHandler();
121 isGloballyInitialised =
false;
123 if (isInitialized == PETSC_FALSE) {
124 PetscBool is_finalized;
125 PetscFinalized(&is_finalized);
130 if (!mpiInitialised) {
132 MPI_Finalized(&mpi_finalized);
145 ->
decltype(ptr->getSubInterfaceOptions()) {
146 return ptr->getSubInterfaceOptions();
158 ->
decltype(ptr->getEventOptions()) {
159 return ptr->getEventptions();
174 CHKERR registerInterface<IFACE>(
true);
175 IFACE *ptr =
new IFACE(*
this);
180 auto get_sub_iface_options = [](
auto *
const ptr) {
183 CHKERR get_sub_iface_options(ptr);
185 auto type_idx = boost::typeindex::type_id<IFACE>();
186 iFaces.insert(type_idx, ptr);
192 auto ptr = boost::make_shared<IFACE>();
196 auto get_event_options = [](
auto *
const ptr) {
199 CHKERR get_event_options(ptr.get());
204 MPI_Comm comm,
const int verbose) {
208 if (!isGloballyInitialised)
210 "MoFEM globally is not initialised, call MoFEM::Core::Initialize");
213 wrapMPIMOABComm = boost::make_shared<WrapMPIComm>(comm,
false);
215 MPI_Comm_size(mofemComm, &sIze);
216 MPI_Comm_rank(mofemComm, &rAnk);
219 ParallelComm *pComm = ParallelComm::get_pcomm(&moab,
MYPCOMM_INDEX);
221 pComm =
new ParallelComm(&moab, wrapMPIMOABComm->get_comm());
224 CHKERR registerInterface<UnknownInterface>();
225 CHKERR registerInterface<CoreInterface>();
226 CHKERR registerInterface<DeprecatedCoreInterface>();
229 PetscLogEventRegister(
"FE_preProcess", 0, &MOFEM_EVENT_preProcess);
230 PetscLogEventRegister(
"FE_operator", 0, &MOFEM_EVENT_operator);
231 PetscLogEventRegister(
"FE_postProcess", 0, &MOFEM_EVENT_postProcess);
232 PetscLogEventRegister(
"MoFEMCreateMat", 0, &MOFEM_EVENT_createMat);
249 ierr = this->registerSubInterfaces();
250 CHKERRABORT(comm,
ierr);
251 ierr = this->clearMap();
252 CHKERRABORT(comm,
ierr);
253 ierr = this->getTags();
254 CHKERRABORT(comm,
ierr);
255 ierr = this->getOptions(verbose);
256 CHKERRABORT(comm,
ierr);
258 this->basicEntityDataPtr = boost::make_shared<BasicEntityData>(moab);
259 setRefEntBasicDataPtr(*
this, this->basicEntityDataPtr);
261 ierr = this->initialiseDatabaseFromMesh(verbose);
262 CHKERRABORT(comm,
ierr);
273 ierr = this->registerSubInterfaces();
274 CHKERRABORT(comm,
ierr);
275 ierr = this->clearMap();
276 CHKERRABORT(comm,
ierr);
277 ierr = this->getTags();
278 CHKERRABORT(comm,
ierr);
279 ierr = this->getOptions(verbose);
280 CHKERRABORT(comm,
ierr);
282 this->basicEntityDataPtr = boost::make_shared<BasicEntityData>(moab);
283 setRefEntBasicDataPtr(*
this, this->basicEntityDataPtr);
285 ierr = this->initialiseDatabaseFromMesh(verbose);
286 CHKERRABORT(comm,
ierr);
290 PetscBool is_finalized;
291 PetscFinalized(&is_finalized);
295 if (isGloballyInitialised && is_finalized) {
296 isGloballyInitialised =
false;
301 BOOST_LOG_SCOPED_THREAD_ATTR(
"Timeline", attrs::timer());
308 Range ref_elems_to_add;
310 MOFEM_LOG(
"WORLD", Sev::verbose) <<
"Get MoFEM meshsets";
313 CHKERR get_moab().get_entities_by_type(0, MBENTITYSET, meshsets,
false);
314 Range special_meshsets;
315 for (
auto mit : meshsets) {
318 CHKERR get_moab().tag_get_data(th_FieldId, &mit, 1, &field_id);
322 const void *tag_name;
324 CHKERR get_moab().tag_get_by_ptr(
325 th_FieldName, &mit, 1, (
const void **)&tag_name, &tag_name_size);
330 << boost::string_ref((
char *)tag_name, tag_name_size);
332 auto p = fIelds.insert(boost::make_shared<Field>(moab, mit));
338 CHKERR get_moab().get_entities_by_handle(mit, ents,
true);
339 CHKERR get_moab().add_entities((*p.first)->getMeshset(), ents);
340 CHKERR get_moab().delete_entities(&mit, 1);
342 special_meshsets.insert(mit);
348 CHKERR get_moab().tag_get_data(th_FEId, &mit, 1, &fe_id);
351 std::pair<FiniteElement_multiIndex::iterator, bool> p =
352 finiteElements.insert(
353 boost::shared_ptr<FiniteElement>(
new FiniteElement(moab, mit)));
355 MOFEM_LOG(
"WORLD", Sev::verbose) <<
"Read finite element " << **p.first;
358 CHKERR get_moab().get_entities_by_type(mit, MBENTITYSET, ents,
false);
359 CHKERR get_moab().get_entities_by_handle(mit, ents,
true);
360 ref_elems_to_add.merge(ents);
364 CHKERR get_moab().add_entities((*p.first)->getMeshset(), ents);
365 CHKERR get_moab().delete_entities(&mit, 1);
367 special_meshsets.insert(mit);
372 CHKERR get_moab().tag_get_data(th_ProblemId, &mit, 1, &problem_id);
374 if (problem_id != 0) {
375 std::pair<Problem_multiIndex::iterator, bool> p =
376 pRoblems.insert(
Problem(moab, mit));
378 MOFEM_LOG(
"WORLD", Sev::verbose) <<
"Read problem " << *p.first;
380 <<
"\tBitRef " << p.first->getBitRefLevel() <<
" BitMask "
381 << p.first->getBitRefLevelMask();
388 CHKERR get_moab().get_entities_by_handle(mit, ents,
true);
389 CHKERR get_moab().get_entities_by_type(mit, MBENTITYSET, ents,
true);
390 CHKERR get_moab().add_entities(p.first->meshset, ents);
391 CHKERR get_moab().delete_entities(&mit, 1);
393 special_meshsets.insert(mit);
397 MOFEM_LOG(
"WORLD", Sev::verbose) <<
"Get MoFEM meshsets <- done";
400 MOFEM_LOG(
"WORLD", Sev::verbose) <<
"Add entities to database";
402 CHKERR get_moab().get_entities_by_handle(0, bit_ref_ents,
false);
403 bit_ref_ents = subtract(bit_ref_ents, special_meshsets);
404 CHKERR getInterface<BitRefManager>()->filterEntitiesByRefLevel(
406 CHKERR getInterface<BitRefManager>()->setEntitiesBitRefLevel(bit_ref_ents);
407 CHKERR getInterface<BitRefManager>()->setElementsBitRefLevel(
409 MOFEM_LOG(
"WORLD", Sev::verbose) <<
"Add entities to database <- done";
412 MOFEM_LOG(
"WORLD", Sev::verbose) <<
"Add field to database";
413 for (
auto field : fIelds) {
414 if (field->getSpace() !=
NOSPACE) {
415 Range ents_of_id_meshset;
416 CHKERR get_moab().get_entities_by_handle(field->getMeshset(),
417 ents_of_id_meshset,
false);
418 CHKERR set_field_order(ents_of_id_meshset, field->getId(), -1, verb);
421 MOFEM_LOG(
"WORLD", Sev::verbose) <<
"Add field to database <- done";
423 if (initaliseAndBuildField || initaliseAndBuildFiniteElements) {
424 MOFEM_LOG(
"WORLD", Sev::verbose) <<
"Build fields elements";
425 CHKERR build_fields(verb);
426 MOFEM_LOG(
"WORLD", Sev::verbose) <<
"Build fields elements <- done";
427 if (initaliseAndBuildFiniteElements) {
428 MOFEM_LOG(
"WORLD", Sev::verbose) <<
"Build finite elements";
429 CHKERR build_finite_elements(verb);
430 MOFEM_LOG(
"WORLD", Sev::verbose) <<
"Build finite elements <- done";
436 list_finite_elements();
441 MOFEM_LOG(
"WORLD", Sev::verbose) <<
"Initialise interfaces from mesh";
443 MOFEM_LOG(
"WORLD", Sev::verbose) <<
"Initialise MeshsetManager";
444 CHKERR getInterface<MeshsetsManager>() -> initialiseDatabaseFromMesh(verb);
445 MOFEM_LOG(
"WORLD", Sev::verbose) <<
"Initialise MeshsetManager <- done";
446 MOFEM_LOG(
"WORLD", Sev::verbose) <<
"Initialise SeriesRecorder";
447 CHKERR getInterface<SeriesRecorder>() -> initialiseDatabaseFromMesh(verb);
448 MOFEM_LOG(
"WORLD", Sev::verbose) <<
"Initialise SeriesRecorder <- done";
450 MOFEM_LOG(
"WORLD", Sev::verbose) <<
"Initialise interfaces from mesh <- done";
464 moab = std::ref(new_moab);
467 ParallelComm *pComm = ParallelComm::get_pcomm(&new_moab,
MYPCOMM_INDEX);
469 pComm =
new ParallelComm(&new_moab, wrapMPIMOABComm->get_comm());
476 basicEntityDataPtr = boost::make_shared<BasicEntityData>(moab);
477 setRefEntBasicDataPtr(*
this, this->basicEntityDataPtr);
480 CHKERR this->initialiseDatabaseFromMesh(verb);
491 CHKERR regSubInterface<LogManager>();
492 CHKERR regSubInterface<Simple>();
493 CHKERR regSubInterface<OperatorsTester>();
494 CHKERR regSubInterface<PipelineManager>();
495 CHKERR regSubInterface<PipelineGraph>();
496 CHKERR regSubInterface<ProblemsManager>();
497 CHKERR regSubInterface<MatrixManager>();
498 CHKERR regSubInterface<ISManager>();
499 CHKERR regSubInterface<VecManager>();
500 CHKERR regSubInterface<FieldBlas>();
501 CHKERR regSubInterface<BitRefManager>();
502 CHKERR regSubInterface<Tools>();
503 CHKERR regSubInterface<CommInterface>();
504 CHKERR regSubInterface<MeshsetsManager>();
505 CHKERR regSubInterface<NodeMergerInterface>();
506 CHKERR regSubInterface<PrismsFromSurfaceInterface>();
507 CHKERR regSubInterface<MeshRefinement>();
508 CHKERR regSubInterface<PrismInterface>();
509 CHKERR regSubInterface<CutMeshInterface>();
510 CHKERR regSubInterface<SeriesRecorder>();
512 CHKERR regSubInterface<TetGenInterface>();
515 CHKERR regSubInterface<MedInterface>();
517 CHKERR regSubInterface<FieldEvaluatorInterface>();
518 CHKERR regSubInterface<BcManager>();
521 CHKERR regEvents<SchurEvents>();
529 CHKERR getInterface<SeriesRecorder>()->clearMap();
530 CHKERR getInterface<MeshsetsManager>()->clearMap();
531 CHKERR getInterface<CutMeshInterface>()->clearMap();
533 refinedEntities.clear();
534 refinedFiniteElements.clear();
538 finiteElements.clear();
539 entsFiniteElements.clear();
540 entFEAdjacencies.clear();
549 std::pair<RefEntity_multiIndex::iterator, bool> p_ent;
550 p_ent = refinedEntities.insert(
551 boost::make_shared<RefEntity>(basicEntityDataPtr, prism));
553 std::pair<RefElement_multiIndex::iterator, bool> p;
554 p = refinedFiniteElements.insert(
558 CHKERR get_moab().get_connectivity(prism, conn, num_nodes,
true);
559 Range face_side3, face_side4;
560 CHKERR get_moab().get_adjacencies(conn, 3, 2,
false, face_side3);
561 CHKERR get_moab().get_adjacencies(&conn[3], 3, 2,
false, face_side4);
562 if (face_side3.size() != 1)
564 "prism don't have side face 3");
565 if (face_side4.size() != 1)
567 "prims don't have side face 4");
568 p.first->get()->getSideNumberPtr(*face_side3.begin());
569 p.first->get()->getSideNumberPtr(*face_side4.begin());
577 const EntityHandle root_meshset = get_moab().get_root_set();
580 "Root meshset should be 0");
586 CHKERR getFileVersion(moab, version);
592 auto check_tag_allocated = [](
auto &
rval) {
594 if (
rval == MB_ALREADY_ALLOCATED)
603 rval = get_moab().tag_get_handle(
"_MoFEMBuild", 1, MB_TYPE_INTEGER,
604 th_MoFEMBuild, MB_TAG_CREAT | MB_TAG_MESH,
608 CHKERR get_moab().tag_get_by_ptr(th_MoFEMBuild, &root_meshset, 1,
609 (
const void **)&buildMoFEM);
614 const int def_part = -1;
615 CHKERR get_moab().tag_get_handle(
"PARTITION", 1, MB_TYPE_INTEGER, th_Part,
616 MB_TAG_CREAT | MB_TAG_SPARSE, &def_part);
625 const int def_part = -1;
626 CHKERR get_moab().tag_get_handle(
"_MeshsetPartition", 1, MB_TYPE_INTEGER,
627 th_Part, MB_TAG_CREAT | MB_TAG_SPARSE,
630 CHKERR get_moab().tag_get_handle(
"_RefParentHandle", 1, MB_TYPE_HANDLE,
632 MB_TAG_CREAT | MB_TAG_SPARSE, &def_handle);
634 CHKERR get_moab().tag_get_handle(
635 "_RefBitLevel",
sizeof(
BitRefLevel), MB_TYPE_OPAQUE, th_RefBitLevel,
636 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_bit_level);
638 CHKERR get_moab().tag_get_handle(
639 "_RefBitLevelMask",
sizeof(
BitRefLevel), MB_TYPE_OPAQUE,
640 th_RefBitLevel_Mask, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
641 &def_bit_level_mask);
643 CHKERR get_moab().tag_get_handle(
644 "_RefBitEdge",
sizeof(
BitRefEdges), MB_TYPE_OPAQUE, th_RefBitEdge,
645 MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES, &def_bit_edge);
650 const unsigned long int def_id = 0;
651 CHKERR get_moab().tag_get_handle(
652 "_FieldId",
sizeof(
BitFieldId), MB_TYPE_OPAQUE, th_FieldId,
653 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
655 CHKERR get_moab().tag_get_handle(
656 "_FieldSpace",
sizeof(
FieldSpace), MB_TYPE_OPAQUE, th_FieldSpace,
657 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_space);
659 CHKERR get_moab().tag_get_handle(
661 th_FieldContinuity, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
664 CHKERR get_moab().tag_get_handle(
666 th_FieldBase, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_base);
667 const int def_val_len = 0;
668 CHKERR get_moab().tag_get_handle(
669 "_FieldName", def_val_len, MB_TYPE_OPAQUE, th_FieldName,
670 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
671 CHKERR get_moab().tag_get_handle(
672 "_FieldName_DataNamePrefix", def_val_len, MB_TYPE_OPAQUE,
673 th_FieldName_DataNamePrefix,
674 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
679 const unsigned long int def_id = 0;
680 const int def_val_len = 0;
681 CHKERR get_moab().tag_get_handle(
682 "_FEId",
sizeof(
BitFEId), MB_TYPE_OPAQUE, th_FEId,
683 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
684 CHKERR get_moab().tag_get_handle(
685 "_FEName", def_val_len, MB_TYPE_OPAQUE, th_FEName,
686 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
687 CHKERR get_moab().tag_get_handle(
688 "_FEIdCol",
sizeof(
BitFieldId), MB_TYPE_OPAQUE, th_FEIdCol,
689 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
690 CHKERR get_moab().tag_get_handle(
691 "_FEIdRow",
sizeof(
BitFieldId), MB_TYPE_OPAQUE, th_FEIdRow,
692 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
693 CHKERR get_moab().tag_get_handle(
694 "_FEIdData",
sizeof(
BitFieldId), MB_TYPE_OPAQUE, th_FEIdData,
695 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
700 const unsigned long int def_id = 0;
701 const int def_val_len = 0;
702 CHKERR get_moab().tag_get_handle(
703 "_ProblemId",
sizeof(
BitProblemId), MB_TYPE_OPAQUE, th_ProblemId,
704 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
705 CHKERR get_moab().tag_get_handle(
706 "_ProblemFEId",
sizeof(
BitFEId), MB_TYPE_OPAQUE, th_ProblemFEId,
707 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
708 CHKERR get_moab().tag_get_handle(
709 "_ProblemName", def_val_len, MB_TYPE_OPAQUE, th_ProblemName,
710 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
712 CHKERR get_moab().tag_get_handle(
713 "_ProblemNbDofsRow",
sizeof(
DofIdx), MB_TYPE_OPAQUE,
714 th_ProblemNbDofsRow, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
716 CHKERR get_moab().tag_get_handle(
717 "_ProblemNbDofsCol",
sizeof(
DofIdx), MB_TYPE_OPAQUE,
718 th_ProblemNbDofsCol, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
720 CHKERR get_moab().tag_get_handle(
721 "_ProblemLocalNbDofsRow",
sizeof(
DofIdx), MB_TYPE_OPAQUE,
722 th_ProblemLocalNbDofRow, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
724 CHKERR get_moab().tag_get_handle(
725 "_ProblemGhostNbDofsRow",
sizeof(
DofIdx), MB_TYPE_OPAQUE,
726 th_ProblemGhostNbDofRow, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
728 CHKERR get_moab().tag_get_handle(
729 "_ProblemLocalNbDofsCol",
sizeof(
DofIdx), MB_TYPE_OPAQUE,
730 th_ProblemLocalNbDofCol, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
732 CHKERR get_moab().tag_get_handle(
733 "_ProblemGhostNbDofsCol",
sizeof(
DofIdx), MB_TYPE_OPAQUE,
734 th_ProblemGhostNbDofCol, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
740 CHKERR getInterface(meshsets_manager_ptr);
745 CHKERR getInterface(series_recorder_ptr);
764 CHKERR this->getTags(verb);
765 CHKERR this->initialiseDatabaseFromMesh(verb);
770 return this->setMoabInterface(new_moab, verb);
775 return this->setMoabInterface(new_moab, verb);
783 PetscOptionsBegin(mofemComm, optionsPrefix.c_str(),
"Mesh cut options",
784 "See MoFEM documentation");
787 "-mofem_init_fields",
"Initialise fields on construction",
"",
788 initaliseAndBuildField, &initaliseAndBuildField, NULL);
791 "-mofem_init_fields",
"Initialise fields on construction",
"",
792 initaliseAndBuildFiniteElements, &initaliseAndBuildFiniteElements, NULL);
806 *fields_ptr = &fIelds;
813 *refined_entities_ptr = &refinedEntities;
819 *refined_finite_elements_ptr = &refinedFiniteElements;
824 const Problem **problem_ptr)
const {
826 typedef Problem_multiIndex::index<Problem_mi_tag>::type ProblemsByName;
828 ProblemsByName::iterator p_miit = problems.find(problem_name);
829 if (p_miit == problems.end()) {
831 "problem < %s > not found, (top tip: check spelling)",
832 problem_name.c_str());
834 *problem_ptr = &*p_miit;
841 *problems_ptr = &pRoblems;
848 *field_ents = &entsFields;
853 *dofs_ptr = &dofsField;
860 *fe_ptr = &finiteElements;
867 *fe_ent_ptr = &entsFiniteElements;
873 getInterface(meshsets_manager_ptr);
874 return meshsets_manager_ptr;
879 getInterface(meshsets_manager_ptr);
880 return meshsets_manager_ptr;
885 *dofs_elements_adjacency)
const {
887 *dofs_elements_adjacency = &entFEAdjacencies;
893 return &entFEAdjacencies;
898 return &refinedEntities;
901 return &refinedFiniteElements;
904 return &finiteElements;
907 return &entsFiniteElements;
916 "Problem of given name not found");
921template <
int V,
typename std::enable_if<(V >= 0),
int>::type * =
nullptr>
926template <
int V,
typename std::enable_if<(V < 0),
int>::type * =
nullptr>
927void set_ref_ent_basic_data_ptr_impl(boost::shared_ptr<BasicEntityData> &ptr) {
931void Core::setRefEntBasicDataPtr(MoFEM::Interface &m_field,
932 boost::shared_ptr<BasicEntityData> &ptr) {
934 switch (m_field.getValue()) {
936 set_ref_ent_basic_data_ptr_impl<-1>(ptr);
939 set_ref_ent_basic_data_ptr_impl<0>(ptr);
942 set_ref_ent_basic_data_ptr_impl<1>(ptr);
945 THROW_MESSAGE("Core index can vary from -1 to MAX_CORE_TMP");
949boost::shared_ptr<RefEntityTmp<0>>
950Core::makeSharedRefEntity(MoFEM::Interface &m_field, const EntityHandle ent) {
952 boost::shared_ptr<RefEntityTmp<0>> ref_ent_ptr;
954 switch (m_field.getValue()) {
956 ref_ent_ptr = boost::shared_ptr<RefEntityTmp<0>>(
958 new RefEntityTmp<-1>(m_field.get_basic_entity_data_ptr(), ent)
963 ref_ent_ptr = boost::shared_ptr<RefEntityTmp<0>>(
965 new RefEntityTmp<0>(m_field.get_basic_entity_data_ptr(), ent)
970 ref_ent_ptr = boost::shared_ptr<RefEntityTmp<0>>(
972 new RefEntityTmp<1>(m_field.get_basic_entity_data_ptr(), ent)
977 THROW_MESSAGE("Core index can vary from -1 to MAX_CORE_TMP");
983boost::shared_ptr<RefEntityTmp<0>>
984Core::make_shared_ref_entity(const EntityHandle ent) {
985 return this->makeSharedRefEntity(*
this, ent);
988boost::shared_ptr<RefEntityTmp<0>>
990 return this->makeSharedRefEntity(*
this, ent);
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.
void macro_is_deprecated_using_deprecated_function()
Is used to indicate that macro is deprecated Do nothing just triggers error at the compilation.
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
Multi-index container for field storage and retrieval.
#define MOFEM_LOG_C(channel, severity, format,...)
FieldApproximationBase
approximation base
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
FieldSpace
approximation spaces
@ LASTSPACE
FieldSpace in [ 0, LASTSPACE )
#define MYPCOMM_INDEX
default communicator number PCOMM
FieldContinuity
Field continuity.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
@ MOFEM_OPERATION_UNSUCCESSFUL
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
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< 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.
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
MoFEMErrorCode getTags(int verb=-1)
Get tag handles used on meshsets.
FTensor::Index< 'i', SPACE_DIM > i
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
std::bitset< BITFEID_SIZE > BitFEId
Finite element Id.
std::bitset< BITPROBLEMID_SIZE > BitProblemId
Problem Id.
std::bitset< BITFIELDID_SIZE > BitFieldId
Field Id.
std::bitset< BITREFEDGES_SIZE > BitRefEdges
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
implementation of Data Operators for Forces and Sources
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
static auto get_sub_iface_options_imp(T *const ptr, int) -> decltype(ptr->getSubInterfaceOptions())
void set_ref_ent_basic_data_ptr_impl(boost::shared_ptr< BasicEntityData > &ptr)
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
static auto get_event_options_imp(T *const ptr, int) -> decltype(ptr->getEventOptions())
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.
MoFEMErrorCode clearMap()
Cleaning database.
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Getting interface of core database.
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
MoFEMErrorCode regSubInterface()
Register sub-interfaces in core interface.
static bool isGloballyInitialised
Core base globally initialized.
const RefElement_multiIndex * get_ref_finite_elements() const
Get the ref finite elements object.
const FieldEntity_multiIndex * get_field_ents() const
Get the field ents object.
MoFEMErrorCode initialiseDatabaseFromMesh(int verb=DEFAULT_VERBOSITY)
Initialize database getting information on mesh.
MoFEMErrorCode registerSubInterfaces()
Register insterfaces.
const Field_multiIndex * get_fields() const
Get the fields object.
const Problem_multiIndex * get_problems() const
Get the problems object.
MoFEMErrorCode coreGenericConstructor(moab::Interface &moab, MPI_Comm comm, const int verbose)
const DofEntity_multiIndex * get_dofs() const
Get the dofs object.
MoFEMErrorCode getOptions(int verb=DEFAULT_VERBOSITY)
Get core options from command line.
static PetscBool isInitialized
petsc was initialised by other agent
const RefEntity_multiIndex * get_ref_ents() const
Get the ref ents object.
const FieldEntityEntFiniteElementAdjacencyMap_multiIndex * get_ents_elements_adjacency() const
Get the dofs elements adjacency object.
const EntFiniteElement_multiIndex * get_ents_finite_elements() const
Get the ents finite elements object.
const FiniteElement_multiIndex * get_finite_elements() const
Get the finite elements object.
MoFEMErrorCode addPrismToDatabase(const EntityHandle prism, int verb=DEFAULT_VERBOSITY)
add prim element
MoFEMErrorCode regEvents()
Register petsc events.
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
MoFEMErrorCode set_moab_interface(moab::Interface &new_moab, int verb=VERBOSE)
Set the moab interface object.
MoFEMErrorCode setMoabInterface(moab::Interface &new_moab, int verb=VERBOSE)
MoFEMErrorCode get_problem(const std::string &problem_name, const Problem **problem_ptr) const
Get problem database (data structure)
MoFEMErrorCode getTags(int verb=DEFAULT_VERBOSITY)
Get tag handles.
CoreTmp(moab::Interface &moab, MPI_Comm comm=PETSC_COMM_WORLD, const int verbose=VERBOSE)
static int mpiInitialised
mpi was initialised by other agent
MeshsetsManager * get_meshsets_manager_ptr()
get MeshsetsManager pointer
MoFEMErrorCode rebuild_database(int verb=DEFAULT_VERBOSITY)
Clear database and initialize it once again.
MoFEMErrorCode clear_database(int verb=DEFAULT_VERBOSITY)
Clear database.
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.
static void createDefaultSinks(MPI_Comm comm)
Create default sinks.
static PetscErrorCode logPetscFPrintf(FILE *fd, const char format[], va_list Argp)
Use to handle PETSc output.
Interface for managing meshsets containing materials and boundary conditions.
keeps basic data about problem
keeps data about abstract PRISM finite element
MoFEMErrorCode getTags(int verb=-1)
get tags handlers used on meshsets
base class for all interface classes
WrapMPIComm(MPI_Comm comm, bool petsc)