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