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 filed
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 tag_type Tag type, MB_TAG_DENSE or MB_TAG_SPARSE (default)
409  * @param bh Control behavior, if MF_EXCL throws error if exist
410  * @param verb Verbosity level
411  * @return Return error code
412 
413  TODO: \todo MB_TAG_DENSE will not work properly in general case. It is need to
414  separate field tags for each entity separately. That will allow for HO orders
415  but homogenous approx. order on each entity. Need some discussion what is
416  optimal solution. MB_TAG_SPARSE gives flexibility, but it not memory
417  efficient. MB_TAG_DENSE uses memory more efficient and in principle allow for
418  better efficiency if properly utilized.
419 
420 
421  FIXME: \bug Need to resolve problem of dense tags at this stage of development
422  will make only problems
423 
424  */
425  virtual MoFEMErrorCode
426  add_broken_field(const std::string &name, const FieldSpace space,
427  const FieldApproximationBase base,
428  const FieldCoefficientsNumber nb_coefficients,
429  const TagType tag_type = MB_TAG_SPARSE,
430  const enum MoFEMTypes bh = MF_EXCL,
431  int verb = DEFAULT_VERBOSITY);
432 
433  /**@{*/
434 
435  /**
436  * \brief Add filed
437  * @param name Field name
438  * @param space Space L2,H1,Hdiv,Hcurl
439  * @param continuity Field continuity (you can set broken space)
440  * @param base Approximation base AINSWORTH_LEGENDRE_BASE,
441  AINSWORTH_BERNSTEIN_BEZIER_BASE ...
442  * @param nb_coefficients Number of field coefficients
443  * @param tag_type Tag type, MB_TAG_DENSE or MB_TAG_SPARSE (default)
444  * @param bh Control behavior, if MF_EXCL throws error if exist
445  * @param verb Verbosity level
446  * @return Return error code
447 
448  TODO: \todo MB_TAG_DENSE will not work properly in general case. It is need to
449  separate field tags for each entity separately. That will allow for HO orders
450  but homogenous approx. order on each entity. Need some discussion what is
451  optimal solution. MB_TAG_SPARSE gives flexibility, but it not memory
452  efficient. MB_TAG_DENSE uses memory more efficient and in principle allow for
453  better efficiency if properly utilized.
454 
455 
456  FIXME: \bug Need to resolve problem of dense tags at this stage of development
457  will make only problems
458 
459  */
460  virtual MoFEMErrorCode
461  add_field(const std::string &name, const FieldSpace space,
462  const FieldApproximationBase base,
463  const FieldCoefficientsNumber nb_coefficients,
464  const TagType tag_type = MB_TAG_SPARSE,
465  const enum MoFEMTypes bh = MF_EXCL, int verb = DEFAULT_VERBOSITY);
466 
467  /**
468  * @brief Delete field
469  *
470  * @param name field name
471  * @param verb verbosity level
472  * @return error code
473  */
474  MoFEMErrorCode delete_field(const std::string name,
475  int verb = DEFAULT_VERBOSITY);
476 
477  /**
478  * @brief Template for add_field
479  *
480  * @tparam CoreN
481  * @param name
482  * @param space
483  * @parma continuity
484  * @param base
485  * @param nb_coefficients
486  * @param tag_type
487  * @param bh
488  * @param verb
489  * @return MoFEMErrorCode
490  */
491  MoFEMErrorCode addField(const std::string &name, const FieldSpace space,
492  const FieldContinuity continuity,
493  const FieldApproximationBase base,
494  const FieldCoefficientsNumber nb_coefficients,
495  const TagType tag_type, const enum MoFEMTypes bh,
496  int verb);
497 
498  MoFEMErrorCode addEntsToFieldByDim(const Range &ents, const int dim,
499  const std::string &name,
500  int verb = DEFAULT_VERBOSITY);
501  MoFEMErrorCode add_ents_to_field_by_dim(const Range &ents, const int dim,
502  const std::string &name,
503  int verb = DEFAULT_VERBOSITY);
504  MoFEMErrorCode add_ents_to_field_by_type(const Range &ents,
505  const EntityType type,
506  const std::string &name,
507  int verb = DEFAULT_VERBOSITY);
508  MoFEMErrorCode add_ents_to_field_by_dim(const EntityHandle meshset,
509  const int dim,
510  const std::string &name,
511  const bool recursive = true,
512  int verb = DEFAULT_VERBOSITY);
513  MoFEMErrorCode add_ents_to_field_by_type(const EntityHandle meshset,
514  const EntityType type,
515  const std::string &name,
516  const bool recursive = true,
517  int verb = DEFAULT_VERBOSITY);
518 
519  MoFEMErrorCode create_vertices_and_add_to_field(const std::string name,
520  const double coords[],
521  int size,
522  int verb = DEFAULT_VERBOSITY);
523 
524  /// \name Set approximation order
525 
526  MoFEMErrorCode setFieldOrder(const Range &ents, const BitFieldId id,
527  const ApproximationOrder order, int ver);
528 
529  MoFEMErrorCode setFieldOrderImpl(boost::shared_ptr<Field> field_ptr,
530  const Range &ents,
531  const ApproximationOrder order, int verb);
532 
533  MoFEMErrorCode set_field_order(const Range &ents, const BitFieldId id,
535  int verb = DEFAULT_VERBOSITY);
536 
537  MoFEMErrorCode set_field_order(const EntityHandle meshset,
538  const EntityType type, const BitFieldId id,
540  int verb = DEFAULT_VERBOSITY);
541  MoFEMErrorCode set_field_order(const Range &ents, const std::string &name,
543  int verb = DEFAULT_VERBOSITY);
544  MoFEMErrorCode set_field_order(const EntityHandle meshset,
545  const EntityType type, const std::string &name,
547  int verb = DEFAULT_VERBOSITY);
548  MoFEMErrorCode set_field_order_by_entity_type_and_bit_ref(
549  const BitRefLevel &bit, const BitRefLevel &mask, const EntityType type,
550  const BitFieldId id, const ApproximationOrder order,
551  int verb = DEFAULT_VERBOSITY);
552  MoFEMErrorCode set_field_order_by_entity_type_and_bit_ref(
553  const BitRefLevel &bit, const BitRefLevel &mask, const EntityType type,
554  const std::string &name, const ApproximationOrder order,
555  int verb = DEFAULT_VERBOSITY);
556 
557  /// \name Build fields
558 
560  buildFieldForNoFieldImpl(boost::shared_ptr<Field> field_ptr,
561  std::map<EntityType, int> &dof_counter, int verb);
562 
563  MoFEMErrorCode buildFieldForNoField(const BitFieldId id,
564  std::map<EntityType, int> &dof_counter,
565  int verb = DEFAULT_VERBOSITY);
566 
568  buildFieldForL2H1HcurlHdiv(const BitFieldId id,
569  std::map<EntityType, int> &dof_counter,
570  std::map<EntityType, int> &inactive_dof_counter,
571  int verb = DEFAULT_VERBOSITY);
572 
573  MoFEMErrorCode buildField(const boost::shared_ptr<Field> &field,
574  int verb = DEFAULT_VERBOSITY);
575 
576  MoFEMErrorCode build_fields(int verb = DEFAULT_VERBOSITY);
577 
578  MoFEMErrorCode build_field(const std::string field_name,
579  int verb = DEFAULT_VERBOSITY);
580 
581  /// \name Clear DOFs
582  MoFEMErrorCode clear_inactive_dofs(int verb = DEFAULT_VERBOSITY);
583  MoFEMErrorCode clear_dofs_fields_by_bit_ref(const BitRefLevel bit,
584  const BitRefLevel mask,
585  int verb = DEFAULT_VERBOSITY);
586  MoFEMErrorCode clear_dofs_fields(const Range ents,
587  int verb = DEFAULT_VERBOSITY);
588  MoFEMErrorCode clear_dofs_fields(const std::string name, const Range ents,
589  int verb = DEFAULT_VERBOSITY);
590 
591  /// \name Clear ENTs
592  MoFEMErrorCode clear_ents_fields_by_bit_ref(const BitRefLevel bit,
593  const BitRefLevel mask,
594  int verb = DEFAULT_VERBOSITY);
595  MoFEMErrorCode clear_ents_fields(const Range ents,
596  int verb = DEFAULT_VERBOSITY);
597  MoFEMErrorCode clear_ents_fields(const std::string name, const Range ents,
598  int verb = DEFAULT_VERBOSITY);
599 
600  /// \name Remove field entities
601 
603  remove_ents_from_field_by_bit_ref(const BitRefLevel bit,
604  const BitRefLevel mask,
605  int verb = DEFAULT_VERBOSITY);
606  MoFEMErrorCode remove_ents_from_field(const std::string name,
607  const EntityHandle meshset,
608  const EntityType type,
609  int verb = DEFAULT_VERBOSITY);
610  MoFEMErrorCode remove_ents_from_field(const std::string name,
611  const Range ents,
612  int verb = DEFAULT_VERBOSITY);
613  MoFEMErrorCode remove_ents_from_field(const Range ents,
614  int verb = DEFAULT_VERBOSITY);
615 
616  /// \name Other auxiliary functions for fields
617 
618  MoFEMErrorCode list_dofs_by_field_name(const std::string &name) const;
619  MoFEMErrorCode list_fields() const;
620  BitFieldId get_field_id(const std::string &name) const;
621  FieldBitNumber get_field_bit_number(const std::string name) const;
622  std::string get_field_name(const BitFieldId id) const;
623  EntityHandle get_field_meshset(const BitFieldId id) const;
624  EntityHandle get_field_meshset(const std::string name) const;
625  MoFEMErrorCode get_field_entities_by_dimension(const std::string name,
626  int dim, Range &ents) const;
627  MoFEMErrorCode get_field_entities_by_type(const std::string name,
628  EntityType type, Range &ents) const;
629  MoFEMErrorCode get_field_entities_by_handle(const std::string name,
630  Range &ents) const;
631  bool check_field(const std::string &name) const;
632 
633  const Field *get_field_structure(const std::string &name,
634  enum MoFEMTypes bh = MF_EXIST) const;
635 
636  /**@}*/
637 
638  /** \name Finite elements */
639 
640  /**@{*/
641 
642  const FiniteElement *
643  get_finite_element_structure(const std::string &name,
644  enum MoFEMTypes bh = MF_EXCL) const;
645 
646  bool check_finite_element(const std::string &name) const;
647 
648  MoFEMErrorCode add_finite_element(const std::string &fe_name,
649  enum MoFEMTypes bh = MF_EXCL,
650  int verb = DEFAULT_VERBOSITY);
652  modify_finite_element_adjacency_table(const std::string &fe_name,
653  const EntityType type,
654  ElementAdjacencyFunct function);
656  modify_finite_element_add_field_data(const std::string &fe_name,
657  const std::string name_filed);
659  modify_finite_element_add_field_row(const std::string &fe_name,
660  const std::string name_row);
662  modify_finite_element_add_field_col(const std::string &fe_name,
663  const std::string name_col);
665  modify_finite_element_off_field_data(const std::string &fe_name,
666  const std::string name_filed);
668  modify_finite_element_off_field_row(const std::string &fe_name,
669  const std::string name_row);
671  modify_finite_element_off_field_col(const std::string &fe_name,
672  const std::string name_col);
673  MoFEMErrorCode add_ents_to_finite_element_by_type(
674  const EntityHandle meshset, const EntityType type,
675  const std::string &name, const bool recursive = true);
676  MoFEMErrorCode add_ents_to_finite_element_by_dim(const EntityHandle meshset,
677  const int dim,
678  const std::string &name,
679  const bool recursive = true);
680  MoFEMErrorCode add_ents_to_finite_element_by_type(const Range &ents,
681  const EntityType type,
682  const std::string &name);
683  MoFEMErrorCode add_ents_to_finite_element_by_dim(const Range &ents,
684  const int dim,
685  const std::string &name);
686  MoFEMErrorCode add_ents_to_finite_element_by_bit_ref(
687  const BitRefLevel &bit, const BitRefLevel &mask, const std::string &name,
688  EntityType type, int verb = DEFAULT_VERBOSITY);
690  add_ents_to_finite_element_by_MESHSET(const EntityHandle meshset,
691  const std::string &name,
692  const bool recursive = false);
693  DEPRECATED MoFEMErrorCode add_ents_to_finite_element_EntType_by_bit_ref(
694  const BitRefLevel &bit, const std::string &name, EntityType type,
695  int verb = DEFAULT_VERBOSITY);
696  DEPRECATED MoFEMErrorCode add_ents_to_finite_element_EntType_by_bit_ref(
697  const BitRefLevel &bit, const BitRefLevel &mask, const std::string &name,
698  EntityType type, int verb = DEFAULT_VERBOSITY);
699 
701  remove_ents_from_finite_element_by_bit_ref(const BitRefLevel bit,
702  const BitRefLevel mask,
703  int verb = DEFAULT_VERBOSITY);
704  MoFEMErrorCode remove_ents_from_finite_element(const std::string name,
705  const EntityHandle meshset,
706  const EntityType type,
707  int verb = DEFAULT_VERBOSITY);
708  MoFEMErrorCode remove_ents_from_finite_element(const std::string name,
709  const Range ents,
710  int verb = DEFAULT_VERBOSITY);
711  MoFEMErrorCode remove_ents_from_finite_element(const Range ents,
712  int verb = DEFAULT_VERBOSITY);
713  MoFEMErrorCode delete_finite_element(const std::string name,
714  int verb = DEFAULT_VERBOSITY);
715 
716  // \name Other auxiliary functions for finite element
717 
718  /**
719  * \brief Get field Id
720  * @param name field name
721  * @return field id
722  */
723  BitFEId getBitFEId(const std::string &fe_name) const;
724 
725  /**
726  * \brief Get field name
727  * @param id field id
728  * @return field name
729  */
730  std::string getBitFEIdName(const BitFEId id) const;
731 
732  EntityHandle get_finite_element_meshset(const BitFEId id) const;
733  EntityHandle get_finite_element_meshset(const std::string name) const;
735  get_finite_element_entities_by_dimension(const std::string name, int dim,
736  Range &ents) const;
737  MoFEMErrorCode get_finite_element_entities_by_type(const std::string name,
738  EntityType type,
739  Range &ents) const;
740  MoFEMErrorCode get_finite_element_entities_by_handle(const std::string name,
741  Range &ents) const;
742  MoFEMErrorCode list_finite_elements() const;
743 
744  /**@}*/
745 
746  /** \name Problems */
747 
748  /**@{*/
749 
750  MoFEMErrorCode add_problem(const std::string &name,
751  enum MoFEMTypes bh = MF_EXCL,
752  int verb = DEFAULT_VERBOSITY);
753  bool check_problem(const std::string name);
754  MoFEMErrorCode delete_problem(const std::string name);
756  modify_problem_add_finite_element(const std::string name_problem,
757  const std::string &fe_name);
759  modify_problem_unset_finite_element(const std::string name_problem,
760  const std::string &fe_name);
762  modify_problem_ref_level_add_bit(const std::string &name_problem,
763  const BitRefLevel &bit);
765  modify_problem_ref_level_set_bit(const std::string &name_problem,
766  const BitRefLevel &bit);
768  modify_problem_mask_ref_level_add_bit(const std::string &name_problem,
769  const BitRefLevel &bit);
771  modify_problem_mask_ref_level_set_bit(const std::string &name_problem,
772  const BitRefLevel &bit);
773  BitProblemId getBitProblemId(const std::string &name) const;
774  MoFEMErrorCode list_problem() const;
775  MoFEMErrorCode clear_problem(const std::string name,
776  int verb = DEFAULT_VERBOSITY);
777  MoFEMErrorCode clear_problems(int verb = DEFAULT_VERBOSITY);
778  MoFEMErrorCode build_finite_elements(int verb = DEFAULT_VERBOSITY);
779  MoFEMErrorCode build_finite_elements(const BitRefLevel &bit,
780  int verb = DEFAULT_VERBOSITY);
781  MoFEMErrorCode build_finite_elements(const string fe_name,
782  const Range *const ents_ptr = nullptr,
783  int verb = DEFAULT_VERBOSITY);
784  MoFEMErrorCode buildFiniteElements(const boost::shared_ptr<FiniteElement> &fe,
785  const Range *ents_ptr = NULL,
786  int verb = DEFAULT_VERBOSITY);
787  MoFEMErrorCode clear_finite_elements_by_bit_ref(const BitRefLevel bit,
788  const BitRefLevel mask,
789  int verb = DEFAULT_VERBOSITY);
790  MoFEMErrorCode clear_finite_elements(const Range &ents,
791  int verb = DEFAULT_VERBOSITY);
792  MoFEMErrorCode clear_finite_elements(const std::string &fe_name,
793  const Range &ents,
794  int verb = DEFAULT_VERBOSITY);
795 
797  get_problem_finite_elements_entities(const std::string name,
798  const std::string &fe_name,
799  const EntityHandle meshset);
800 
801  // \name Problem building (deprecated)
802 
804  build_problem_on_distributed_mesh(int verb = DEFAULT_VERBOSITY);
805  DEPRECATED MoFEMErrorCode build_problems(int verb = DEFAULT_VERBOSITY);
806 
807  /**@}*/
808 
809  /** \name Adjacencies */
810 
811  /**@{*/
812 
813  MoFEMErrorCode build_adjacencies(const Range &ents,
814  int verb = DEFAULT_VERBOSITY);
815  MoFEMErrorCode build_adjacencies(const BitRefLevel &bit,
816  int verb = DEFAULT_VERBOSITY);
817  MoFEMErrorCode build_adjacencies(const BitRefLevel &bit,
818  const BitRefLevel &mask,
819  int verb = DEFAULT_VERBOSITY);
820  MoFEMErrorCode clear_adjacencies_entities(const BitRefLevel bit,
821  const BitRefLevel mask,
822  int verb = DEFAULT_VERBOSITY);
823  MoFEMErrorCode clear_adjacencies_entities(const Range ents,
824  int verb = DEFAULT_VERBOSITY);
825  MoFEMErrorCode clear_adjacencies_entities(const std::string name,
826  const Range ents,
827  int verb = DEFAULT_VERBOSITY);
829  clear_adjacencies_finite_elements(const BitRefLevel bit,
830  const BitRefLevel mask,
831  int verb = DEFAULT_VERBOSITY);
833  clear_adjacencies_finite_elements(const Range ents,
834  int verb = DEFAULT_VERBOSITY);
836  clear_adjacencies_finite_elements(const std::string name, const Range ents,
837  int verb = DEFAULT_VERBOSITY);
838 
839  /**@}*/
840 
841  /** \name Methods for preforming operations on elements */
842 
843  /**@{*/
844 
845  MoFEMErrorCode problem_basic_method_preProcess(const Problem *problem_ptr,
846  BasicMethod &method,
847  int verb = DEFAULT_VERBOSITY);
849  problem_basic_method_preProcess(const std::string &problem_name,
850  BasicMethod &method,
851  int verb = DEFAULT_VERBOSITY);
852  MoFEMErrorCode problem_basic_method_postProcess(const Problem *problem_ptr,
853  BasicMethod &method,
854  int verb = DEFAULT_VERBOSITY);
856  problem_basic_method_postProcess(const std::string &problem_name,
857  BasicMethod &method,
858  int verb = DEFAULT_VERBOSITY);
859 
860  /**
861  * @copydoc MoFEM::CoreInterface::cache_problem_entities
862  */
863  MoFEMErrorCode cache_problem_entities(const std::string prb_name,
864  CacheTupleWeakPtr cache_ptr);
865 
866  MoFEMErrorCode loop_finite_elements(
867  const Problem *problem_ptr, const std::string &fe_name, FEMethod &method,
868  int lower_rank, int upper_rank,
869  boost::shared_ptr<NumeredEntFiniteElement_multiIndex> fe_ptr = nullptr,
870  MoFEMTypes bh = MF_EXIST,
872  int verb = DEFAULT_VERBOSITY);
873 
874  MoFEMErrorCode loop_finite_elements(
875  const std::string problem_name, const std::string &fe_name,
876  FEMethod &method, 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,
885  boost::shared_ptr<NumeredEntFiniteElement_multiIndex> fe_ptr = nullptr,
886  MoFEMTypes bh = MF_EXIST,
888  int verb = DEFAULT_VERBOSITY);
889 
890  MoFEMErrorCode loop_dofs(const Problem *problem_ptr,
891  const std::string &field_name, RowColData rc,
892  DofMethod &method, int lower_rank, int upper_rank,
893  int verb = DEFAULT_VERBOSITY);
894  MoFEMErrorCode loop_dofs(const std::string &problem_name,
895  const std::string &field_name, RowColData rc,
896  DofMethod &method, int lower_rank, int upper_rank,
897  int verb = DEFAULT_VERBOSITY);
898  MoFEMErrorCode loop_dofs(const std::string &problem_name,
899  const std::string &field_name, RowColData rc,
900  DofMethod &method, int verb = DEFAULT_VERBOSITY);
901  MoFEMErrorCode loop_dofs(const std::string &field_name, DofMethod &method,
902  int verb = DEFAULT_VERBOSITY);
903  MoFEMErrorCode loop_entities(const Problem *problem_ptr,
904  const std::string field_name, RowColData rc,
905  EntityMethod &method, int lower_rank,
906  int upper_rank, int verb = DEFAULT_VERBOSITY);
907  MoFEMErrorCode loop_entities(const std::string problem_name,
908  const std::string field_name, RowColData rc,
909  EntityMethod &method, int lower_rank,
910  int upper_rank, int verb = DEFAULT_VERBOSITY);
911  MoFEMErrorCode loop_entities(const std::string problem_name,
912  const std::string field_name, RowColData rc,
913  EntityMethod &method,
914  int verb = DEFAULT_VERBOSITY);
915  MoFEMErrorCode loop_entities(const std::string field_name,
916  EntityMethod &method,
917  Range const *const ents = nullptr,
918  int verb = DEFAULT_VERBOSITY);
919 
920  /**@}*/
921 
922  /** \name Accessing multi-indices */
923 
924  /**@{*/
925 
926  MoFEMErrorCode get_fields(const Field_multiIndex **fields_ptr) const;
928  get_ref_ents(const RefEntity_multiIndex **refined_entities_ptr) const;
929  MoFEMErrorCode get_ref_finite_elements(
930  const RefElement_multiIndex **refined_finite_elements_ptr) const;
932  get_finite_elements(const FiniteElement_multiIndex **fe_ptr) const;
933  MoFEMErrorCode get_ents_finite_elements(
934  const EntFiniteElement_multiIndex **fe_ent_ptr) const;
936  get_field_ents(const FieldEntity_multiIndex **field_ents) const;
937  MoFEMErrorCode get_dofs(const DofEntity_multiIndex **dofs_ptr) const;
938  MoFEMErrorCode get_problem(const std::string &problem_name,
939  const Problem **problem_ptr) const;
940  MoFEMErrorCode get_problems(const Problem_multiIndex **problems_ptr) const;
941  MoFEMErrorCode get_ents_elements_adjacency(
943  *dofs_elements_adjacency) const;
944 
945  const Field_multiIndex *get_fields() const;
946  const RefEntity_multiIndex *get_ref_ents() const;
947  const RefElement_multiIndex *get_ref_finite_elements() const;
948  const FiniteElement_multiIndex *get_finite_elements() const;
949  const EntFiniteElement_multiIndex *get_ents_finite_elements() const;
950  const FieldEntity_multiIndex *get_field_ents() const;
951  const DofEntity_multiIndex *get_dofs() const;
952  const Problem *get_problem(const std::string problem_name) const;
953  const Problem_multiIndex *get_problems() const;
955  get_ents_elements_adjacency() const;
956 
957  FieldEntityByUId::iterator
958  get_ent_field_by_name_begin(const std::string &field_name) const;
959  FieldEntityByUId::iterator
960  get_ent_field_by_name_end(const std::string &field_name) const;
961  DofEntityByUId::iterator
962  get_dofs_by_name_begin(const std::string &field_name) const;
963  DofEntityByUId::iterator
964  get_dofs_by_name_end(const std::string &field_name) const;
965  DofEntityByUId::iterator
966  get_dofs_by_name_and_ent_begin(const std::string &field_name,
967  const EntityHandle ent) const;
968  DofEntityByUId::iterator
969  get_dofs_by_name_and_ent_end(const std::string &field_name,
970  const EntityHandle ent) const;
971  DofEntityByUId::iterator
972  get_dofs_by_name_and_type_begin(const std::string &field_name,
973  const EntityType type) const;
974  DofEntityByUId::iterator
975  get_dofs_by_name_and_type_end(const std::string &field_name,
976  const EntityType ent) const;
977 
978  EntFiniteElement_multiIndex::index<Unique_mi_tag>::type::iterator
979  get_fe_by_name_begin(const std::string &fe_name) const;
980  EntFiniteElement_multiIndex::index<Unique_mi_tag>::type::iterator
981  get_fe_by_name_end(const std::string &fe_name) const;
982 
983  /**@}*/
984 
985  /** \name Log events */
986 
987  /**@{*/
988 
989  // Events are are using for logging and hailed by PETSc
990 
991  PetscLogEvent MOFEM_EVENT_preProcess; ///< Event for preProcess finite element
992  PetscLogEvent
993  MOFEM_EVENT_operator; ///< Event for evaluating operator of finite element
994  PetscLogEvent
995  MOFEM_EVENT_postProcess; ///< Event for postProcess finite element
996  PetscLogEvent MOFEM_EVENT_createMat;
997 
998  /**@}*/
999 
1000  /** \name Communicator */
1001 
1002  /**@{*/
1003 
1004  mutable MPI_Comm mofemComm; ///< MoFEM communicator
1005  mutable ParallelComm *pComm; ///< MOAB communicator structure
1006 
1007  int sIze; ///< MoFEM communicator size
1008  int rAnk; ///< MOFEM communicator rank
1009 
1010  /**
1011  * @return return communicator
1012  */
1013  inline MPI_Comm &get_comm() const { return mofemComm; }
1014 
1015  /**
1016  * @return return communicator size
1017  */
1018  inline int get_comm_size() const { return sIze; }
1019 
1020  /**
1021  * @return return communicator rank/processor
1022  */
1023  inline int get_comm_rank() const { return rAnk; }
1024 
1025  /**@}*/
1026 
1027 protected:
1028  boost::shared_ptr<WrapMPIComm>
1029  wrapMPIMOABComm; ///< manage creation and destruction of MOAB communicator
1030 
1031  int verbose; ///< Verbosity level
1032 
1033  /**
1034  * \brief Hash map of pointers to interfaces
1035  */
1036  mutable boost::ptr_map<boost::typeindex::type_index, UnknownInterface> iFaces;
1037 
1038  mutable int *buildMoFEM; ///< keeps flags/semaphores for different stages
1039 
1040  std::string optionsPrefix; ///< Prefix for options on command line
1041 
1042  PetscBool initaliseAndBuildField; ///< If true build field on database
1043  ///< initialisation
1044 
1045  PetscBool initaliseAndBuildFiniteElements; // If true build finite elements on
1046  // database initialisation
1047 
1048  static bool isGloballyInitialised; ///< Core base globally initialized
1049  static int mpiInitialised; ///< mpi was initialised by other agent
1050  static PetscBool isInitialized; ///< petsc was initialised by other agent
1051 
1052  /**
1053  * @brief add problem
1054  *
1055  * @param id problem id
1056  * @param name problem name
1057  * @param verb verbosity level
1058  * @return MoFEMErrorCode
1059  */
1060  MoFEMErrorCode addProblem(const BitProblemId id, const std::string &name,
1061  int verb = DEFAULT_VERBOSITY);
1062 
1063  /**
1064  * \brief Get tag handles
1065  * @param verb verbosity level
1066  * @return error code
1067  */
1068  MoFEMErrorCode getTags(int verb = DEFAULT_VERBOSITY);
1069 
1070  /**
1071  * \brief Cleaning database
1072  */
1073  MoFEMErrorCode clearMap();
1074 
1075  /**
1076  * @brief Register insterfaces
1077  *
1078  * @return MoFEMErrorCode
1079  */
1080  MoFEMErrorCode registerSubInterfaces();
1081 
1082  /**
1083  * \brief Return unique problem Id
1084  *
1085  * Each time this function is called, it gives new unit problem Id for bit.
1086  *
1087  */
1088  BitProblemId getProblemShift();
1089 
1090  /**
1091  * \brief Initialize database getting information on mesh
1092  */
1093  MoFEMErrorCode initialiseDatabaseFromMesh(int verb = DEFAULT_VERBOSITY);
1094 
1095  /**
1096  * @brief Get core options from command line
1097  *
1098  * @return MoFEMErrorCode
1099  */
1100  MoFEMErrorCode getOptions(int verb = DEFAULT_VERBOSITY);
1101 
1102  /**
1103  * @brief Register sub-interfaces in core interface
1104  *
1105  * @tparam IFACE
1106  * @return MoFEMErrorCode
1107  */
1108  template <class IFACE> MoFEMErrorCode regSubInterface();
1109 
1110  /**
1111  * @brief Register petsc events
1112  *
1113  * @tparam IFACE
1114  * @return MoFEMErrorCode
1115  */
1116  template <class IFACE> MoFEMErrorCode regEvents();
1117 };
1118 
1119 template <> struct CoreTmp<-1> : public CoreTmp<0> {
1120 
1121  static constexpr const int value = -1;
1122  const int getValue() const { return value; }
1123 
1124  virtual boost::shared_ptr<RefEntityTmp<0>>
1126 
1127  /**
1128  * Construct core database
1129  */
1130  CoreTmp(moab::Interface &moab, ///< MoAB interface
1131  MPI_Comm comm = PETSC_COMM_WORLD, ///< MPI communicator
1132  const int verbose = VERBOSE ///< Verbosity level
1133 
1134  );
1135 
1137  int verb = VERBOSE);
1138 };
1139 
1141 
1142 } // namespace MoFEM
1143 
1144 #include <CoreTemplates.hpp>
1145 
1146 #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:993
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:1008
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:1029
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:1038
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:2002
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:991
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:1018
MoFEM::CoreTmp< 0 >::MOFEM_EVENT_createMat
PetscLogEvent MOFEM_EVENT_createMat
Definition: Core.hpp:996
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:1036
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:1049
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:1023
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:1048
MoFEM::CoreTmp< 0 >::sIze
int sIze
MoFEM communicator size.
Definition: Core.hpp:1007
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:1042
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:1122
MoFEM::CoreTmp< 0 >::isInitialized
static PetscBool isInitialized
petsc was initialised by other agent
Definition: Core.hpp:1050
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:1045
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:1013
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:1004
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:1005
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:1031
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:1040
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:491
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:995
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