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