v0.13.1
Loading...
Searching...
No Matches
Core.hpp
Go to the documentation of this file.
1/** \file Core.hpp
2 * \brief Core interface class for user interface
3 *
4 * Low level data structures not used directly by user
5 *
6 * FIXME It is a mess with names of core cpp files need better organization
7 *
8 */
9
10#ifndef __CORE_HPP__
11#define __CORE_HPP__
12
13namespace MoFEM {
14
15/**
16 * @brief Wrap MPI comminitactor such that is destroyed when is out of scope
17 *
18 */
20 WrapMPIComm(MPI_Comm comm, bool petsc);
22
23 inline auto get_comm() { return duplicatedComm; }
24
25private:
26 MPI_Comm comm;
29};
30
31// This is to have obsolete back compatibility
32struct MeshsetsManager;
33
34template <int V> struct CoreValue {};
35
36template <int N> struct CoreTmp : public CoreTmp<N - 1> {
37
38 static constexpr const int value = N;
39 const int getValue() const { return value; }
40
41 boost::shared_ptr<RefEntityTmp<0>> virtual make_shared_ref_entity(
42 const EntityHandle ent);
43
44 using CoreTmp<N - 1>::CoreTmp;
45
46 /**
47 * Construct core database
48 */
49 CoreTmp(moab::Interface &moab, ///< MoAB interface
50 MPI_Comm comm = PETSC_COMM_WORLD, ///< MPI communicator
51 const int verbose = VERBOSE ///< Verbosity level
52
53 );
54
55 MoFEMErrorCode set_moab_interface(moab::Interface &new_moab, int verb);
56};
57
58template <int N> constexpr const int CoreTmp<N>::value;
59
60/** \brief Core (interface) class
61* \ingroup mofem
62* \nosubgrouping
63
64This is the implementation of abstract MoFEM::Interface class. Similarly to the
65convention used in MoAB, we use small letters to name function of purely
66abstract classes. This is an exception used only here. For more details about
67naming functions see \ref coding_practice
68
69This class is not used directly by the user. For internal use only. It is
70database with basic functions to access data. Abstraction of this is MoFEM
71Interface structure.
72
73Such deign to hide complexities for users and allow low development
74without interfering with users modules programmer work.
75
76\todo Implement static functions for Initialization and Finalization of MoFEM.
77Those functions should keep all static variables and initialize/finalize other
78libs like PETSc. Moreover initialization functions should set error handlers,
79etc.
80
81*/
82template <> struct CoreTmp<0> : public Interface {
83
84 static constexpr int value = 0;
85 const int getValue() const { return value; }
87 return RefEntityTmp<0>(this->basicEntityDataPtr, ent);
88 }
89
90 virtual boost::shared_ptr<RefEntityTmp<0>>
92
93 /**
94 * Construct core database
95 */
96 CoreTmp(moab::Interface &moab, ///< MoAB interface
97 MPI_Comm comm = PETSC_COMM_WORLD, ///< MPI communicator
98 const int verbose = VERBOSE ///< Verbosity level
99
100 );
101
102 ~CoreTmp();
103
104 /** \name Global initialisation and finalisation */
105
106 /**@{*/
107
108 /**
109 * @brief Initializes the MoFEM database PETSc, MOAB and MPI.
110 *
111 * \note This function calls PetscInitialize, for more details see
112 * <http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscInitialize.html>
113 *
114 * Example:
115 * \code
116 *
117 * int main(int argc, char *argv[]) {
118 *
119 * // Initailise MoFEM and Petsc
120 * MoFEM::Core::Initialize(&argc, &argv, (char *)0, help);
121 *
122 * try {
123 *
124 * moab::Core mb_instance; // MoAB database
125 * moab::Interface &moab = mb_instance;
126 * MoFEM::Core core(moab); // MOFEM database
127 * MoFEM::CoreInterface &m_field = core;
128 *
129 * CHKERR foo(); // Call function
130 *
131 * }
132 * CATCH_ERRORS;
133 *
134 * return MoFEM::Core::Finalize();
135 *
136 * }
137 *
138 * \endcode
139 *
140 * @param argc count of number of command line arguments
141 * @param args the command line arguments
142 * @param file [optional] PETSc database file, also checks ~username/.petscrc
143 * * and .petscrc use NULL to not check for code specific file. Use *
144 * -skip_petscrc in the code specific file to skip the .petscrc files
145 * @param help [optional] Help message to print, use NULL for no message
146 * @return MoFEMErrorCode
147 */
148 static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[],
149 const char help[]);
150
151 /**
152 * @brief Checks for options to be called at the conclusion of the program.
153 *
154 * MPI_Finalize() is called only if the user had not called MPI_Init() before
155 * calling Initialize.
156 *
157 * \note This function calls PetscInitialize, for more details see
158 * <http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscFinalize.html>
159 *
160 * @return MoFEMErrorCode
161 */
162 static MoFEMErrorCode Finalize();
163
164 /**@}*/
165
166 /**@{*/
167
168 /** \name Static functions */
169
170 static void setRefEntBasicDataPtr(MoFEM::Interface &m_field,
171 boost::shared_ptr<BasicEntityData> &ptr);
172
173 static boost::shared_ptr<RefEntityTmp<0>>
174 makeSharedRefEntity(MoFEM::Interface &m_field, const EntityHandle ent);
175
176 /**@}&*/
177
178 /** \name Assessing interfaces **/
179
180 /**@{*/
181
182 /**
183 * \brief Getting interface of core database
184 * @param uuid unique ID of interface
185 * @param iface returned pointer to interface
186 * @return error code
187 */
188 MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
189 UnknownInterface **iface) const;
190
191 /**@}*/
192
193 /** \name Get tag handles to data on the mesh */
194
195 /**@{*/
196
197 inline Tag get_th_RefParentHandle() const { return th_RefParentHandle; }
198 inline Tag get_th_RefBitLevel() const { return th_RefBitLevel; }
199 inline Tag get_th_RefBitEdge() const { return th_RefBitEdge; }
200 inline Tag get_th_RefType() const { return th_RefType; }
201
202 /**@}*/
203
204 /** \name Auxiliary data and functions */
205
206 /**@{*/
207
208 /**
209 * Is used to check consistency. I n future properly this will be removed and
210 * replaced by other solution. It is only for internal use.
211 */
213 BUILD_FIELD = 1 << 0,
214 BUILD_FE = 1 << 1,
215 BUILD_ADJ = 1 << 2,
216 BUILD_PROBLEM = 1 << 3,
217 PARTITION_PROBLEM = 1 << 4,
218 PARTITION_FE = 1 << 5,
219 PARTITION_GHOST_DOFS = 1 << 6,
220 PARTITION_MESH = 1 << 7
221 };
222
223 /**
224 * \brief Get flags/semaphores for different stages
225 */
226 inline int &getBuildMoFEM() const { return *buildMoFEM; }
227
228 /**
229 * \brief add prim element
230 *
231 * FIXME: This is dirt solution, need to be fixed
232 *
233 * @param prism prim handle
234 * @param verb verbosity level
235 * @return error code
236 */
237 MoFEMErrorCode addPrismToDatabase(const EntityHandle prism,
238 int verb = DEFAULT_VERBOSITY);
239
240 /**@}*/
241
242protected:
243 /**
244 * Construct core database
245 */
246 template <int V>
247 CoreTmp(moab::Interface &moab, ///< MoAB interface
248 MPI_Comm comm, ///< MPI communicator
249 const int verbose, CoreValue<V>);
250
251 MoFEMErrorCode coreGenericConstructor(moab::Interface &moab, MPI_Comm comm,
252 const int verbose);
253
254 /** \name Tags to data on mesh and entities */
255
256 /**@{*/
257
258 Tag th_Part; ///< Tag for partition number
259 Tag th_RefParentHandle, th_RefBitLevel, th_RefBitLevel_Mask, th_RefBitEdge,
262 Tag th_FieldId, th_FieldName, th_FieldName_DataNamePrefix, th_FieldSpace,
264 Tag th_FEId, th_FEName;
265 Tag th_FEIdCol, th_FEIdRow, th_FEIdData;
266 Tag th_ProblemId, th_ProblemName, th_ProblemFEId;
267 Tag th_ProblemNbDofsRow, th_ProblemNbDofsCol;
268 Tag th_ProblemLocalNbDofRow, th_ProblemGhostNbDofRow;
269 Tag th_ProblemLocalNbDofCol, th_ProblemGhostNbDofCol;
271 Tag th_ElemType; ///< Needed for VTK files
272 Tag th_MoFEMBuild; ///< Internal use storing state, used to detect error and
273 ///< inconsistencies
274
275 /**
276 * @return pointer to BasicEntityData structure
277 *
278 * BasicEntityData is structure which every BasicEntity have. It keeps data
279 * about tags to handles on the mesh, in particular tag to BitRefLevel and
280 * tag with handle to parent.
281 *
282 */
283 boost::shared_ptr<BasicEntityData> basicEntityDataPtr;
284
285 /**
286 * \brief Get pointer to basic entity data.
287 *
288 * This structure keeps data like tags handlers and other data used to
289 * construct mofem entities, dofs and finite elements.
290 *
291 */
292 boost::shared_ptr<BasicEntityData> &get_basic_entity_data_ptr() {
293 return basicEntityDataPtr;
294 }
295
296 /**@}*/
297
298 /** \name Multi-Indices accessing data on the mesh */
299
300 /**@{*/
301
304
306 FieldEntity_multiIndex entsFields; ///< entities on fields
307 DofEntity_multiIndex dofsField; ///< dofs on fields
308
311
313 entFEAdjacencies; ///< adjacencies of elements to dofs
314
315 Problem_multiIndex pRoblems; ///< problems multi-index
316
317 /**@}*/
318
319 /** \name Get moab database */
320
321 /**@{*/
322
323 std::reference_wrapper<moab::Interface> moab; ///< moab database
324 inline moab::Interface &get_moab() { return moab; }
325 inline const moab::Interface &get_moab() const { return moab; }
326
327 MoFEMErrorCode set_moab_interface(moab::Interface &new_moab,
328 int verb = VERBOSE);
329
330 MoFEMErrorCode setMoabInterface(moab::Interface &new_moab,
331 int verb = VERBOSE);
332
333 /**@}*/
334
335 /** \name Check database consistency */
336
337 /**@{*/
338
340 check_number_of_ents_in_ents_field(const std::string &name) const;
341 MoFEMErrorCode check_number_of_ents_in_ents_field() const;
343 check_number_of_ents_in_ents_finite_element(const std::string &name) const;
344 MoFEMErrorCode check_number_of_ents_in_ents_finite_element() const;
345
346 /**@}*/
347
348 /** \name Clear database */
349
350 /**@{*/
351
352 MoFEMErrorCode clear_database(int verb = DEFAULT_VERBOSITY);
353 MoFEMErrorCode rebuild_database(int verb = DEFAULT_VERBOSITY);
354
355 /**@}*/
356
357 /** \name Getting access to meshset manager */
358
359 /**@{*/
360
361 MeshsetsManager *get_meshsets_manager_ptr();
362 const MeshsetsManager *get_meshsets_manager_ptr() const;
364 return *get_meshsets_manager_ptr();
365 }
366 inline const MeshsetsManager &get_meshsets_manager() const {
367 return *get_meshsets_manager_ptr();
368 }
369
370 /**@}*/
371
372 /** \name Remove and delete entities */
373
374 /**@{*/
375
376 MoFEMErrorCode remove_parents_by_ents(const Range &ents,
377 int verb = DEFAULT_VERBOSITY);
378
379 MoFEMErrorCode remove_parents_by_bit_ref(const BitRefLevel bit,
380 const BitRefLevel mask,
381 int verb = DEFAULT_VERBOSITY);
382
383 MoFEMErrorCode remove_parents_by_parents(const Range &ents,
384 int verb = DEFAULT_VERBOSITY);
385
386 MoFEMErrorCode remove_ents(const Range ents, int verb = DEFAULT_VERBOSITY);
387
388 MoFEMErrorCode remove_ents_by_bit_ref(const BitRefLevel bit,
389 const BitRefLevel mask,
390 int verb = DEFAULT_VERBOSITY);
391 MoFEMErrorCode delete_ents_by_bit_ref(const BitRefLevel bit,
392 const BitRefLevel mask,
393 const bool remove_parent = false,
394 int verb = DEFAULT_VERBOSITY,
395 MoFEMTypes mf = MF_ZERO);
396 /**@}*/
397
398 /** \name Fields */
399
400 /**@{*/
401
402 /**
403 * \brief Add filed
404 * @param name Field name
405 * @param space Space L2,H1,Hdiv,Hcurl
406 * @param base Approximation base AINSWORTH_LEGENDRE_BASE,
407 AINSWORTH_BERNSTEIN_BEZIER_BASE ...
408 * @param nb_coefficients Number of field coefficients
409 * @param tag_type Tag type, MB_TAG_DENSE or MB_TAG_SPARSE (default)
410 * @param bh Control behavior, if MF_EXCL throws error if exist
411 * @param verb Verbosity level
412 * @return Return error code
413
414 TODO: \todo MB_TAG_DENSE will not work properly in general case. It is need to
415 separate field tags for each entity separately. That will allow for HO orders
416 but homogenous approx. order on each entity. Need some discussion what is
417 optimal solution. MB_TAG_SPARSE gives flexibility, but it not memory
418 efficient. MB_TAG_DENSE uses memory more efficient and in principle allow for
419 better efficiency if properly utilized.
420
421
422 FIXME: \bug Need to resolve problem of dense tags at this stage of development
423 will make only problems
424
425 */
426 virtual MoFEMErrorCode
427 add_field(const std::string &name, const FieldSpace space,
428 const FieldApproximationBase base,
429 const FieldCoefficientsNumber nb_coefficients,
430 const TagType tag_type = MB_TAG_SPARSE,
431 const enum MoFEMTypes bh = MF_EXCL, int verb = DEFAULT_VERBOSITY);
432
433 /**
434 * @brief Delete field
435 *
436 * @param name field name
437 * @param verb verbosity level
438 * @return error code
439 */
440 MoFEMErrorCode delete_field(const std::string name,
441 int verb = DEFAULT_VERBOSITY);
442
443 /**
444 * @brief Template for add_field
445 *
446 * @tparam CoreN
447 * @param name
448 * @param space
449 * @param base
450 * @param nb_coefficients
451 * @param tag_type
452 * @param bh
453 * @param verb
454 * @return MoFEMErrorCode
455 */
456 MoFEMErrorCode addField(const std::string &name, const FieldSpace space,
457 const FieldApproximationBase base,
458 const FieldCoefficientsNumber nb_coefficients,
459 const TagType tag_type, const enum MoFEMTypes bh,
460 int verb);
461
462 MoFEMErrorCode addEntsToFieldByDim(const Range &ents, const int dim,
463 const std::string &name,
464 int verb = DEFAULT_VERBOSITY);
465 MoFEMErrorCode add_ents_to_field_by_dim(const Range &ents, const int dim,
466 const std::string &name,
467 int verb = DEFAULT_VERBOSITY);
468 MoFEMErrorCode add_ents_to_field_by_type(const Range &ents,
469 const EntityType type,
470 const std::string &name,
471 int verb = DEFAULT_VERBOSITY);
472 MoFEMErrorCode add_ents_to_field_by_dim(const EntityHandle meshset,
473 const int dim,
474 const std::string &name,
475 const bool recursive = true,
476 int verb = DEFAULT_VERBOSITY);
477 MoFEMErrorCode add_ents_to_field_by_type(const EntityHandle meshset,
478 const EntityType type,
479 const std::string &name,
480 const bool recursive = true,
481 int verb = DEFAULT_VERBOSITY);
482
483 MoFEMErrorCode create_vertices_and_add_to_field(const std::string name,
484 const double coords[],
485 int size,
486 int verb = DEFAULT_VERBOSITY);
487
488 /// \name Set approximation order
489
491 const ApproximationOrder order, int ver);
492
493 MoFEMErrorCode setFieldOrderImpl(boost::shared_ptr<Field> field_ptr,
494 const Range &ents,
495 const ApproximationOrder order, int verb);
496
497 MoFEMErrorCode set_field_order(const Range &ents, const BitFieldId id,
499 int verb = DEFAULT_VERBOSITY);
500
501 MoFEMErrorCode set_field_order(const EntityHandle meshset,
502 const EntityType type, const BitFieldId id,
504 int verb = DEFAULT_VERBOSITY);
505 MoFEMErrorCode set_field_order(const Range &ents, const std::string &name,
507 int verb = DEFAULT_VERBOSITY);
508 MoFEMErrorCode set_field_order(const EntityHandle meshset,
509 const EntityType type, const std::string &name,
511 int verb = DEFAULT_VERBOSITY);
512 MoFEMErrorCode set_field_order_by_entity_type_and_bit_ref(
513 const BitRefLevel &bit, const BitRefLevel &mask, const EntityType type,
514 const BitFieldId id, const ApproximationOrder order,
515 int verb = DEFAULT_VERBOSITY);
516 MoFEMErrorCode set_field_order_by_entity_type_and_bit_ref(
517 const BitRefLevel &bit, const BitRefLevel &mask, const EntityType type,
518 const std::string &name, const ApproximationOrder order,
519 int verb = DEFAULT_VERBOSITY);
520
521 /// \name Build fields
522
524 buildFieldForNoFieldImpl(boost::shared_ptr<Field> field_ptr,
525 std::map<EntityType, int> &dof_counter, int verb);
526
527 MoFEMErrorCode buildFieldForNoField(const BitFieldId id,
528 std::map<EntityType, int> &dof_counter,
529 int verb = DEFAULT_VERBOSITY);
530
532 buildFieldForL2H1HcurlHdiv(const BitFieldId id,
533 std::map<EntityType, int> &dof_counter,
534 std::map<EntityType, int> &inactive_dof_counter,
535 int verb = DEFAULT_VERBOSITY);
536
537 MoFEMErrorCode buildField(const boost::shared_ptr<Field> &field,
538 int verb = DEFAULT_VERBOSITY);
539
540 MoFEMErrorCode build_fields(int verb = DEFAULT_VERBOSITY);
541
542 MoFEMErrorCode build_field(const std::string field_name,
543 int verb = DEFAULT_VERBOSITY);
544
545 /// \name Clear DOFs
546 MoFEMErrorCode clear_inactive_dofs(int verb = DEFAULT_VERBOSITY);
547 MoFEMErrorCode clear_dofs_fields_by_bit_ref(const BitRefLevel bit,
548 const BitRefLevel mask,
549 int verb = DEFAULT_VERBOSITY);
550 MoFEMErrorCode clear_dofs_fields(const Range ents,
551 int verb = DEFAULT_VERBOSITY);
552 MoFEMErrorCode clear_dofs_fields(const std::string name, const Range ents,
553 int verb = DEFAULT_VERBOSITY);
554
555 /// \name Clear ENTs
556 MoFEMErrorCode clear_ents_fields_by_bit_ref(const BitRefLevel bit,
557 const BitRefLevel mask,
558 int verb = DEFAULT_VERBOSITY);
559 MoFEMErrorCode clear_ents_fields(const Range ents,
560 int verb = DEFAULT_VERBOSITY);
561 MoFEMErrorCode clear_ents_fields(const std::string name, const Range ents,
562 int verb = DEFAULT_VERBOSITY);
563
564 /// \name Remove field entities
565
567 remove_ents_from_field_by_bit_ref(const BitRefLevel bit,
568 const BitRefLevel mask,
569 int verb = DEFAULT_VERBOSITY);
570 MoFEMErrorCode remove_ents_from_field(const std::string name,
571 const EntityHandle meshset,
572 const EntityType type,
573 int verb = DEFAULT_VERBOSITY);
574 MoFEMErrorCode remove_ents_from_field(const std::string name,
575 const Range ents,
576 int verb = DEFAULT_VERBOSITY);
577 MoFEMErrorCode remove_ents_from_field(const Range ents,
578 int verb = DEFAULT_VERBOSITY);
579
580 /// \name Other auxiliary functions for fields
581
582 MoFEMErrorCode list_dofs_by_field_name(const std::string &name) const;
583 MoFEMErrorCode list_fields() const;
584 BitFieldId get_field_id(const std::string &name) const;
585 FieldBitNumber get_field_bit_number(const std::string name) const;
586 std::string get_field_name(const BitFieldId id) const;
587 EntityHandle get_field_meshset(const BitFieldId id) const;
588 EntityHandle get_field_meshset(const std::string name) const;
589 MoFEMErrorCode get_field_entities_by_dimension(const std::string name,
590 int dim, Range &ents) const;
591 MoFEMErrorCode get_field_entities_by_type(const std::string name,
592 EntityType type, Range &ents) const;
593 MoFEMErrorCode get_field_entities_by_handle(const std::string name,
594 Range &ents) const;
595 bool check_field(const std::string &name) const;
596 Field *get_field_structure(const std::string &name);
597
598 /**@}*/
599
600 /** \name Finite elements */
601
602 /**@{*/
603
604 bool check_finite_element(const std::string &name) const;
605 MoFEMErrorCode add_finite_element(const std::string &fe_name,
606 enum MoFEMTypes bh = MF_EXCL,
607 int verb = DEFAULT_VERBOSITY);
609 modify_finite_element_adjacency_table(const std::string &fe_name,
610 const EntityType type,
611 ElementAdjacencyFunct function);
613 modify_finite_element_add_field_data(const std::string &fe_name,
614 const std::string &name_filed);
616 modify_finite_element_add_field_row(const std::string &fe_name,
617 const std::string &name_row);
619 modify_finite_element_add_field_col(const std::string &fe_name,
620 const std::string &name_col);
622 modify_finite_element_off_field_data(const std::string &fe_name,
623 const std::string &name_filed);
625 modify_finite_element_off_field_row(const std::string &fe_name,
626 const std::string &name_row);
628 modify_finite_element_off_field_col(const std::string &fe_name,
629 const std::string &name_col);
630 MoFEMErrorCode add_ents_to_finite_element_by_type(
631 const EntityHandle meshset, const EntityType type,
632 const std::string &name, const bool recursive = true);
633 MoFEMErrorCode add_ents_to_finite_element_by_dim(const EntityHandle meshset,
634 const int dim,
635 const std::string &name,
636 const bool recursive = true);
637 MoFEMErrorCode add_ents_to_finite_element_by_type(const Range &ents,
638 const EntityType type,
639 const std::string &name);
640 MoFEMErrorCode add_ents_to_finite_element_by_dim(const Range &ents,
641 const int dim,
642 const std::string &name);
643 MoFEMErrorCode add_ents_to_finite_element_by_bit_ref(
644 const BitRefLevel &bit, const BitRefLevel &mask, const std::string &name,
645 EntityType type, int verb = DEFAULT_VERBOSITY);
647 add_ents_to_finite_element_by_MESHSET(const EntityHandle meshset,
648 const std::string &name,
649 const bool recursive = false);
650 DEPRECATED MoFEMErrorCode add_ents_to_finite_element_EntType_by_bit_ref(
651 const BitRefLevel &bit, const std::string &name, EntityType type,
652 int verb = DEFAULT_VERBOSITY);
653 DEPRECATED MoFEMErrorCode add_ents_to_finite_element_EntType_by_bit_ref(
654 const BitRefLevel &bit, const BitRefLevel &mask, const std::string &name,
655 EntityType type, int verb = DEFAULT_VERBOSITY);
656
658 remove_ents_from_finite_element_by_bit_ref(const BitRefLevel bit,
659 const BitRefLevel mask,
660 int verb = DEFAULT_VERBOSITY);
661 MoFEMErrorCode remove_ents_from_finite_element(const std::string name,
662 const EntityHandle meshset,
663 const EntityType type,
664 int verb = DEFAULT_VERBOSITY);
665 MoFEMErrorCode remove_ents_from_finite_element(const std::string name,
666 const Range ents,
667 int verb = DEFAULT_VERBOSITY);
668 MoFEMErrorCode remove_ents_from_finite_element(const Range ents,
669 int verb = DEFAULT_VERBOSITY);
670 MoFEMErrorCode delete_finite_element(const std::string name,
671 int verb = DEFAULT_VERBOSITY);
672
673 // \name Other auxiliary functions for finite element
674
675 /**
676 * \brief Get field Id
677 * @param name field name
678 * @return field id
679 */
680 BitFEId getBitFEId(const std::string &name) const;
681
682 /**
683 * \brief Get field name
684 * @param id field id
685 * @return field name
686 */
687 std::string getBitFEIdName(const BitFEId id) const;
688 EntityHandle get_finite_element_meshset(const BitFEId id) const;
689 EntityHandle get_finite_element_meshset(const std::string &name) const;
691 get_finite_element_entities_by_dimension(const std::string name, int dim,
692 Range &ents) const;
693 MoFEMErrorCode get_finite_element_entities_by_type(const std::string name,
694 EntityType type,
695 Range &ents) const;
696 MoFEMErrorCode get_finite_element_entities_by_handle(const std::string name,
697 Range &ents) const;
698 MoFEMErrorCode list_finite_elements() const;
699
700 /**@}*/
701
702 /** \name Problems */
703
704 /**@{*/
705
706 MoFEMErrorCode add_problem(const std::string &name,
707 enum MoFEMTypes bh = MF_EXCL,
708 int verb = DEFAULT_VERBOSITY);
709 bool check_problem(const std::string name);
710 MoFEMErrorCode delete_problem(const std::string name);
712 modify_problem_add_finite_element(const std::string &name_problem,
713 const std::string &MoFEMFiniteElement_name);
714 MoFEMErrorCode modify_problem_unset_finite_element(
715 const std::string &name_problem,
716 const std::string &MoFEMFiniteElement_name);
718 modify_problem_ref_level_add_bit(const std::string &name_problem,
719 const BitRefLevel &bit);
721 modify_problem_ref_level_set_bit(const std::string &name_problem,
722 const BitRefLevel &bit);
724 modify_problem_mask_ref_level_add_bit(const std::string &name_problem,
725 const BitRefLevel &bit);
727 modify_problem_mask_ref_level_set_bit(const std::string &name_problem,
728 const BitRefLevel &bit);
729 BitProblemId getBitProblemId(const std::string &name) const;
730 MoFEMErrorCode list_problem() const;
731 MoFEMErrorCode clear_problem(const std::string name,
732 int verb = DEFAULT_VERBOSITY);
733 MoFEMErrorCode clear_problems(int verb = DEFAULT_VERBOSITY);
734 MoFEMErrorCode build_finite_elements(int verb = DEFAULT_VERBOSITY);
735 MoFEMErrorCode build_finite_elements(const BitRefLevel &bit,
736 int verb = DEFAULT_VERBOSITY);
737 MoFEMErrorCode build_finite_elements(const string fe_name,
738 const Range *const ents_ptr = nullptr,
739 int verb = DEFAULT_VERBOSITY);
740 MoFEMErrorCode buildFiniteElements(const boost::shared_ptr<FiniteElement> &fe,
741 const Range *ents_ptr = NULL,
742 int verb = DEFAULT_VERBOSITY);
743 MoFEMErrorCode clear_finite_elements_by_bit_ref(const BitRefLevel bit,
744 const BitRefLevel mask,
745 int verb = DEFAULT_VERBOSITY);
746 MoFEMErrorCode clear_finite_elements(const Range ents,
747 int verb = DEFAULT_VERBOSITY);
748 MoFEMErrorCode clear_finite_elements(const std::string name, const Range ents,
749 int verb = DEFAULT_VERBOSITY);
750
752 get_problem_finite_elements_entities(const std::string &name,
753 const std::string &fe_name,
754 const EntityHandle meshset);
755
756 // \name Problem building (deprecated)
757
759 build_problem_on_distributed_mesh(int verb = DEFAULT_VERBOSITY);
760 DEPRECATED MoFEMErrorCode build_problems(int verb = DEFAULT_VERBOSITY);
761
762 /**@}*/
763
764 /** \name Adjacencies */
765
766 /**@{*/
767
768 MoFEMErrorCode build_adjacencies(const Range &ents,
769 int verb = DEFAULT_VERBOSITY);
770 MoFEMErrorCode build_adjacencies(const BitRefLevel &bit,
771 int verb = DEFAULT_VERBOSITY);
772 MoFEMErrorCode build_adjacencies(const BitRefLevel &bit,
773 const BitRefLevel &mask,
774 int verb = DEFAULT_VERBOSITY);
775 MoFEMErrorCode clear_adjacencies_entities(const BitRefLevel bit,
776 const BitRefLevel mask,
777 int verb = DEFAULT_VERBOSITY);
778 MoFEMErrorCode clear_adjacencies_entities(const Range ents,
779 int verb = DEFAULT_VERBOSITY);
780 MoFEMErrorCode clear_adjacencies_entities(const std::string name,
781 const Range ents,
782 int verb = DEFAULT_VERBOSITY);
784 clear_adjacencies_finite_elements(const BitRefLevel bit,
785 const BitRefLevel mask,
786 int verb = DEFAULT_VERBOSITY);
788 clear_adjacencies_finite_elements(const Range ents,
789 int verb = DEFAULT_VERBOSITY);
791 clear_adjacencies_finite_elements(const std::string name, const Range ents,
792 int verb = DEFAULT_VERBOSITY);
793
794 /**@}*/
795
796 /** \name Methods for preforming operations on elements */
797
798 /**@{*/
799
800 MoFEMErrorCode problem_basic_method_preProcess(const Problem *problem_ptr,
801 BasicMethod &method,
802 int verb = DEFAULT_VERBOSITY);
804 problem_basic_method_preProcess(const std::string &problem_name,
805 BasicMethod &method,
806 int verb = DEFAULT_VERBOSITY);
807 MoFEMErrorCode problem_basic_method_postProcess(const Problem *problem_ptr,
808 BasicMethod &method,
809 int verb = DEFAULT_VERBOSITY);
811 problem_basic_method_postProcess(const std::string &problem_name,
812 BasicMethod &method,
813 int verb = DEFAULT_VERBOSITY);
814
815 /**
816 * @copydoc MoFEM::CoreInterface::cache_problem_entities
817 */
818 MoFEMErrorCode cache_problem_entities(const std::string prb_name,
819 CacheTupleWeakPtr cache_ptr);
820
821 MoFEMErrorCode loop_finite_elements(
822 const Problem *problem_ptr, const std::string &fe_name, FEMethod &method,
823 int lower_rank, int upper_rank,
824 boost::shared_ptr<NumeredEntFiniteElement_multiIndex> fe_ptr = nullptr,
825 MoFEMTypes bh = MF_EXIST,
827 int verb = DEFAULT_VERBOSITY);
828
829 MoFEMErrorCode loop_finite_elements(
830 const std::string &problem_name, const std::string &fe_name,
831 FEMethod &method, int lower_rank, int upper_rank,
832 boost::shared_ptr<NumeredEntFiniteElement_multiIndex> fe_ptr = nullptr,
833 MoFEMTypes bh = MF_EXIST,
835 int verb = DEFAULT_VERBOSITY);
836
837 MoFEMErrorCode loop_finite_elements(
838 const std::string &problem_name, const std::string &fe_name,
839 FEMethod &method,
840 boost::shared_ptr<NumeredEntFiniteElement_multiIndex> fe_ptr = nullptr,
841 MoFEMTypes bh = MF_EXIST,
843 int verb = DEFAULT_VERBOSITY);
844
845 MoFEMErrorCode loop_dofs(const Problem *problem_ptr,
846 const std::string &field_name, RowColData rc,
847 DofMethod &method, int lower_rank, int upper_rank,
848 int verb = DEFAULT_VERBOSITY);
849 MoFEMErrorCode loop_dofs(const std::string &problem_name,
850 const std::string &field_name, RowColData rc,
851 DofMethod &method, int lower_rank, int upper_rank,
852 int verb = DEFAULT_VERBOSITY);
853 MoFEMErrorCode loop_dofs(const std::string &problem_name,
854 const std::string &field_name, RowColData rc,
855 DofMethod &method, int verb = DEFAULT_VERBOSITY);
856 MoFEMErrorCode loop_dofs(const std::string &field_name, DofMethod &method,
857 int verb = DEFAULT_VERBOSITY);
858 MoFEMErrorCode loop_entities(const Problem *problem_ptr,
859 const std::string field_name, RowColData rc,
860 EntityMethod &method, int lower_rank,
861 int upper_rank, int verb = DEFAULT_VERBOSITY);
862 MoFEMErrorCode loop_entities(const std::string problem_name,
863 const std::string field_name, RowColData rc,
864 EntityMethod &method, int lower_rank,
865 int upper_rank, int verb = DEFAULT_VERBOSITY);
866 MoFEMErrorCode loop_entities(const std::string problem_name,
867 const std::string field_name, RowColData rc,
868 EntityMethod &method,
869 int verb = DEFAULT_VERBOSITY);
870 MoFEMErrorCode loop_entities(const std::string field_name,
871 EntityMethod &method,
872 Range const *const ents = nullptr,
873 int verb = DEFAULT_VERBOSITY);
874
875 /**@}*/
876
877 /** \name Accessing multi-indices */
878
879 /**@{*/
880
881 MoFEMErrorCode get_fields(const Field_multiIndex **fields_ptr) const;
883 get_ref_ents(const RefEntity_multiIndex **refined_entities_ptr) const;
884 MoFEMErrorCode get_ref_finite_elements(
885 const RefElement_multiIndex **refined_finite_elements_ptr) const;
887 get_finite_elements(const FiniteElement_multiIndex **fe_ptr) const;
888 MoFEMErrorCode get_ents_finite_elements(
889 const EntFiniteElement_multiIndex **fe_ent_ptr) const;
891 get_field_ents(const FieldEntity_multiIndex **field_ents) const;
892 MoFEMErrorCode get_dofs(const DofEntity_multiIndex **dofs_ptr) const;
893 MoFEMErrorCode get_problem(const std::string &problem_name,
894 const Problem **problem_ptr) const;
895 MoFEMErrorCode get_problems(const Problem_multiIndex **problems_ptr) const;
896 MoFEMErrorCode get_ents_elements_adjacency(
898 *dofs_elements_adjacency) const;
899
900 const Field_multiIndex *get_fields() const;
901 const RefEntity_multiIndex *get_ref_ents() const;
902 const RefElement_multiIndex *get_ref_finite_elements() const;
903 const FiniteElement_multiIndex *get_finite_elements() const;
904 const EntFiniteElement_multiIndex *get_ents_finite_elements() const;
905 const FieldEntity_multiIndex *get_field_ents() const;
906 const DofEntity_multiIndex *get_dofs() const;
907 const Problem *get_problem(const std::string problem_name) const;
908 const Problem_multiIndex *get_problems() const;
910 get_ents_elements_adjacency() const;
911
912 FieldEntityByUId::iterator
913 get_ent_field_by_name_begin(const std::string &field_name) const;
914 FieldEntityByUId::iterator
915 get_ent_field_by_name_end(const std::string &field_name) const;
916 DofEntityByUId::iterator
917 get_dofs_by_name_begin(const std::string &field_name) const;
918 DofEntityByUId::iterator
919 get_dofs_by_name_end(const std::string &field_name) const;
920 DofEntityByUId::iterator
921 get_dofs_by_name_and_ent_begin(const std::string &field_name,
922 const EntityHandle ent) const;
923 DofEntityByUId::iterator
924 get_dofs_by_name_and_ent_end(const std::string &field_name,
925 const EntityHandle ent) const;
926 DofEntityByUId::iterator
927 get_dofs_by_name_and_type_begin(const std::string &field_name,
928 const EntityType type) const;
929 DofEntityByUId::iterator
930 get_dofs_by_name_and_type_end(const std::string &field_name,
931 const EntityType ent) const;
932 EntFiniteElementByName::iterator
933 get_fe_by_name_begin(const std::string &fe_name) const;
934 EntFiniteElementByName::iterator
935 get_fe_by_name_end(const std::string &fe_name) const;
936
937 /**@}*/
938
939 /** \name Log events */
940
941 /**@{*/
942
943 // Events are are using for logging and hailed by PETSc
944
945 PetscLogEvent MOFEM_EVENT_preProcess; ///< Event for preProcess finite element
946 PetscLogEvent
947 MOFEM_EVENT_operator; ///< Event for evaluating operator of finite element
948 PetscLogEvent
949 MOFEM_EVENT_postProcess; ///< Event for postProcess finite element
951
952 /**@}*/
953
954 /** \name Communicator */
955
956 /**@{*/
957
958 mutable MPI_Comm mofemComm; ///< MoFEM communicator
959 mutable ParallelComm *pComm; ///< MOAB communicator structure
960
961 int sIze; ///< MoFEM communicator size
962 int rAnk; ///< MOFEM communicator rank
963
964 /**
965 * @return return communicator
966 */
967 inline MPI_Comm &get_comm() const { return mofemComm; }
968
969 /**
970 * @return return communicator size
971 */
972 inline int get_comm_size() const { return sIze; }
973
974 /**
975 * @return return communicator rank/processor
976 */
977 inline int get_comm_rank() const { return rAnk; }
978
979 /**@}*/
980
981protected:
982 boost::shared_ptr<WrapMPIComm>
983 wrapMPIMOABComm; ///< manage creation and destruction of MOAB communicator
984
985 int verbose; ///< Verbosity level
986
987 /**
988 * \brief Hash map of pointers to interfaces
989 */
990 mutable boost::ptr_map<boost::typeindex::type_index, UnknownInterface> iFaces;
991
992 mutable int *buildMoFEM; ///< keeps flags/semaphores for different stages
993
994 std::string optionsPrefix; ///< Prefix for options on command line
995
996 PetscBool initaliseAndBuildField; ///< If true build field on database
997 ///< initialisation
998
999 PetscBool initaliseAndBuildFiniteElements; // If true build finite elements on
1000 // database initialisation
1001
1002 static bool isGloballyInitialised; ///< Core base globally initialized
1003 static int mpiInitialised; ///< mpi was initialised by other agent
1004 static PetscBool isInitialized; ///< petsc was initialised by other agent
1005
1006 /**
1007 * @brief add problem
1008 *
1009 * @param id problem id
1010 * @param name problem name
1011 * @param verb verbosity level
1012 * @return MoFEMErrorCode
1013 */
1014 MoFEMErrorCode addProblem(const BitProblemId id, const std::string &name,
1015 int verb = DEFAULT_VERBOSITY);
1016
1017 /**
1018 * \brief Get tag handles
1019 * @param verb verbosity level
1020 * @return error code
1021 */
1022 MoFEMErrorCode getTags(int verb = DEFAULT_VERBOSITY);
1023
1024 /**
1025 * \brief Cleaning database
1026 */
1027 MoFEMErrorCode clearMap();
1028
1029 /**
1030 * @brief Register insterfaces
1031 *
1032 * @return MoFEMErrorCode
1033 */
1034 MoFEMErrorCode registerSubInterfaces();
1035
1036 /**
1037 * \brief Return unique problem Id
1038 *
1039 * Each time this function is called, it gives new unit problem Id for bit.
1040 *
1041 */
1043
1044 /**
1045 * \brief Initialize database getting information on mesh
1046 */
1047 MoFEMErrorCode initialiseDatabaseFromMesh(int verb = DEFAULT_VERBOSITY);
1048
1049 /**
1050 * @brief Get core options from command line
1051 *
1052 * @return MoFEMErrorCode
1053 */
1054 MoFEMErrorCode getOptions(int verb = DEFAULT_VERBOSITY);
1055
1056 /**
1057 * @brief Register subinterfac in core interface
1058 *
1059 * @tparam IFACE
1060 * @return MoFEMErrorCode
1061 */
1062 template <class IFACE> MoFEMErrorCode regSubInterface();
1063};
1064
1065template <> struct CoreTmp<-1> : public CoreTmp<0> {
1066
1067 static constexpr const int value = -1;
1068 const int getValue() const { return value; }
1069
1070 virtual boost::shared_ptr<RefEntityTmp<0>>
1072
1073 /**
1074 * Construct core database
1075 */
1076 CoreTmp(moab::Interface &moab, ///< MoAB interface
1077 MPI_Comm comm = PETSC_COMM_WORLD, ///< MPI communicator
1078 const int verbose = VERBOSE ///< Verbosity level
1079
1080 );
1081
1082 virtual MoFEMErrorCode set_moab_interface(moab::Interface &new_moab,
1083 int verb = VERBOSE);
1084};
1085
1087
1088} // namespace MoFEM
1089
1090#include <CoreTemplates.hpp>
1091
1092#endif // __CORE_HPP__
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.
Core interface class for user interface.
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.
static char help[]
@ DEFAULT_VERBOSITY
Definition: definitions.h:207
@ VERBOSE
Definition: definitions.h:209
RowColData
RowColData.
Definition: definitions.h:123
MoFEMTypes
Those types control how functions respond on arguments, f.e. error handling.
Definition: definitions.h:97
@ MF_ZERO
Definition: definitions.h:98
@ MF_EXIST
Definition: definitions.h:100
@ MF_EXCL
Definition: definitions.h:99
FieldApproximationBase
approximation base
Definition: definitions.h:58
FieldSpace
approximation spaces
Definition: definitions.h:82
#define DEPRECATED
Definition: definitions.h:17
const int dim
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 > >, ordered_non_unique< tag< FiniteElement_name_mi_tag >, const_mem_fun< EntFiniteElement::interface_type_FiniteElement, boost::string_ref, &EntFiniteElement::getNameRef > >, ordered_non_unique< tag< Composite_Name_And_Ent_mi_tag >, composite_key< EntFiniteElement, const_mem_fun< EntFiniteElement::interface_type_FiniteElement, boost::string_ref, &EntFiniteElement::getNameRef >, const_mem_fun< EntFiniteElement::interface_type_RefEntity, EntityHandle, &EntFiniteElement::getEnt > > > > > EntFiniteElement_multiIndex
MultiIndex container for EntFiniteElement.
multi_index_container< Problem, indexed_by< ordered_unique< tag< Meshset_mi_tag >, member< Problem, EntityHandle, &Problem::meshset > >, hashed_unique< tag< BitProblemId_mi_tag >, const_mem_fun< Problem, BitProblemId, &Problem::getId >, HashBit< BitProblemId >, EqBit< BitProblemId > >, hashed_unique< tag< Problem_mi_tag >, const_mem_fun< Problem, std::string, &Problem::getName > > > > Problem_multiIndex
MultiIndex for entities for Problem.
boost::function< MoFEMErrorCode(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)> ElementAdjacencyFunct
user adjacency function
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.
auto bit
set bit
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
std::bitset< BITFEID_SIZE > BitFEId
Finite element Id.
Definition: Types.hpp:43
std::bitset< BITPROBLEMID_SIZE > BitProblemId
Problem Id.
Definition: Types.hpp:44
int ApproximationOrder
Approximation on the entity.
Definition: Types.hpp:26
std::bitset< BITFIELDID_SIZE > BitFieldId
Field Id.
Definition: Types.hpp:42
int FieldCoefficientsNumber
Number of field coefficients.
Definition: Types.hpp:27
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:40
char FieldBitNumber
Field bit number.
Definition: Types.hpp:28
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
boost::shared_ptr< CacheTuple > CacheTupleSharedPtr
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
boost::weak_ptr< CacheTuple > CacheTupleWeakPtr
constexpr auto field_name
const int N
Definition: speed_test.cpp:3
Data structure to exchange data between mofem and User Loop Methods.
const int getValue() const
Get the core.
Definition: Core.hpp:1068
Core (interface) class.
Definition: Core.hpp:82
boost::shared_ptr< BasicEntityData > & get_basic_entity_data_ptr()
Get pointer to basic entity data.
Definition: Core.hpp:292
const MeshsetsManager & get_meshsets_manager() const
get MeshsetsManager pointer
Definition: Core.hpp:366
MPI_Comm & get_comm() const
Definition: Core.hpp:967
PetscLogEvent MOFEM_EVENT_createMat
Definition: Core.hpp:950
static bool isGloballyInitialised
Core base globally initialized.
Definition: Core.hpp:1002
PetscBool initaliseAndBuildFiniteElements
Definition: Core.hpp:999
Tag th_ProblemNbDofsCol
Definition: Core.hpp:267
int get_comm_rank() const
Definition: Core.hpp:977
FiniteElement_multiIndex finiteElements
finite elements
Definition: Core.hpp:309
const moab::Interface & get_moab() const
Definition: Core.hpp:325
FieldEntity_multiIndex entsFields
entities on fields
Definition: Core.hpp:306
Field_multiIndex fIelds
fields
Definition: Core.hpp:305
EntFiniteElement_multiIndex entsFiniteElements
finite element entities
Definition: Core.hpp:310
int & getBuildMoFEM() const
Get flags/semaphores for different stages.
Definition: Core.hpp:226
PetscLogEvent MOFEM_EVENT_preProcess
Event for preProcess finite element.
Definition: Core.hpp:945
int get_comm_size() const
Definition: Core.hpp:972
DofEntity_multiIndex dofsField
dofs on fields
Definition: Core.hpp:307
Tag th_Part
Tag for partition number.
Definition: Core.hpp:258
static PetscBool isInitialized
petsc was initialised by other agent
Definition: Core.hpp:1004
int verbose
Verbosity level.
Definition: Core.hpp:985
PetscBool initaliseAndBuildField
Definition: Core.hpp:996
int sIze
MoFEM communicator size.
Definition: Core.hpp:961
RefElement_multiIndex refinedFiniteElements
refined elements
Definition: Core.hpp:303
int rAnk
MOFEM communicator rank.
Definition: Core.hpp:962
Tag th_ElemType
Needed for VTK files.
Definition: Core.hpp:271
RefEntity_multiIndex refinedEntities
refined entities
Definition: Core.hpp:302
MeshsetsManager & get_meshsets_manager()
get MeshsetsManager pointer
Definition: Core.hpp:363
ParallelComm * pComm
MOAB communicator structure.
Definition: Core.hpp:959
PetscLogEvent MOFEM_EVENT_operator
Event for evaluating operator of finite element.
Definition: Core.hpp:947
Tag get_th_RefBitLevel() const
Definition: Core.hpp:198
BitProblemId getProblemShift()
Return unique problem Id.
moab::Interface & get_moab()
Definition: Core.hpp:324
MPI_Comm mofemComm
MoFEM communicator.
Definition: Core.hpp:958
std::string optionsPrefix
Prefix for options on command line.
Definition: Core.hpp:994
int * buildMoFEM
keeps flags/semaphores for different stages
Definition: Core.hpp:992
Tag get_th_RefParentHandle() const
Definition: Core.hpp:197
const int getValue() const
Get the core.
Definition: Core.hpp:85
bool check_problem(const std::string name)
check if problem exist
static int mpiInitialised
mpi was initialised by other agent
Definition: Core.hpp:1003
Tag th_ProblemGhostNbDofRow
Definition: Core.hpp:268
PetscLogEvent MOFEM_EVENT_postProcess
Event for postProcess finite element.
Definition: Core.hpp:949
boost::shared_ptr< BasicEntityData > basicEntityDataPtr
Definition: Core.hpp:283
std::reference_wrapper< moab::Interface > moab
moab database
Definition: Core.hpp:323
Tag get_th_RefType() const
Definition: Core.hpp:200
FieldEntityEntFiniteElementAdjacencyMap_multiIndex entFEAdjacencies
adjacencies of elements to dofs
Definition: Core.hpp:313
Problem_multiIndex pRoblems
problems multi-index
Definition: Core.hpp:315
Tag th_ProblemGhostNbDofCol
Definition: Core.hpp:269
Tag get_th_RefBitEdge() const
Definition: Core.hpp:199
MoFEMErrorCode setFieldOrder(const Range &ents, const BitFieldId id, const ApproximationOrder order, int ver)
boost::ptr_map< boost::typeindex::type_index, UnknownInterface > iFaces
Hash map of pointers to interfaces.
Definition: Core.hpp:990
boost::shared_ptr< WrapMPIComm > wrapMPIMOABComm
manage creation and destruction of MOAB communicator
Definition: Core.hpp:983
RefEntityTmp< 0 > getRefEntity(const EntityHandle ent)
Definition: Core.hpp:86
MoFEMErrorCode set_moab_interface(moab::Interface &new_moab, int verb)
static constexpr const int value
Definition: Core.hpp:38
const int getValue() const
Definition: Core.hpp:39
virtual boost::shared_ptr< RefEntityTmp< 0 > > make_shared_ref_entity(const EntityHandle ent)
Deprecated interface functions.
Data structure to exchange data between mofem and User Loop Methods on entities.
Data structure to exchange data between mofem and User Loop Methods on entities.
structure for User Loop Methods on finite elements
Provide data structure for (tensor) field approximation.
Interface for managing meshsets containing materials and boundary conditions.
keeps basic data about problem
base class for all interface classes
Wrap MPI comminitactor such that is destroyed when is out of scope.
Definition: Core.hpp:19
MPI_Comm duplicatedComm
Definition: Core.hpp:27
auto get_comm()
Definition: Core.hpp:23
MPI_Comm comm
Definition: Core.hpp:26
bool isPetscComm
Definition: Core.hpp:28