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