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