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