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