v0.10.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; }
82  return RefEntityTmp<0>(this->basicEntityDataPtr, ent);
83  }
84 
85  virtual boost::shared_ptr<RefEntityTmp<0>>
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,
255  th_RefFEMeshset;
257  Tag th_FieldId, th_FieldName, th_FieldName_DataNamePrefix, th_FieldSpace,
258  th_FieldBase;
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  * @brief Template for add_field
429  *
430  * @tparam CoreN
431  * @param name
432  * @param space
433  * @param base
434  * @param nb_coefficients
435  * @param tag_type
436  * @param bh
437  * @param verb
438  * @return MoFEMErrorCode
439  */
440  MoFEMErrorCode addField(const std::string &name, const FieldSpace space,
441  const FieldApproximationBase base,
442  const FieldCoefficientsNumber nb_coefficients,
443  const TagType tag_type, const enum MoFEMTypes bh,
444  int verb);
445 
446  MoFEMErrorCode addEntsToFieldByDim(const Range &ents, const int dim,
447  const std::string &name,
448  int verb = DEFAULT_VERBOSITY);
449  MoFEMErrorCode add_ents_to_field_by_dim(const Range &ents, const int dim,
450  const std::string &name,
451  int verb = DEFAULT_VERBOSITY);
452  MoFEMErrorCode add_ents_to_field_by_type(const Range &ents,
453  const EntityType type,
454  const std::string &name,
455  int verb = DEFAULT_VERBOSITY);
456  MoFEMErrorCode add_ents_to_field_by_dim(const EntityHandle meshset,
457  const int dim,
458  const std::string &name,
459  const bool recursive = true,
460  int verb = DEFAULT_VERBOSITY);
461  MoFEMErrorCode add_ents_to_field_by_type(const EntityHandle meshset,
462  const EntityType type,
463  const std::string &name,
464  const bool recursive = true,
465  int verb = DEFAULT_VERBOSITY);
466 
467  MoFEMErrorCode create_vertices_and_add_to_field(const std::string name,
468  const double coords[],
469  int size,
470  int verb = DEFAULT_VERBOSITY);
471 
472  /// \name Set approximation order
473 
474  MoFEMErrorCode setFieldOrder(const Range &ents, const BitFieldId id,
475  const ApproximationOrder order, int ver);
476 
477  MoFEMErrorCode setFieldOrderImpl(boost::shared_ptr<Field> field_ptr,
478  const Range &ents,
479  const ApproximationOrder order, int verb);
480 
481  MoFEMErrorCode set_field_order(const Range &ents, const BitFieldId id,
483  int verb = DEFAULT_VERBOSITY);
484 
485  MoFEMErrorCode set_field_order(const EntityHandle meshset,
486  const EntityType type, const BitFieldId id,
488  int verb = DEFAULT_VERBOSITY);
489  MoFEMErrorCode set_field_order(const Range &ents, const std::string &name,
491  int verb = DEFAULT_VERBOSITY);
492  MoFEMErrorCode set_field_order(const EntityHandle meshset,
493  const EntityType type, const std::string &name,
495  int verb = DEFAULT_VERBOSITY);
496  MoFEMErrorCode set_field_order_by_entity_type_and_bit_ref(
497  const BitRefLevel &bit, const BitRefLevel &mask, const EntityType type,
498  const BitFieldId id, const ApproximationOrder order,
499  int verb = DEFAULT_VERBOSITY);
500  MoFEMErrorCode set_field_order_by_entity_type_and_bit_ref(
501  const BitRefLevel &bit, const BitRefLevel &mask, const EntityType type,
502  const std::string &name, const ApproximationOrder order,
503  int verb = DEFAULT_VERBOSITY);
504 
505  /// \name Build fields
506 
508  buildFieldForNoFieldImpl(boost::shared_ptr<Field> field_ptr,
509  std::map<EntityType, int> &dof_counter, int verb);
510 
511  MoFEMErrorCode buildFieldForNoField(const BitFieldId id,
512  std::map<EntityType, int> &dof_counter,
513  int verb = DEFAULT_VERBOSITY);
514 
516  buildFieldForL2H1HcurlHdiv(const BitFieldId id,
517  std::map<EntityType, int> &dof_counter,
518  std::map<EntityType, int> &inactive_dof_counter,
519  int verb = DEFAULT_VERBOSITY);
520 
521  MoFEMErrorCode buildField(const boost::shared_ptr<Field> &field,
522  int verb = DEFAULT_VERBOSITY);
523 
524  MoFEMErrorCode build_fields(int verb = DEFAULT_VERBOSITY);
525 
526  MoFEMErrorCode build_field(const std::string field_name,
527  int verb = DEFAULT_VERBOSITY);
528 
529  /// \name Clear DOFs
530  MoFEMErrorCode clear_inactive_dofs(int verb = DEFAULT_VERBOSITY);
531  MoFEMErrorCode clear_dofs_fields_by_bit_ref(const BitRefLevel bit,
532  const BitRefLevel mask,
533  int verb = DEFAULT_VERBOSITY);
534  MoFEMErrorCode clear_dofs_fields(const Range ents,
535  int verb = DEFAULT_VERBOSITY);
536  MoFEMErrorCode clear_dofs_fields(const std::string name, const Range ents,
537  int verb = DEFAULT_VERBOSITY);
538 
539  /// \name Clear ENTs
540  MoFEMErrorCode clear_ents_fields_by_bit_ref(const BitRefLevel bit,
541  const BitRefLevel mask,
542  int verb = DEFAULT_VERBOSITY);
543  MoFEMErrorCode clear_ents_fields(const Range ents,
544  int verb = DEFAULT_VERBOSITY);
545  MoFEMErrorCode clear_ents_fields(const std::string name, const Range ents,
546  int verb = DEFAULT_VERBOSITY);
547 
548  /// \name Remove field entities
549 
551  remove_ents_from_field_by_bit_ref(const BitRefLevel bit,
552  const BitRefLevel mask,
553  int verb = DEFAULT_VERBOSITY);
554  MoFEMErrorCode remove_ents_from_field(const std::string name,
555  const EntityHandle meshset,
556  const EntityType type,
557  int verb = DEFAULT_VERBOSITY);
558  MoFEMErrorCode remove_ents_from_field(const std::string name,
559  const Range ents,
560  int verb = DEFAULT_VERBOSITY);
561  MoFEMErrorCode remove_ents_from_field(const Range ents,
562  int verb = DEFAULT_VERBOSITY);
563 
564  /// \name Other auxiliary functions for fields
565 
566  MoFEMErrorCode list_dofs_by_field_name(const std::string &name) const;
567  MoFEMErrorCode list_fields() const;
568  BitFieldId getBitFieldId(const std::string &name) const;
569  FieldBitNumber get_field_bit_number(const std::string name) const;
570  EntityHandle get_field_meshset(const BitFieldId id) const;
571  EntityHandle get_field_meshset(const std::string name) const;
572  MoFEMErrorCode get_field_entities_by_dimension(const std::string name,
573  int dim, Range &ents) const;
574  MoFEMErrorCode get_field_entities_by_type(const std::string name,
575  EntityType type, Range &ents) const;
576  MoFEMErrorCode get_field_entities_by_handle(const std::string name,
577  Range &ents) const;
578  bool check_field(const std::string &name) const;
579  const Field *get_field_structure(const std::string &name);
580 
581  /**@}*/
582 
583  /** \name Finite elements */
584 
585  /**@{*/
586 
587  bool check_finite_element(const std::string &name) const;
588  MoFEMErrorCode add_finite_element(const std::string &fe_name,
589  enum MoFEMTypes bh = MF_EXCL,
590  int verb = DEFAULT_VERBOSITY);
592  modify_finite_element_adjacency_table(const std::string &fe_name,
593  const EntityType type,
594  ElementAdjacencyFunct function);
596  modify_finite_element_add_field_data(const std::string &fe_name,
597  const std::string &name_filed);
599  modify_finite_element_add_field_row(const std::string &fe_name,
600  const std::string &name_row);
602  modify_finite_element_add_field_col(const std::string &fe_name,
603  const std::string &name_col);
605  modify_finite_element_off_field_data(const std::string &fe_name,
606  const std::string &name_filed);
608  modify_finite_element_off_field_row(const std::string &fe_name,
609  const std::string &name_row);
611  modify_finite_element_off_field_col(const std::string &fe_name,
612  const std::string &name_col);
613  MoFEMErrorCode add_ents_to_finite_element_by_type(
614  const EntityHandle meshset, const EntityType type,
615  const std::string &name, const bool recursive = true);
616  MoFEMErrorCode add_ents_to_finite_element_by_dim(const EntityHandle meshset,
617  const int dim,
618  const std::string &name,
619  const bool recursive = true);
620  MoFEMErrorCode add_ents_to_finite_element_by_type(const Range &ents,
621  const EntityType type,
622  const std::string &name);
623  MoFEMErrorCode add_ents_to_finite_element_by_dim(const Range &ents,
624  const int dim,
625  const std::string &name);
626  MoFEMErrorCode add_ents_to_finite_element_by_bit_ref(
627  const BitRefLevel &bit, const BitRefLevel &mask, const std::string &name,
628  EntityType type, int verb = DEFAULT_VERBOSITY);
630  add_ents_to_finite_element_by_MESHSET(const EntityHandle meshset,
631  const std::string &name,
632  const bool recursive = false);
633  DEPRECATED MoFEMErrorCode add_ents_to_finite_element_by_VERTICEs(
634  const Range &vert, const std::string &name);
635  DEPRECATED MoFEMErrorCode add_ents_to_finite_element_by_EDGEs(
636  const Range &vert, const std::string &name);
637  DEPRECATED MoFEMErrorCode add_ents_to_finite_element_by_EDGEs(
638  const EntityHandle meshset, const std::string &name,
639  const bool recursive = false);
640  DEPRECATED MoFEMErrorCode add_ents_to_finite_element_by_TRIs(
641  const Range &tris, const std::string &name);
642  DEPRECATED MoFEMErrorCode add_ents_to_finite_element_by_TRIs(
643  const EntityHandle meshset, const std::string &name,
644  const bool recursive = false);
645  DEPRECATED MoFEMErrorCode add_ents_to_finite_element_by_TETs(
646  const Range &tets, const std::string &name);
647  DEPRECATED MoFEMErrorCode add_ents_to_finite_element_by_TETs(
648  const EntityHandle meshset, const std::string &name,
649  const bool recursive = false);
651  add_ents_to_finite_element_by_PRISMs(const Range &prims, const BitFEId id);
652  DEPRECATED MoFEMErrorCode add_ents_to_finite_element_by_PRISMs(
653  const Range &prims, const std::string &name);
654  DEPRECATED MoFEMErrorCode add_ents_to_finite_element_by_PRISMs(
655  const EntityHandle meshset, const std::string &name,
656  const bool recursive = false);
657  DEPRECATED MoFEMErrorCode add_ents_to_finite_element_EntType_by_bit_ref(
658  const BitRefLevel &bit, const std::string &name, EntityType type,
659  int verb = DEFAULT_VERBOSITY);
660  DEPRECATED MoFEMErrorCode add_ents_to_finite_element_EntType_by_bit_ref(
661  const BitRefLevel &bit, const BitRefLevel &mask, const std::string &name,
662  EntityType type, int verb = DEFAULT_VERBOSITY);
663 
665  remove_ents_from_finite_element_by_bit_ref(const BitRefLevel bit,
666  const BitRefLevel mask,
667  int verb = DEFAULT_VERBOSITY);
668  MoFEMErrorCode remove_ents_from_finite_element(const std::string name,
669  const EntityHandle meshset,
670  const EntityType type,
671  int verb = DEFAULT_VERBOSITY);
672  MoFEMErrorCode remove_ents_from_finite_element(const std::string name,
673  const Range ents,
674  int verb = DEFAULT_VERBOSITY);
675  MoFEMErrorCode remove_ents_from_finite_element(const Range ents,
676  int verb = DEFAULT_VERBOSITY);
677  MoFEMErrorCode delete_finite_element(const std::string name,
678  int verb = DEFAULT_VERBOSITY);
679 
680  // \name Other auxiliary functions for finite element
681 
682  /**
683  * \brief Get field Id
684  * @param name field name
685  * @return field id
686  */
687  BitFEId getBitFEId(const std::string &name) const;
688 
689  /**
690  * \brief Get field name
691  * @param id field id
692  * @return field name
693  */
694  std::string getBitFEIdName(const BitFEId id) const;
695  EntityHandle get_finite_element_meshset(const BitFEId id) const;
696  EntityHandle get_finite_element_meshset(const std::string &name) const;
698  get_finite_element_entities_by_dimension(const std::string name, int dim,
699  Range &ents) const;
700  MoFEMErrorCode get_finite_element_entities_by_type(const std::string name,
701  EntityType type,
702  Range &ents) const;
703  MoFEMErrorCode get_finite_element_entities_by_handle(const std::string name,
704  Range &ents) const;
705  MoFEMErrorCode list_finite_elements() const;
706 
707  /**@}*/
708 
709  /** \name Problems */
710 
711  /**@{*/
712 
713  MoFEMErrorCode add_problem(const std::string &name,
714  enum MoFEMTypes bh = MF_EXCL,
715  int verb = DEFAULT_VERBOSITY);
716  bool check_problem(const std::string name);
717  MoFEMErrorCode delete_problem(const std::string name);
719  modify_problem_add_finite_element(const std::string &name_problem,
720  const std::string &MoFEMFiniteElement_name);
721  MoFEMErrorCode modify_problem_unset_finite_element(
722  const std::string &name_problem,
723  const std::string &MoFEMFiniteElement_name);
725  modify_problem_ref_level_add_bit(const std::string &name_problem,
726  const BitRefLevel &bit);
728  modify_problem_ref_level_set_bit(const std::string &name_problem,
729  const BitRefLevel &bit);
731  modify_problem_mask_ref_level_add_bit(const std::string &name_problem,
732  const BitRefLevel &bit);
734  modify_problem_mask_ref_level_set_bit(const std::string &name_problem,
735  const BitRefLevel &bit);
736  BitProblemId getBitProblemId(const std::string &name) const;
737  MoFEMErrorCode list_problem() const;
738  MoFEMErrorCode clear_problem(const std::string name,
739  int verb = DEFAULT_VERBOSITY);
740  MoFEMErrorCode clear_problems(int verb = DEFAULT_VERBOSITY);
741  MoFEMErrorCode build_finite_elements(int verb = DEFAULT_VERBOSITY);
742  MoFEMErrorCode build_finite_elements(const BitRefLevel &bit,
743  int verb = DEFAULT_VERBOSITY);
744  MoFEMErrorCode build_finite_elements(const string fe_name,
745  const Range *const ents_ptr = nullptr,
746  int verb = DEFAULT_VERBOSITY);
747  MoFEMErrorCode buildFiniteElements(const boost::shared_ptr<FiniteElement> &fe,
748  const Range *ents_ptr = NULL,
749  int verb = DEFAULT_VERBOSITY);
750  MoFEMErrorCode clear_finite_elements_by_bit_ref(const BitRefLevel bit,
751  const BitRefLevel mask,
752  int verb = DEFAULT_VERBOSITY);
753  MoFEMErrorCode clear_finite_elements(const Range ents,
754  int verb = DEFAULT_VERBOSITY);
755  MoFEMErrorCode clear_finite_elements(const std::string name, const Range ents,
756  int verb = DEFAULT_VERBOSITY);
757 
759  get_problem_finite_elements_entities(const std::string &name,
760  const std::string &fe_name,
761  const EntityHandle meshset);
762 
763  // \name Problem building (deprecated)
764 
766  build_problem_on_distributed_mesh(int verb = DEFAULT_VERBOSITY);
767  DEPRECATED MoFEMErrorCode build_problems(int verb = DEFAULT_VERBOSITY);
768 
769  /**@}*/
770 
771  /** \name Adjacencies */
772 
773  /**@{*/
774 
775  MoFEMErrorCode build_adjacencies(const Range &ents,
776  int verb = DEFAULT_VERBOSITY);
777  MoFEMErrorCode build_adjacencies(const BitRefLevel &bit,
778  int verb = DEFAULT_VERBOSITY);
779  MoFEMErrorCode build_adjacencies(const BitRefLevel &bit,
780  const BitRefLevel &mask,
781  int verb = DEFAULT_VERBOSITY);
782  MoFEMErrorCode clear_adjacencies_entities(const BitRefLevel bit,
783  const BitRefLevel mask,
784  int verb = DEFAULT_VERBOSITY);
785  MoFEMErrorCode clear_adjacencies_entities(const Range ents,
786  int verb = DEFAULT_VERBOSITY);
787  MoFEMErrorCode clear_adjacencies_entities(const std::string name,
788  const Range ents,
789  int verb = DEFAULT_VERBOSITY);
791  clear_adjacencies_finite_elements(const BitRefLevel bit,
792  const BitRefLevel mask,
793  int verb = DEFAULT_VERBOSITY);
795  clear_adjacencies_finite_elements(const Range ents,
796  int verb = DEFAULT_VERBOSITY);
798  clear_adjacencies_finite_elements(const std::string name, const Range ents,
799  int verb = DEFAULT_VERBOSITY);
800 
801  /**@}*/
802 
803  /** \name Methods for preforming operations on elements */
804 
805  /**@{*/
806 
807  MoFEMErrorCode problem_basic_method_preProcess(const Problem *problem_ptr,
808  BasicMethod &method,
809  int verb = DEFAULT_VERBOSITY);
811  problem_basic_method_preProcess(const std::string &problem_name,
812  BasicMethod &method,
813  int verb = DEFAULT_VERBOSITY);
814  MoFEMErrorCode problem_basic_method_postProcess(const Problem *problem_ptr,
815  BasicMethod &method,
816  int verb = DEFAULT_VERBOSITY);
818  problem_basic_method_postProcess(const std::string &problem_name,
819  BasicMethod &method,
820  int verb = DEFAULT_VERBOSITY);
821 
822  /**
823  * @copydoc MoFEM::CoreInterface::cache_problem_entities
824  */
825  MoFEMErrorCode cache_problem_entities(const std::string prb_name,
826  CacheTupleWeakPtr cache_ptr);
827 
828  MoFEMErrorCode loop_finite_elements(
829  const Problem *problem_ptr, const std::string &fe_name, FEMethod &method,
830  int lower_rank, int upper_rank,
831  boost::shared_ptr<NumeredEntFiniteElement_multiIndex> fe_ptr = nullptr,
832  MoFEMTypes bh = MF_EXIST,
834  int verb = DEFAULT_VERBOSITY);
835 
836  MoFEMErrorCode loop_finite_elements(
837  const std::string &problem_name, const std::string &fe_name,
838  FEMethod &method, int lower_rank, int upper_rank,
839  boost::shared_ptr<NumeredEntFiniteElement_multiIndex> fe_ptr = nullptr,
840  MoFEMTypes bh = MF_EXIST,
842  int verb = DEFAULT_VERBOSITY);
843 
844  MoFEMErrorCode loop_finite_elements(
845  const std::string &problem_name, const std::string &fe_name,
846  FEMethod &method,
847  boost::shared_ptr<NumeredEntFiniteElement_multiIndex> fe_ptr = nullptr,
848  MoFEMTypes bh = MF_EXIST,
850  int verb = DEFAULT_VERBOSITY);
851 
852  MoFEMErrorCode loop_dofs(const Problem *problem_ptr,
853  const std::string &field_name, RowColData rc,
854  DofMethod &method, int lower_rank, int upper_rank,
855  int verb = DEFAULT_VERBOSITY);
856  MoFEMErrorCode loop_dofs(const std::string &problem_name,
857  const std::string &field_name, RowColData rc,
858  DofMethod &method, int lower_rank, int upper_rank,
859  int verb = DEFAULT_VERBOSITY);
860  MoFEMErrorCode loop_dofs(const std::string &problem_name,
861  const std::string &field_name, RowColData rc,
862  DofMethod &method, int verb = DEFAULT_VERBOSITY);
863  MoFEMErrorCode loop_dofs(const std::string &field_name, DofMethod &method,
864  int verb = DEFAULT_VERBOSITY);
865  MoFEMErrorCode loop_entities(const Problem *problem_ptr,
866  const std::string field_name, RowColData rc,
867  EntityMethod &method, int lower_rank,
868  int upper_rank, int verb = DEFAULT_VERBOSITY);
869  MoFEMErrorCode loop_entities(const std::string problem_name,
870  const std::string field_name, RowColData rc,
871  EntityMethod &method, int lower_rank,
872  int upper_rank, int verb = DEFAULT_VERBOSITY);
873  MoFEMErrorCode loop_entities(const std::string problem_name,
874  const std::string field_name, RowColData rc,
875  EntityMethod &method,
876  int verb = DEFAULT_VERBOSITY);
877  MoFEMErrorCode loop_entities(const std::string field_name,
878  EntityMethod &method,
879  Range const *const ents = nullptr,
880  int verb = DEFAULT_VERBOSITY);
881 
882  /**@}*/
883 
884  /** \name Accessing multi-indices */
885 
886  /**@{*/
887 
888  MoFEMErrorCode get_fields(const Field_multiIndex **fields_ptr) const;
890  get_ref_ents(const RefEntity_multiIndex **refined_entities_ptr) const;
891  MoFEMErrorCode get_ref_finite_elements(
892  const RefElement_multiIndex **refined_finite_elements_ptr) const;
894  get_finite_elements(const FiniteElement_multiIndex **fe_ptr) const;
895  MoFEMErrorCode get_ents_finite_elements(
896  const EntFiniteElement_multiIndex **fe_ent_ptr) const;
898  get_field_ents(const FieldEntity_multiIndex **field_ents) const;
899  MoFEMErrorCode get_dofs(const DofEntity_multiIndex **dofs_ptr) const;
900  MoFEMErrorCode get_problem(const std::string &problem_name,
901  const Problem **problem_ptr) const;
902  MoFEMErrorCode get_problems(const Problem_multiIndex **problems_ptr) const;
903  MoFEMErrorCode get_ents_elements_adjacency(
905  *dofs_elements_adjacency) const;
906 
907  const Field_multiIndex *get_fields() const;
908  const RefEntity_multiIndex *get_ref_ents() const;
909  const RefElement_multiIndex *get_ref_finite_elements() const;
910  const FiniteElement_multiIndex *get_finite_elements() const;
911  const EntFiniteElement_multiIndex *get_ents_finite_elements() const;
912  const FieldEntity_multiIndex *get_field_ents() const;
913  const DofEntity_multiIndex *get_dofs() const;
914  const Problem *get_problem(const std::string &problem_name) const;
915  const Problem_multiIndex *get_problems() const;
917  get_ents_elements_adjacency() const;
918 
919  FieldEntityByUId::iterator
920  get_ent_field_by_name_begin(const std::string &field_name) const;
921  FieldEntityByUId::iterator
922  get_ent_field_by_name_end(const std::string &field_name) const;
923  DofEntityByUId::iterator
924  get_dofs_by_name_begin(const std::string &field_name) const;
925  DofEntityByUId::iterator
926  get_dofs_by_name_end(const std::string &field_name) const;
927  DofEntityByUId::iterator
928  get_dofs_by_name_and_ent_begin(const std::string &field_name,
929  const EntityHandle ent) const;
930  DofEntityByUId::iterator
931  get_dofs_by_name_and_ent_end(const std::string &field_name,
932  const EntityHandle ent) const;
933  DofEntityByUId::iterator
934  get_dofs_by_name_and_type_begin(const std::string &field_name,
935  const EntityType type) const;
936  DofEntityByUId::iterator
937  get_dofs_by_name_and_type_end(const std::string &field_name,
938  const EntityType ent) const;
939  EntFiniteElementByName::iterator
940  get_fe_by_name_begin(const std::string &fe_name) const;
941  EntFiniteElementByName::iterator
942  get_fe_by_name_end(const std::string &fe_name) const;
943 
944  /**@}*/
945 
946  /** \name Log events */
947 
948  /**@{*/
949 
950  // Events are are using for logging and hailed by PETSc
951 
952  PetscLogEvent MOFEM_EVENT_preProcess; ///< Event for preProcess finite element
953  PetscLogEvent
954  MOFEM_EVENT_operator; ///< Event for evaluating operator of finite element
955  PetscLogEvent
956  MOFEM_EVENT_postProcess; ///< Event for postProcess finite element
957  PetscLogEvent MOFEM_EVENT_createMat;
958 
959  /**@}*/
960 
961  /** \name Communicator */
962 
963  /**@{*/
964 
965  mutable MPI_Comm cOmm; ///< MoFEM communicator
966  mutable ParallelComm *pComm; ///< MOAB communicator structure
967 
968  int sIze; ///< MoFEM communicator size
969  int rAnk; ///< MOFEM communicator rank
970 
971  /**
972  * @return return communicator
973  */
974  inline MPI_Comm &get_comm() const { return cOmm; }
975 
976  /**
977  * @return return communicator size
978  */
979  inline int get_comm_size() const { return sIze; }
980 
981  /**
982  * @return return communicator rank/processor
983  */
984  inline int get_comm_rank() const { return rAnk; }
985 
986  /**@}*/
987 
988 protected:
989  struct WrapMPIComm {
990  WrapMPIComm(MPI_Comm &comm, MPI_Comm &duplicated_comm)
991  : comm(comm), duplicatedComm(duplicated_comm) {
992  ierr = PetscCommDuplicate(comm, &duplicated_comm, NULL);
993  CHKERRABORT(comm, ierr);
994  }
996  ierr = PetscCommDestroy(&duplicatedComm);
997  CHKERRABORT(comm, ierr);
998  }
999 
1000  private:
1001  MPI_Comm &comm;
1002  MPI_Comm &duplicatedComm;
1003  };
1004  boost::shared_ptr<WrapMPIComm> wrapMPIComm;
1005 
1006  int verbose; ///< Verbosity level
1007 
1008  int *fShift; ///< Ptr to tag handle storing last set bit in field ID
1009  int *feShift; ///< Ptr to tag handle storing last set bit in finite element ID
1010  int *pShift; ///< Ptr to tag handle storing last set bit in problem ID
1011 
1012  /**
1013  * \brief Hash map of pointers to interfaces
1014  */
1015  mutable boost::ptr_map<unsigned long, UnknownInterface> iFaces;
1016 
1017  mutable int *buildMoFEM; ///< keeps flags/semaphores for different stages
1018 
1019  std::string optionsPrefix; ///< Prefix for options on command line
1020 
1021  PetscBool initaliseAndBuildField; ///< If true build field on database
1022  ///< initialisation
1023 
1024  PetscBool initaliseAndBuildFiniteElements; // If true build finite elements on
1025  // database initialisation
1026 
1027  static bool isGloballyInitialised; ///< Core base globally initialized
1028  static int mpiInitialised; ///< mpi was initialised by other agent
1029  static PetscBool isInitialized; ///< petsc was initialised by other agent
1030 
1031  /**
1032  * @brief add problem
1033  *
1034  * @param id problem id
1035  * @param name problem name
1036  * @param verb verbosity level
1037  * @return MoFEMErrorCode
1038  */
1039  MoFEMErrorCode addProblem(const BitProblemId id, const std::string &name,
1040  int verb = DEFAULT_VERBOSITY);
1041 
1042  /**
1043  * \brief Get tag handles
1044  * @param verb verbosity level
1045  * @return error code
1046  */
1047  MoFEMErrorCode getTags(int verb = DEFAULT_VERBOSITY);
1048 
1049  /**
1050  * \brief Cleaning database
1051  */
1052  MoFEMErrorCode clearMap();
1053 
1054  /**
1055  * @brief Register insterfaces
1056  *
1057  * @return MoFEMErrorCode
1058  */
1059  MoFEMErrorCode registerSubInterfaces();
1060 
1061  /**
1062  * \brief Return unique field Id.
1063  *
1064  * Each time this function is called, it gives new unit field Id for bit.
1065  *
1066  */
1067  BitFieldId getFieldShift();
1068 
1069  /**
1070  * \brief Return unique finite element Id
1071  *
1072  * Each time this function is called, it gives new unit finite Id for bit.
1073  *
1074  */
1075  BitFEId getFEShift();
1076 
1077  /**
1078  * \brief Return unique problem Id
1079  *
1080  * Each time this function is called, it gives new unit problem Id for bit.
1081  *
1082  */
1083  BitProblemId getProblemShift();
1084 
1085  /**
1086  * \brief Initialize database getting information on mesh
1087  */
1088  MoFEMErrorCode initialiseDatabaseFromMesh(int verb = DEFAULT_VERBOSITY);
1089 
1090  /**
1091  * @brief Get core options from command line
1092  *
1093  * @return MoFEMErrorCode
1094  */
1095  MoFEMErrorCode getOptions(int verb = DEFAULT_VERBOSITY);
1096 
1097  /**
1098  * @brief Register subinterfac in core interface
1099  *
1100  * @tparam IFACE
1101  * @param uid
1102  * @return MoFEMErrorCode
1103  */
1104  template <class IFACE> MoFEMErrorCode regSubInterface(const MOFEMuuid &uid);
1105 };
1106 
1107 template <> struct CoreTmp<-1> : public CoreTmp<0> {
1108 
1109  static constexpr const int value = -1;
1110  const int getValue() const { return value; }
1111 
1112  virtual boost::shared_ptr<RefEntityTmp<0>>
1114 
1115  /**
1116  * Construct core database
1117  */
1118  CoreTmp(moab::Interface &moab, ///< MoAB interface
1119  MPI_Comm comm = PETSC_COMM_WORLD, ///< MPI communicator
1120  const int verbose = VERBOSE ///< Verbosity level
1121 
1122  );
1123 
1125  int verb = VERBOSE);
1126 
1127 };
1128 
1130 
1131 } // namespace MoFEM
1132 
1133 #include <CoreTemplates.hpp>
1134 
1135 #endif // __CORE_HPP__
int * feShift
Ptr to tag handle storing last set bit in finite element ID.
Definition: Core.hpp:1009
CoreTmp(moab::Interface &moab, MPI_Comm comm=PETSC_COMM_WORLD, const int verbose=VERBOSE)
Tag th_ProblemNbDofsRow
Definition: Core.hpp:262
int * fShift
Ptr to tag handle storing last set bit in field ID.
Definition: Core.hpp:1008
structure for User Loop Methods on finite elementsIt can be used to calculate stiffness matrices,...
const int getValue() const
Get the core.
Definition: Core.hpp:1110
Deprecated interface functions.
MoFEM interface unique ID.
RefElement_multiIndex refinedFiniteElements
refined elements
Definition: Core.hpp:298
static bool isGloballyInitialised
Core base globally initialized.
Definition: Core.hpp:1027
Tag th_ProblemLocalNbDofCol
Definition: Core.hpp:264
PetscLogEvent MOFEM_EVENT_createMat
Definition: Core.hpp:957
FiniteElement_multiIndex finiteElements
finite elements
Definition: Core.hpp:304
RefEntityTmp< 0 > getRefEntity(const EntityHandle ent)
Definition: Core.hpp:81
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
Tag get_th_RefType() const
Definition: Core.hpp:195
Tag th_ElemType
Needed for VTK files.
Definition: Core.hpp:266
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.
Provide data structure for (tensor) field approximation.The Field is intended to provide support for ...
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.
Tag get_th_RefBitLevel() const
Definition: Core.hpp:193
PetscLogEvent MOFEM_EVENT_postProcess
Event for postProcess finite element.
Definition: Core.hpp:956
int ApproximationOrder
Approximation on the entity.
Definition: Types.hpp:37
MoFEMErrorCode set_moab_interface(moab::Interface &new_moab, int verb)
Data structure to exchange data between mofem and User Loop Methods on entities.It allows to exchange...
moab::Interface & get_moab()
Definition: Core.hpp:319
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.
boost::shared_ptr< CacheTuple > CacheTupleSharedPtr
Struct keeps handle to refined handle.
boost::shared_ptr< WrapMPIComm > wrapMPIComm
Definition: Core.hpp:1004
boost::weak_ptr< CacheTuple > CacheTupleWeakPtr
Tag th_RefParentHandle
Definition: Core.hpp:254
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.
base class for all interface classes
PetscBool initaliseAndBuildFiniteElements
Definition: Core.hpp:1024
Problem_multiIndex pRoblems
problems multi-index
Definition: Core.hpp:310
static PetscBool isInitialized
petsc was initialised by other agent
Definition: Core.hpp:1029
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.
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.
PetscLogEvent MOFEM_EVENT_preProcess
Event for preProcess finite element.
Definition: Core.hpp:952
Interface for managing meshsets containing materials and boundary conditions.
std::bitset< BITPROBLEMID_SIZE > BitProblemId
Problem Id.
Definition: Types.hpp:55
Data structure to exchange data between mofem and User Loop Methods on entities.It allows to exchange...
keeps basic data about problemThis is low level structure with information about problem,...
char FieldBitNumber
Field bit number.
Definition: Types.hpp:39
RefEntity_multiIndex refinedEntities
refined entities
Definition: Core.hpp:297
RowColData
RowColData.
Definition: definitions.h:192
Tag get_th_RefParentHandle() const
Definition: Core.hpp:192
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:21
EntFiniteElement_multiIndex entsFiniteElements
finite element entities
Definition: Core.hpp:305
Tag th_ProblemLocalNbDofRow
Definition: Core.hpp:263
int verbose
Verbosity level.
Definition: Core.hpp:1006
Core interface class for user interface.
std::bitset< BITFEID_SIZE > BitFEId
Finite element Id.
Definition: Types.hpp:54
const int dim
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:87
constexpr int order
FieldApproximationBase
approximation base
Definition: definitions.h:150
std::reference_wrapper< moab::Interface > moab
moab database
Definition: Core.hpp:318
int rAnk
MOFEM communicator rank.
Definition: Core.hpp:969
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:67
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.
static constexpr const int value
Definition: Core.hpp:32
int * buildMoFEM
keeps flags/semaphores for different stages
Definition: Core.hpp:1017
const moab::Interface & get_moab() const
Definition: Core.hpp:320
boost::ptr_map< unsigned long, UnknownInterface > iFaces
Hash map of pointers to interfaces.
Definition: Core.hpp:1015
ParallelComm * pComm
MOAB communicator structure.
Definition: Core.hpp:966
Tag get_th_RefBitEdge() const
Definition: Core.hpp:194
PetscBool initaliseAndBuildField
Definition: Core.hpp:1021
FieldSpace
approximation spaces
Definition: definitions.h:174
std::bitset< BITFIELDID_SIZE > BitFieldId
Field Id.
Definition: Types.hpp:53
boost::shared_ptr< BasicEntityData > & get_basic_entity_data_ptr()
Get pointer to basic entity data.
Definition: Core.hpp:287
boost::shared_ptr< BasicEntityData > basicEntityDataPtr
Definition: Core.hpp:278
int get_comm_rank() const
Definition: Core.hpp:984
const int getValue() const
Definition: Core.hpp:33
virtual boost::shared_ptr< RefEntityTmp< 0 > > make_shared_ref_entity(const EntityHandle ent)
static char help[]
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:51
MPI_Comm & get_comm() const
Definition: Core.hpp:974
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
static int mpiInitialised
mpi was initialised by other agent
Definition: Core.hpp:1028
#define DEPRECATED
Definition: definitions.h:29
WrapMPIComm(MPI_Comm &comm, MPI_Comm &duplicated_comm)
Definition: Core.hpp:990
MeshsetsManager & get_meshsets_manager()
get MeshsetsManager pointer
Definition: Core.hpp:358
int * pShift
Ptr to tag handle storing last set bit in problem ID.
Definition: Core.hpp:1010
int FieldCoefficientsNumber
Number of field coefficients.
Definition: Types.hpp:38
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1943
boost::function< MoFEMErrorCode(Interface &moab, const Field &field, const EntFiniteElement &fe, Range &adjacency)> ElementAdjacencyFunct
user adjacency function
FieldEntityEntFiniteElementAdjacencyMap_multiIndex entFEAdjacencies
adjacencies of elements to dofs
Definition: Core.hpp:308
const int getValue() const
Get the core.
Definition: Core.hpp:80
Core (interface) class.
Definition: Core.hpp:77
int get_comm_size() const
Definition: Core.hpp:979
int sIze
MoFEM communicator size.
Definition: Core.hpp:968
Field_multiIndex fIelds
fields
Definition: Core.hpp:300
int & getBuildMoFEM() const
Get flags/semaphores for different stages.
Definition: Core.hpp:221
const int N
Definition: speed_test.cpp:3
FieldEntity_multiIndex entsFields
entities on fields
Definition: Core.hpp:301
MPI_Comm cOmm
MoFEM communicator.
Definition: Core.hpp:965
Tag th_Part
Tag for partition number.
Definition: Core.hpp:253
Data structure to exchange data between mofem and User Loop Methods.It allows to exchange data betwee...
MoFEMTypes
Those types control how functions respond on arguments, f.e. error handling.
Definition: definitions.h:189
const MeshsetsManager & get_meshsets_manager() const
get MeshsetsManager pointer
Definition: Core.hpp:361
DofEntity_multiIndex dofsField
dofs on fields
Definition: Core.hpp:302
PetscLogEvent MOFEM_EVENT_operator
Event for evaluating operator of finite element.
Definition: Core.hpp:954
std::string optionsPrefix
Prefix for options on command line.
Definition: Core.hpp:1019