v0.16.0
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 const 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 const int getValue() const { return value; }
88 return RefEntityTmp<0>(this->basicEntityDataPtr, ent);
89 }
90
91 virtual boost::shared_ptr<RefEntityTmp<0>>
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,
433 const FieldApproximationBase base,
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,
475 const FieldApproximationBase base,
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,
506 const FieldApproximationBase base,
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
581 buildFieldForL2H1HcurlHdiv(const BitFieldId id,
582 std::map<EntityType, int> &dof_counter,
583 std::map<EntityType, int> &inactive_dof_counter,
584 int verb = DEFAULT_VERBOSITY);
585
586 MoFEMErrorCode buildField(const boost::shared_ptr<Field> &field,
587 int verb = DEFAULT_VERBOSITY);
588
589 MoFEMErrorCode build_fields(int verb = DEFAULT_VERBOSITY);
590
591 MoFEMErrorCode build_field(const std::string field_name,
592 int verb = DEFAULT_VERBOSITY);
593
594 /// \name Clear DOFs
595 MoFEMErrorCode clear_inactive_dofs(int verb = DEFAULT_VERBOSITY);
596 MoFEMErrorCode clear_dofs_fields_by_bit_ref(const BitRefLevel bit,
597 const BitRefLevel mask,
598 int verb = DEFAULT_VERBOSITY);
599 MoFEMErrorCode clear_dofs_fields(const Range ents,
600 int verb = DEFAULT_VERBOSITY);
601 MoFEMErrorCode clear_dofs_fields(const std::string name, const Range ents,
602 int verb = DEFAULT_VERBOSITY);
603
604 /// \name Clear ENTs
605 MoFEMErrorCode clear_ents_fields_by_bit_ref(const BitRefLevel bit,
606 const BitRefLevel mask,
607 int verb = DEFAULT_VERBOSITY);
608 MoFEMErrorCode clear_ents_fields(const Range ents,
609 int verb = DEFAULT_VERBOSITY);
610 MoFEMErrorCode clear_ents_fields(const std::string name, const Range ents,
611 int verb = DEFAULT_VERBOSITY);
612
613 /// \name Remove field entities
614
616 remove_ents_from_field_by_bit_ref(const BitRefLevel bit,
617 const BitRefLevel mask,
618 int verb = DEFAULT_VERBOSITY);
619 MoFEMErrorCode remove_ents_from_field(const std::string name,
620 const EntityHandle meshset,
621 const EntityType type,
622 int verb = DEFAULT_VERBOSITY);
623 MoFEMErrorCode remove_ents_from_field(const std::string name,
624 const Range ents,
625 int verb = DEFAULT_VERBOSITY);
626 MoFEMErrorCode remove_ents_from_field(const Range ents,
627 int verb = DEFAULT_VERBOSITY);
628
629 /// \name Other auxiliary functions for fields
630
631 MoFEMErrorCode list_dofs_by_field_name(const std::string &name) const;
632 MoFEMErrorCode list_fields() const;
633 BitFieldId get_field_id(const std::string &name) const;
634 FieldBitNumber get_field_bit_number(const std::string name) const;
635 std::string get_field_name(const BitFieldId id) const;
636 EntityHandle get_field_meshset(const BitFieldId id) const;
637 EntityHandle get_field_meshset(const std::string name) const;
638 MoFEMErrorCode get_field_entities_by_dimension(const std::string name,
639 int dim, Range &ents) const;
640 MoFEMErrorCode get_field_entities_by_type(const std::string name,
641 EntityType type, Range &ents) const;
642 MoFEMErrorCode get_field_entities_by_handle(const std::string name,
643 Range &ents) const;
644 bool check_field(const std::string &name) const;
645
646 const Field *get_field_structure(const std::string &name,
647 enum MoFEMTypes bh = MF_EXIST) const;
648
649 /**@}*/
650
651 /** \name Finite elements */
652
653 /**@{*/
654
655 const FiniteElement *
656 get_finite_element_structure(const std::string &name,
657 enum MoFEMTypes bh = MF_EXCL) const;
658
659 bool check_finite_element(const std::string &name) const;
660
661 MoFEMErrorCode add_finite_element(const std::string &fe_name,
662 enum MoFEMTypes bh = MF_EXCL,
663 int verb = DEFAULT_VERBOSITY);
665 modify_finite_element_adjacency_table(const std::string &fe_name,
666 const EntityType type,
667 ElementAdjacencyFunct function);
669 modify_finite_element_add_field_data(const std::string &fe_name,
670 const std::string name_filed);
672 modify_finite_element_add_field_row(const std::string &fe_name,
673 const std::string name_row);
675 modify_finite_element_add_field_col(const std::string &fe_name,
676 const std::string name_col);
678 modify_finite_element_off_field_data(const std::string &fe_name,
679 const std::string name_filed);
681 modify_finite_element_off_field_row(const std::string &fe_name,
682 const std::string name_row);
684 modify_finite_element_off_field_col(const std::string &fe_name,
685 const std::string name_col);
686 MoFEMErrorCode add_ents_to_finite_element_by_type(
687 const EntityHandle meshset, const EntityType type,
688 const std::string name, const bool recursive = true);
689 MoFEMErrorCode add_ents_to_finite_element_by_dim(const EntityHandle meshset,
690 const int dim,
691 const std::string name,
692 const bool recursive = true);
693 MoFEMErrorCode add_ents_to_finite_element_by_type(const Range ents,
694 const EntityType type,
695 const std::string name);
696 MoFEMErrorCode add_ents_to_finite_element_by_dim(const Range ents,
697 const int dim,
698 const std::string name);
699 MoFEMErrorCode add_ents_to_finite_element_by_bit_ref(
700 const BitRefLevel bit, const BitRefLevel mask, const std::string name,
701 EntityType type, int verb = DEFAULT_VERBOSITY);
703 add_ents_to_finite_element_by_MESHSET(const EntityHandle meshset,
704 const std::string &name,
705 const bool recursive = false);
706 DEPRECATED MoFEMErrorCode add_ents_to_finite_element_EntType_by_bit_ref(
707 const BitRefLevel &bit, const std::string &name, EntityType type,
708 int verb = DEFAULT_VERBOSITY);
709 DEPRECATED MoFEMErrorCode add_ents_to_finite_element_EntType_by_bit_ref(
710 const BitRefLevel &bit, const BitRefLevel &mask, const std::string &name,
711 EntityType type, int verb = DEFAULT_VERBOSITY);
712
714 remove_ents_from_finite_element_by_bit_ref(const BitRefLevel bit,
715 const BitRefLevel mask,
716 int verb = DEFAULT_VERBOSITY);
717 MoFEMErrorCode remove_ents_from_finite_element(const std::string name,
718 const EntityHandle meshset,
719 const EntityType type,
720 int verb = DEFAULT_VERBOSITY);
721 MoFEMErrorCode remove_ents_from_finite_element(const std::string name,
722 const Range ents,
723 int verb = DEFAULT_VERBOSITY);
724 MoFEMErrorCode remove_ents_from_finite_element(const Range ents,
725 int verb = DEFAULT_VERBOSITY);
726 MoFEMErrorCode delete_finite_element(const std::string name,
727 int verb = DEFAULT_VERBOSITY);
728
729 // \name Other auxiliary functions for finite element
730
731 /**
732 * \brief Get field Id
733 * @param name field name
734 * @return field id
735 */
736 BitFEId getBitFEId(const std::string &fe_name) const;
737
738 /**
739 * \brief Get field name
740 * @param id field id
741 * @return field name
742 */
743 std::string getBitFEIdName(const BitFEId id) const;
744
745 EntityHandle get_finite_element_meshset(const BitFEId id) const;
746 EntityHandle get_finite_element_meshset(const std::string name) const;
748 get_finite_element_entities_by_dimension(const std::string name, int dim,
749 Range &ents) const;
750 MoFEMErrorCode get_finite_element_entities_by_type(const std::string name,
751 EntityType type,
752 Range &ents) const;
753 MoFEMErrorCode get_finite_element_entities_by_handle(const std::string name,
754 Range &ents) const;
755 MoFEMErrorCode list_finite_elements() const;
756
757 /**@}*/
758
759 /** \name Problems */
760
761 /**@{*/
762
763 MoFEMErrorCode add_problem(const std::string &name,
764 enum MoFEMTypes bh = MF_EXCL,
765 int verb = DEFAULT_VERBOSITY);
766 bool check_problem(const std::string name);
767 MoFEMErrorCode delete_problem(const std::string name);
769 modify_problem_add_finite_element(const std::string name_problem,
770 const std::string &fe_name);
772 modify_problem_unset_finite_element(const std::string name_problem,
773 const std::string &fe_name);
775 modify_problem_ref_level_add_bit(const std::string &name_problem,
776 const BitRefLevel &bit);
778 modify_problem_ref_level_set_bit(const std::string &name_problem,
779 const BitRefLevel &bit);
781 modify_problem_mask_ref_level_add_bit(const std::string &name_problem,
782 const BitRefLevel &bit);
784 modify_problem_mask_ref_level_set_bit(const std::string &name_problem,
785 const BitRefLevel &bit);
786 BitProblemId getBitProblemId(const std::string &name) const;
787 MoFEMErrorCode list_problem() const;
788 MoFEMErrorCode clear_problem(const std::string name,
789 int verb = DEFAULT_VERBOSITY);
790 MoFEMErrorCode clear_problems(int verb = DEFAULT_VERBOSITY);
791 MoFEMErrorCode build_finite_elements(int verb = DEFAULT_VERBOSITY);
792 MoFEMErrorCode build_finite_elements(const BitRefLevel &bit,
793 int verb = DEFAULT_VERBOSITY);
794 MoFEMErrorCode build_finite_elements(const string fe_name,
795 const Range *const ents_ptr = nullptr,
796 int verb = DEFAULT_VERBOSITY);
797 MoFEMErrorCode buildFiniteElements(const boost::shared_ptr<FiniteElement> &fe,
798 const Range *ents_ptr = NULL,
799 int verb = DEFAULT_VERBOSITY);
800 MoFEMErrorCode clear_finite_elements_by_bit_ref(const BitRefLevel bit,
801 const BitRefLevel mask,
802 int verb = DEFAULT_VERBOSITY);
803 MoFEMErrorCode clear_finite_elements(const Range &ents,
804 int verb = DEFAULT_VERBOSITY);
805 MoFEMErrorCode clear_finite_elements(const std::string &fe_name,
806 const Range &ents,
807 int verb = DEFAULT_VERBOSITY);
808
810 get_problem_finite_elements_entities(const std::string name,
811 const std::string &fe_name,
812 const EntityHandle meshset);
813
814 // \name Problem building (deprecated)
815
817 build_problem_on_distributed_mesh(int verb = DEFAULT_VERBOSITY);
818 DEPRECATED MoFEMErrorCode build_problems(int verb = DEFAULT_VERBOSITY);
819
820 /**@}*/
821
822 /** \name Adjacencies */
823
824 /**@{*/
825
826 MoFEMErrorCode build_adjacencies(const Range &ents,
827 int verb = DEFAULT_VERBOSITY);
828 MoFEMErrorCode build_adjacencies(const BitRefLevel &bit,
829 int verb = DEFAULT_VERBOSITY);
830 MoFEMErrorCode build_adjacencies(const BitRefLevel &bit,
831 const BitRefLevel &mask,
832 int verb = DEFAULT_VERBOSITY);
833 MoFEMErrorCode clear_adjacencies_entities(const BitRefLevel bit,
834 const BitRefLevel mask,
835 int verb = DEFAULT_VERBOSITY);
836 MoFEMErrorCode clear_adjacencies_entities(const Range ents,
837 int verb = DEFAULT_VERBOSITY);
838 MoFEMErrorCode clear_adjacencies_entities(const std::string name,
839 const Range ents,
840 int verb = DEFAULT_VERBOSITY);
842 clear_adjacencies_finite_elements(const BitRefLevel bit,
843 const BitRefLevel mask,
844 int verb = DEFAULT_VERBOSITY);
846 clear_adjacencies_finite_elements(const Range ents,
847 int verb = DEFAULT_VERBOSITY);
849 clear_adjacencies_finite_elements(const std::string name, const Range ents,
850 int verb = DEFAULT_VERBOSITY);
851
852 /**@}*/
853
854 /** \name Methods for preforming operations on elements */
855
856 /**@{*/
857
858 MoFEMErrorCode problem_basic_method_preProcess(const Problem *problem_ptr,
859 BasicMethod &method,
860 int verb = DEFAULT_VERBOSITY);
862 problem_basic_method_preProcess(const std::string &problem_name,
863 BasicMethod &method,
864 int verb = DEFAULT_VERBOSITY);
865 MoFEMErrorCode problem_basic_method_postProcess(const Problem *problem_ptr,
866 BasicMethod &method,
867 int verb = DEFAULT_VERBOSITY);
869 problem_basic_method_postProcess(const std::string &problem_name,
870 BasicMethod &method,
871 int verb = DEFAULT_VERBOSITY);
872
873 /**
874 * @copydoc MoFEM::CoreInterface::cache_problem_entities
875 */
876 MoFEMErrorCode cache_problem_entities(const std::string prb_name,
877 CacheTupleWeakPtr cache_ptr);
878
879 MoFEMErrorCode loop_finite_elements(
880 const Problem *problem_ptr, const std::string &fe_name, FEMethod &method,
881 int lower_rank, int upper_rank,
882 boost::shared_ptr<NumeredEntFiniteElement_multiIndex> fe_ptr = nullptr,
883 MoFEMTypes bh = MF_EXIST,
885 int verb = DEFAULT_VERBOSITY);
886
887 MoFEMErrorCode loop_finite_elements(
888 const std::string problem_name, const std::string &fe_name,
889 FEMethod &method, int lower_rank, int upper_rank,
890 boost::shared_ptr<NumeredEntFiniteElement_multiIndex> fe_ptr = nullptr,
891 MoFEMTypes bh = MF_EXIST,
893 int verb = DEFAULT_VERBOSITY);
894
895 MoFEMErrorCode loop_finite_elements(
896 const std::string problem_name, const std::string &fe_name,
897 FEMethod &method,
898 boost::shared_ptr<NumeredEntFiniteElement_multiIndex> fe_ptr = nullptr,
899 MoFEMTypes bh = MF_EXIST,
901 int verb = DEFAULT_VERBOSITY);
902
903 MoFEMErrorCode loop_dofs(const Problem *problem_ptr,
904 const std::string &field_name, RowColData rc,
905 DofMethod &method, int lower_rank, int upper_rank,
906 int verb = DEFAULT_VERBOSITY);
907 MoFEMErrorCode loop_dofs(const std::string &problem_name,
908 const std::string &field_name, RowColData rc,
909 DofMethod &method, int lower_rank, int upper_rank,
910 int verb = DEFAULT_VERBOSITY);
911 MoFEMErrorCode loop_dofs(const std::string &problem_name,
912 const std::string &field_name, RowColData rc,
913 DofMethod &method, int verb = DEFAULT_VERBOSITY);
914 MoFEMErrorCode loop_dofs(const std::string &field_name, DofMethod &method,
915 int verb = DEFAULT_VERBOSITY);
916 MoFEMErrorCode loop_entities(const Problem *problem_ptr,
917 const std::string field_name, RowColData rc,
918 EntityMethod &method, int lower_rank,
919 int upper_rank, int verb = DEFAULT_VERBOSITY);
920 MoFEMErrorCode loop_entities(const std::string problem_name,
921 const std::string field_name, RowColData rc,
922 EntityMethod &method, int lower_rank,
923 int upper_rank, int verb = DEFAULT_VERBOSITY);
924 MoFEMErrorCode loop_entities(const std::string problem_name,
925 const std::string field_name, RowColData rc,
926 EntityMethod &method,
927 int verb = DEFAULT_VERBOSITY);
928 MoFEMErrorCode loop_entities(const std::string field_name,
929 EntityMethod &method,
930 Range const *const ents = nullptr,
931 int verb = DEFAULT_VERBOSITY);
932
933 /**@}*/
934
935 /** \name Accessing multi-indices */
936
937 /**@{*/
938
939 MoFEMErrorCode get_fields(const Field_multiIndex **fields_ptr) const;
941 get_ref_ents(const RefEntity_multiIndex **refined_entities_ptr) const;
942 MoFEMErrorCode get_ref_finite_elements(
943 const RefElement_multiIndex **refined_finite_elements_ptr) const;
945 get_finite_elements(const FiniteElement_multiIndex **fe_ptr) const;
946 MoFEMErrorCode get_ents_finite_elements(
947 const EntFiniteElement_multiIndex **fe_ent_ptr) const;
949 get_field_ents(const FieldEntity_multiIndex **field_ents) const;
950 MoFEMErrorCode get_dofs(const DofEntity_multiIndex **dofs_ptr) const;
951 MoFEMErrorCode get_problem(const std::string &problem_name,
952 const Problem **problem_ptr) const;
953 MoFEMErrorCode get_problems(const Problem_multiIndex **problems_ptr) const;
954 MoFEMErrorCode get_ents_elements_adjacency(
956 *dofs_elements_adjacency) const;
957
958 const Field_multiIndex *get_fields() const;
959 const RefEntity_multiIndex *get_ref_ents() const;
960 const RefElement_multiIndex *get_ref_finite_elements() const;
961 const FiniteElement_multiIndex *get_finite_elements() const;
962 const EntFiniteElement_multiIndex *get_ents_finite_elements() const;
963 const FieldEntity_multiIndex *get_field_ents() const;
964 const DofEntity_multiIndex *get_dofs() const;
965 const Problem *get_problem(const std::string problem_name) const;
966 const Problem_multiIndex *get_problems() const;
968 get_ents_elements_adjacency() const;
969
970 FieldEntityByUId::iterator
971 get_ent_field_by_name_begin(const std::string &field_name) const;
972 FieldEntityByUId::iterator
973 get_ent_field_by_name_end(const std::string &field_name) const;
974 DofEntityByUId::iterator
975 get_dofs_by_name_begin(const std::string &field_name) const;
976 DofEntityByUId::iterator
977 get_dofs_by_name_end(const std::string &field_name) const;
978 DofEntityByUId::iterator
979 get_dofs_by_name_and_ent_begin(const std::string &field_name,
980 const EntityHandle ent) const;
981 DofEntityByUId::iterator
982 get_dofs_by_name_and_ent_end(const std::string &field_name,
983 const EntityHandle ent) const;
984 DofEntityByUId::iterator
985 get_dofs_by_name_and_type_begin(const std::string &field_name,
986 const EntityType type) const;
987 DofEntityByUId::iterator
988 get_dofs_by_name_and_type_end(const std::string &field_name,
989 const EntityType ent) const;
990
991 EntFiniteElement_multiIndex::index<Unique_mi_tag>::type::iterator
992 get_fe_by_name_begin(const std::string &fe_name) const;
993 EntFiniteElement_multiIndex::index<Unique_mi_tag>::type::iterator
994 get_fe_by_name_end(const std::string &fe_name) const;
995
996 /**@}*/
997
998 /** \name Log events */
999
1000 /**@{*/
1001
1002 // Events are are using for logging and hailed by PETSc
1003
1004 PetscLogEvent MOFEM_EVENT_preProcess; ///< Event for preProcess finite element
1005 PetscLogEvent
1006 MOFEM_EVENT_operator; ///< Event for evaluating operator of finite element
1007 PetscLogEvent
1008 MOFEM_EVENT_postProcess; ///< Event for postProcess finite element
1010
1011 /**@}*/
1012
1013 /** \name Communicator */
1014
1015 /**@{*/
1016
1017 mutable MPI_Comm mofemComm; ///< MoFEM communicator
1018 mutable ParallelComm *pComm; ///< MOAB communicator structure
1019
1020 int sIze; ///< MoFEM communicator size
1021 int rAnk; ///< MOFEM communicator rank
1022
1023 /**
1024 * @return return communicator
1025 */
1026 inline MPI_Comm &get_comm() const { return mofemComm; }
1027
1028 /**
1029 * @return return communicator size
1030 */
1031 inline int get_comm_size() const { return sIze; }
1032
1033 /**
1034 * @return return communicator rank/processor
1035 */
1036 inline int get_comm_rank() const { return rAnk; }
1037
1038 /**@}*/
1039
1040protected:
1041 boost::shared_ptr<WrapMPIComm>
1042 wrapMPIMOABComm; ///< manage creation and destruction of MOAB communicator
1043
1044 int verbose; ///< Verbosity level
1045
1046 /**
1047 * \brief Hash map of pointers to interfaces
1048 */
1049 mutable boost::ptr_map<boost::typeindex::type_index, UnknownInterface> iFaces;
1050
1051 mutable int *buildMoFEM; ///< keeps flags/semaphores for different stages
1052
1053 std::string optionsPrefix; ///< Prefix for options on command line
1054
1055 PetscBool initaliseAndBuildField; ///< If true build field on database
1056 ///< initialisation
1057
1058 PetscBool initaliseAndBuildFiniteElements; // If true build finite elements on
1059 // database initialisation
1060
1061 inline static bool isGloballyInitialised = false; ///< Core base globally initialized
1062 inline static int mpiInitialised = 0; ///< mpi was initialised by other agent
1063 inline static PetscBool isInitialized = PETSC_FALSE; ///< petsc was initialised by other agent
1064 inline static std::string petscOptionsFile = "";
1065
1066 /**
1067 * @brief add problem
1068 *
1069 * @param id problem id
1070 * @param name problem name
1071 * @param verb verbosity level
1072 * @return MoFEMErrorCode
1073 */
1074 MoFEMErrorCode addProblem(const BitProblemId id, const std::string &name,
1075 int verb = DEFAULT_VERBOSITY);
1076
1077 /**
1078 * \brief Get tag handles
1079 * @param verb verbosity level
1080 * @return error code
1081 */
1082 MoFEMErrorCode getTags(int verb = DEFAULT_VERBOSITY);
1083
1084 /**
1085 * \brief Cleaning database
1086 */
1087 MoFEMErrorCode clearMap();
1088
1089 /**
1090 * @brief Register insterfaces
1091 *
1092 * @return MoFEMErrorCode
1093 */
1094 MoFEMErrorCode registerSubInterfaces();
1095
1096 /**
1097 * \brief Return unique problem Id
1098 *
1099 * Each time this function is called, it gives new unit problem Id for bit.
1100 *
1101 */
1103
1104 /**
1105 * \brief Initialize database getting information on mesh
1106 */
1107 MoFEMErrorCode initialiseDatabaseFromMesh(int verb = DEFAULT_VERBOSITY);
1108
1109 /**
1110 * @brief Get core options from command line
1111 *
1112 * @return MoFEMErrorCode
1113 */
1114 MoFEMErrorCode getOptions(int verb = DEFAULT_VERBOSITY);
1115
1116 /**
1117 * @brief Register sub-interfaces in core interface
1118 *
1119 * @tparam IFACE
1120 * @return MoFEMErrorCode
1121 */
1122 template <class IFACE> MoFEMErrorCode regSubInterface();
1123
1124 /**
1125 * @brief Register petsc events
1126 *
1127 * @tparam IFACE
1128 * @return MoFEMErrorCode
1129 */
1130 template <class IFACE> MoFEMErrorCode regEvents();
1131};
1132
1133template <> struct CoreTmp<-1> : public CoreTmp<0> {
1134
1135 static constexpr const int value = -1;
1136 const int getValue() const { return value; }
1137
1138 virtual boost::shared_ptr<RefEntityTmp<0>>
1140
1141 /**
1142 * Construct core database
1143 */
1144 CoreTmp(moab::Interface &moab, ///< MoAB interface
1145 MPI_Comm comm = PETSC_COMM_WORLD, ///< MPI communicator
1146 const int verbose = VERBOSE ///< Verbosity level
1147
1148 );
1149
1150 virtual MoFEMErrorCode set_moab_interface(moab::Interface &new_moab,
1151 int verb = VERBOSE);
1152};
1153
1155
1156} // namespace MoFEM
1157
1158#include <CoreTemplates.hpp>
1159
1160#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
Multi-index container for field storage and retrieval.
std::string type
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.
const int getValue() const
Get the core.
Definition Core.hpp:1136
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:1026
PetscLogEvent MOFEM_EVENT_createMat
Definition Core.hpp:1009
PetscBool initaliseAndBuildFiniteElements
Definition Core.hpp:1058
int get_comm_rank() const
Definition Core.hpp:1036
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:1004
int get_comm_size() const
Definition Core.hpp:1031
DofEntity_multiIndex dofsField
dofs on fields
Definition Core.hpp:310
Tag th_Part
Tag for partition number.
Definition Core.hpp:262
int verbose
Verbosity level.
Definition Core.hpp:1044
PetscBool initaliseAndBuildField
Definition Core.hpp:1055
int sIze
MoFEM communicator size.
Definition Core.hpp:1020
RefElement_multiIndex refinedFiniteElements
refined elements
Definition Core.hpp:306
int rAnk
MOFEM communicator rank.
Definition Core.hpp:1021
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:1018
PetscLogEvent MOFEM_EVENT_operator
Event for evaluating operator of finite element.
Definition Core.hpp:1006
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:1017
std::string optionsPrefix
Prefix for options on command line.
Definition Core.hpp:1053
int * buildMoFEM
keeps flags/semaphores for different stages
Definition Core.hpp:1051
Tag get_th_RefParentHandle() const
Definition Core.hpp:202
const int getValue() const
Get the core.
Definition Core.hpp:86
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:1008
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:1049
boost::shared_ptr< WrapMPIComm > wrapMPIMOABComm
manage creation and destruction of MOAB communicator
Definition Core.hpp:1042
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
const 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