v0.10.0
Interface.hpp
Go to the documentation of this file.
1 /** \file Interface.hpp
2  * \brief MoFEM interface
3  */
4 
5 /*
6  * MoFEM is distributed in the hope that it will be useful, but WITHOUT
7  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
9  * License for more details.
10  *
11  * You should have received a copy of the GNU Lesser General Public
12  * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>
13  */
14 
15 #ifndef __INTERFACE_HPP__
16 #define __INTERFACE_HPP__
17 
18 /** \brief name space of MoFEM library functions and classes
19  */
20 namespace MoFEM {
21 
22 struct MeshsetsManager;
23 
28 
29 /**
30  * \brief Interface
31  * \nosubgrouping
32  * \ingroup mofem
33  *
34  * This interface is used by user to: <br>
35  * - create approximation fields, <br>
36  * - declare elements, <br>
37  * - declare problems, <br>
38  *
39  * \todo Clean interface, organize groups outsource some functions to
40  * independent interface
41  */
43 
44  virtual ~CoreInterface() = default;
45 
46  /**
47  * @brief Get the core
48  *
49  * @return int
50  */
51  virtual const int getValue() const = 0;
52 
53  /**
54  * @brief Get RefEntity
55  *
56  * @param ent
57  * @return boost::shared_ptr<RefEntityTmp<0>>
58  */
59  virtual boost::shared_ptr<RefEntityTmp<0>>
60  make_shared_ref_entity(const EntityHandle ent) = 0;
61 
62  /** \name Interfaces */
63 
64  /**@{*/
65 
66  /**
67  * get moab instance
68  */
69  virtual moab::Interface &get_moab() = 0;
70 
71  /**
72  * get moab instance interface
73  */
74  virtual const moab::Interface &get_moab() const = 0;
75 
76  /**
77  * @brief Set the moab interface object
78  *
79  * @param new_moab
80  * @param verb
81  * @return MoFEMErrorCode
82  */
84  int verb = VERBOSE) = 0;
85 
86  /** \brief get MeshsetsManager pointer
87  */
89 
90  /** \brief get MeshsetsManager pointer
91  */
92  virtual const MeshsetsManager *get_meshsets_manager_ptr() const = 0;
93 
94  /** \brief get MeshsetsManager pointer
95  */
97 
98  /** \brief get MeshsetsManager pointer
99  */
100  virtual const MeshsetsManager &get_meshsets_manager() const = 0;
101 
102  /**@}*/
103 
104  /** \name Basic entity */
105 
106  /**@{*/
107 
108  /**
109  * \brief Get pointer to basic entity data.
110  *
111  * This structure keeps data like tags handlers and other data used to
112  * construct mofem entities, dofs and finite elements.
113  *
114  */
115  virtual boost::shared_ptr<BasicEntityData> &get_basic_entity_data_ptr() = 0;
116 
117  /**@}*/
118 
119  /** \name Communicator */
120 
121  /**@{*/
122 
123  /**
124  * get MPI communicator
125  *
126  */
127  virtual MPI_Comm &get_comm() const = 0;
128 
129  /**
130  * get communicator size
131  */
132  virtual int get_comm_size() const = 0;
133 
134  /**
135  * get comm rank
136  */
137  virtual int get_comm_rank() const = 0;
138 
139  /** \name Check consistency */
140 
141  /**@{*/
142 
143  /**
144  * \brief check data consistency in entitiesPtr
145  *
146  */
147  virtual MoFEMErrorCode
148  check_number_of_ents_in_ents_field(const std::string &name) const = 0;
149 
150  /**
151  * \brief check data consistency in entitiesPtr
152  *
153  */
155 
156  /**
157  * \brief check data consistency in entsFiniteElements
158  *
159  */
161  const std::string &name) const = 0;
162 
163  /**
164  * \brief check data consistency in entsFiniteElements
165  *
166  */
167  virtual MoFEMErrorCode
169 
170  /** \name Database */
171 
172  /**@{*/
173 
174  /**
175  * \brief Clear database
176  * @param verb Verbosity level
177  * @return Error code
178  */
179  virtual MoFEMErrorCode clear_database(int verb = DEFAULT_VERBOSITY) = 0;
180 
181  /**
182  * \brief Clear database and initialize it once again
183  * @param verb Verbosity level
184  * @return Error code
185  */
186  virtual MoFEMErrorCode rebuild_database(int verb = DEFAULT_VERBOSITY) = 0;
187 
188  /**@}*/
189 
190  /** \name Delete and remove */
191 
192  /**@{*/
193 
194  /**
195  * @brief Remove parents from entities
196  *
197  */
198  virtual MoFEMErrorCode
199  remove_parents_by_ents(const Range &ents, int verb = DEFAULT_VERBOSITY) = 0;
200 
201  /**
202  * @brief Remove parent from entities on bit level
203  *
204  * Evert entity created by refinement, split or any other change on the mesh
205  * can have parent. This function remove parent from entity,
206  *
207  * \note Functions makeing topological changes on entities should repsect
208  * parents child relation. This erase that relation. If you going to split
209  * faces and create interface is recommended to call this function before
210  * split opeartion.
211  *
212  * @param bit level
213  * @param mask of bit level
214  * @param verb verbosity level
215  * @return MoFEMErrorCode
216  */
217  virtual MoFEMErrorCode
218  remove_parents_by_bit_ref(const BitRefLevel bit, const BitRefLevel mask,
219  int verb = DEFAULT_VERBOSITY) = 0;
220 
221  /**
222  * @brief Remove paremts from entities having parents in passed range
223  *
224  */
225  virtual MoFEMErrorCode
226  remove_parents_by_parents(const Range &ents,
227  int verb = DEFAULT_VERBOSITY) = 0;
228 
229  /** \brief delete entities form mofem and moab database
230  *
231  */
232  virtual MoFEMErrorCode
233  delete_ents_by_bit_ref(const BitRefLevel bit, const BitRefLevel mask,
234  const bool remove_parent = false,
235  int verb = DEFAULT_VERBOSITY) = 0;
236 
237  /** \brief remove entities form mofem database
238  */
239  virtual MoFEMErrorCode remove_ents(const Range ents,
240  int verb = DEFAULT_VERBOSITY) = 0;
241 
242  /** \brief remove entities form mofem database
243  */
244  virtual MoFEMErrorCode
245  remove_ents_by_bit_ref(const BitRefLevel bit, const BitRefLevel mask,
246  int verb = DEFAULT_VERBOSITY) = 0;
247 
248  /** \brief delete finite element from mofem database
249  */
250  virtual MoFEMErrorCode
251  delete_finite_element(const std::string name,
252  int verb = DEFAULT_VERBOSITY) = 0;
253 
254  /** \name Fields */
255 
256  /**@{*/
257 
258  /**
259  * \brief Add field
260  *
261  * \note add_file is a collective, should be executed on all processors.
262  * Otherwise could lead to deadlock.
263  *
264  * @param name name of the filed
265  * @param space space (L2,H1,Hdiv,Hcurl)
266  * @param base approximation base, see FieldApproximationBase
267  * @param nb_of_coefficients number of field coefficients
268  * @param tag_type type of the tag MB_TAG_DENSE or MB_TAG_SPARSE
269  * (DENSE is faster and uses less memory, SPARSE is more flexible if you
270  * define field on subdomains)
271  * @param bh if MF_EXCL throws error if field exits, MF_ZERO
272  * no error if field exist
273  * @param verb verbosity level
274  * @return error code
275  */
276  virtual MoFEMErrorCode
277  add_field(const std::string &name, const FieldSpace space,
278  const FieldApproximationBase base,
279  const FieldCoefficientsNumber nb_of_coefficients,
280  const TagType tag_type = MB_TAG_SPARSE,
281  const enum MoFEMTypes bh = MF_EXCL,
282  int verb = DEFAULT_VERBOSITY) = 0;
283 
284  /**
285  * \brief Add entities to field meshset
286  * \ingroup mofem_field
287  *
288  * \note not collective
289  *
290  * The lower dimension entities are added depending on the space type
291  *
292  * @param ents range of entities
293  * @param dim dimension of entities
294  * @param name name of field
295  * @param verb verbosity level
296  * @return error code
297  */
298  virtual MoFEMErrorCode
299  add_ents_to_field_by_dim(const Range &ents, const int dim,
300  const std::string &name,
301  int verb = DEFAULT_VERBOSITY) = 0;
302 
303  /**
304  * \brief Add entities to field meshset
305  * \ingroup mofem_field
306  *
307  * \note not collective
308  *
309  * The lower dimension entities are added depending on the space type
310  *
311  * @param ents range of entities
312  * @param type type of entities
313  * @param name name of field
314  * @param verb verbosity level
315  * @return error code
316  */
317  virtual MoFEMErrorCode
318  add_ents_to_field_by_type(const Range &ents, const EntityType type,
319  const std::string &name,
320  int verb = DEFAULT_VERBOSITY) = 0;
321 
322  /**
323  * \brief Add entities to field meshset
324  * \ingroup mofem_field
325  *
326  * \not collective
327  *
328  * The lower dimension entities are added depending on the space type
329  *
330  * @param meshset
331  * @param dim dimension
332  * @param name name of field
333  * @param recursive take entities recursively from embedded entities
334  * @param verb verbosity level
335  * @return error code
336  */
337  virtual MoFEMErrorCode
338  add_ents_to_field_by_dim(const EntityHandle meshset, const int dim,
339  const std::string &name, const bool recursive = true,
340  int verb = DEFAULT_VERBOSITY) = 0;
341 
342  /**
343  * \brief Add entities to field meshset
344  * \ingroup mofem_field
345  *
346  * \note not collective
347  *
348  * The lower dimension entities are added depending on the space type
349  *
350  * @param meshset
351  * @param type of entities
352  * @param name name of field
353  * @param recursive take entities recursively from embedded entities
354  * @param verb verbosity level
355  * @return error code
356  */
357  virtual MoFEMErrorCode
358  add_ents_to_field_by_type(const EntityHandle meshset, const EntityType type,
359  const std::string &name,
360  const bool recursive = true,
361  int verb = DEFAULT_VERBOSITY) = 0;
362 
363  /**
364  * @brief Create a vertices and add to field object
365  *
366  * Create vertices and add them to field. Those vertices would be carring
367  * DOFs of the filed.
368  *
369  * \note This function is typically used when NOFIELD is created, for example
370  * load factor in arc-length control.
371  *
372  * @param name name of the field
373  * @param bit bit ref level of the created vertices
374  * @param coords of the vertices
375  * @param size number of vertices
376  * @param verb verbosity level
377  * @return MoFEMErrorCode
378  */
379  virtual MoFEMErrorCode
380  create_vertices_and_add_to_field(const std::string name,
381  const double coords[], int size,
382  int verb = DEFAULT_VERBOSITY) = 0;
383 
384  /**
385  * \brief remove entities from field
386  * \ingroup mofem_field
387  *
388  * \note not collective
389  *
390  */
391  virtual MoFEMErrorCode
393  const BitRefLevel mask,
394  int verb = DEFAULT_VERBOSITY) = 0;
395 
396  /**
397  * \brief remove entities from field
398  * \ingroup mofem_field
399  *
400  * \note not collective
401  *
402  */
403  virtual MoFEMErrorCode
404  remove_ents_from_field(const std::string name, const EntityHandle meshset,
405  const EntityType type,
406  int verb = DEFAULT_VERBOSITY) = 0;
407 
408  /**
409  * \brief remove entities from field
410  * \ingroup mofem_field
411  *
412  * \note not collective
413  *
414  */
415  virtual MoFEMErrorCode
416  remove_ents_from_field(const std::string name, const Range ents,
417  int verb = DEFAULT_VERBOSITY) = 0;
418 
419  /**
420  * \brief remove entities from all fields
421  * \ingroup mofem_field
422  *
423  * \note not collective
424  *
425  */
426  virtual MoFEMErrorCode
427  remove_ents_from_field(const Range ents, int verb = DEFAULT_VERBOSITY) = 0;
428 
429  /**
430  * \brief Set order approximation of the entities in the field
431  * \ingroup mofem_field
432  *
433  * \note not collective
434  *
435  * \param meshset containing set of the entities (use 0 for all the entities
436  * in the meshset) \param type selected type of the entities f.e. MBTET,
437  * MBTRI, MBEDGE, MBVERTEX, see moab documentation \param order
438  * approximation order
439  */
440  virtual MoFEMErrorCode set_field_order(const EntityHandle meshset,
441  const EntityType type,
442  const std::string &name,
444  int verb = DEFAULT_VERBOSITY) = 0;
445 
446  /**
447  * \brief Set order approximation of the entities in the field
448  * \ingroup mofem_field
449  *
450  * \note not collective
451  *
452  * \param entities
453  * \param type selected type of the entities f.e. MBTET, MBTRI, MBEDGE,
454  * MBVERTEX, see moab documentation \param order approximation order
455  */
456  virtual MoFEMErrorCode set_field_order(const Range &ents,
457  const std::string &name,
459  int verb = DEFAULT_VERBOSITY) = 0;
460 
461  /**
462  * \brief Set order approximation of the entities in the field
463  * \ingroup mofem_field
464  *
465  * \note not collective
466  *
467  * \param bit refinement level
468  * \param mask bit mask
469  * \param type selected type of the entities f.e. MBTET, MBTRI, MBEDGE,
470  * MBVERTEX, see moab documentation \param order approximation order
471  */
473  const BitRefLevel &bit, const BitRefLevel &mask, const EntityType type,
474  const std::string &name, const ApproximationOrder order,
475  int verb = DEFAULT_VERBOSITY) = 0;
476 
477  /** \brief list entities in the field
478  * \ingroup mofem_field
479  */
480  virtual MoFEMErrorCode list_fields() const = 0;
481 
482  /** build fields
483  * \ingroup mofem_field
484  */
485  virtual MoFEMErrorCode build_fields(int verb = DEFAULT_VERBOSITY) = 0;
486 
487  /**
488  * @brief build field by name
489  *
490  * @param field_name
491  * @param verb
492  * m@return MoFEMErrorCode
493  */
494  virtual MoFEMErrorCode build_field(const std::string field_name,
495  int verb = DEFAULT_VERBOSITY) = 0;
496 
497  /** \brief get field bit number
498  *
499  * \param name of Field
500  * Example:\code
501  auto field_number = mField.get_field_bit_number("DISPLACEMENT");
502  * \endcode
503  */
504  virtual FieldBitNumber get_field_bit_number(const std::string name) const = 0;
505 
506  /** \brief get field meshset
507  *
508  * \param name of Field
509  * Example:\code
510  EntityHandle disp_files_meshset = mField.get_field_meshset("DISPLACEMENT");
511  * \endcode
512  */
513  virtual EntityHandle get_field_meshset(const std::string name) const = 0;
514 
515  /**
516  * \brief get entities in the field by dimension
517  * @param name field name
518  * @param dim dim
519  * @param ents ents
520  * @return error code
521 
522  * \ingroup mofem_field
523  */
524  virtual MoFEMErrorCode get_field_entities_by_dimension(const std::string name,
525  int dim,
526  Range &ents) const = 0;
527 
528  /**
529  * \brief get entities in the field by type
530  * @param name field name
531  * @param type entity type
532  * @param ents ents
533  * @return error code
534 
535  * \ingroup mofem_field
536  */
537  virtual MoFEMErrorCode get_field_entities_by_type(const std::string name,
538  EntityType type,
539  Range &ents) const = 0;
540 
541  /**
542  * \brief get entities in the field by handle
543  * @param name field name
544  * @param ents ents
545  * @return error code
546 
547  * \ingroup mofem_field
548  */
549  virtual MoFEMErrorCode get_field_entities_by_handle(const std::string name,
550  Range &ents) const = 0;
551 
552  /** \brief check if field is in database
553  * \ingroup mofem_field
554  *
555  * \param name field name
556  * \return true if field exist
557  *
558  */
559  virtual bool check_field(const std::string &name) const = 0;
560 
561  /** \brief get field structure
562  * \ingroup mofem_field
563  *
564  * \param name field name
565  * \return const Field*
566  *
567  */
568  virtual const Field *get_field_structure(const std::string &name) = 0;
569 
570  /**@}*/
571 
572  /** \name Finite elements */
573 
574  /**@{*/
575 
576  /**
577  * \brief Check if finite element is in database
578  * @param name Name of finite element
579  * @return true if element is declared
580  */
581  virtual bool check_finite_element(const std::string &name) const = 0;
582 
583  /**
584  * \brief add finite element
585  * \ingroup mofem_fe
586  * \param name finite element name
587  *
588  * \note add_file is a collective, should be executed on all processors.
589  * Otherwise could lead to deadlock.
590  *
591  * Example \code
592  CHKERR mField.add_finite_element("ELASTIC");
593  CHKERR mField.add_finite_element("PLASTIC");
594  \endcode
595  */
596  virtual MoFEMErrorCode add_finite_element(const std::string &fe_name,
597  enum MoFEMTypes bh = MF_EXCL,
598  int verb = DEFAULT_VERBOSITY) = 0;
599 
600  /**
601  * \brief modify finite element table, only for advanced user
602  * \ingroup mofem_fe
603  *
604  * \note add_file is a collective, should be executed on all processors.
605  * Otherwise could lead to deadlock.
606  *
607  * Using that functions means that you like to do something not usual.
608  *
609  */
610  virtual MoFEMErrorCode
611  modify_finite_element_adjacency_table(const std::string &fe_name,
612  const EntityType type,
613  ElementAdjacencyFunct function) = 0;
614 
615  /** \brief set finite element field data
616  * \ingroup mofem_fe
617  *
618  * \note add_file is a collective, should be executed on all processors.
619  * Otherwise could lead to deadlock.
620  *
621  * \param name finite element name
622  * \param name field name
623  *
624  * This function will set memory in the form of a vector
625  */
626  virtual MoFEMErrorCode
627  modify_finite_element_add_field_data(const std::string &fe_name,
628  const std::string &name_filed) = 0;
629 
630  /** \brief unset finite element field data
631  * \ingroup mofem_fe
632  *
633  * \note add_file is a collective, should be executed on all processors.
634  * Otherwise could lead to deadlock.
635  *
636  * \param name finite element name
637  * \param name field name
638  *
639  * This function will set memory in the form of a vector
640  */
641  virtual MoFEMErrorCode
642  modify_finite_element_off_field_data(const std::string &fe_name,
643  const std::string &name_filed) = 0;
644 
645  /** \brief set field row which finite element use
646  * \ingroup mofem_fe
647  *
648  * \note add_file is a collective, should be executed on all processors.
649  * Otherwise could lead to deadlock.
650  *
651  * \param name finite element name
652  * \param name field name
653  */
654  virtual MoFEMErrorCode
655  modify_finite_element_add_field_row(const std::string &fe_name,
656  const std::string &name_row) = 0;
657 
658  /** \brief unset field row which finite element use
659  * \ingroup mofem_fe
660  *
661  * \note add_file is a collective, should be executed on all processors.
662  * Otherwise could lead to deadlock.
663  *
664  * \param name finite element name
665  * \param name field name
666  */
667  virtual MoFEMErrorCode
668  modify_finite_element_off_field_row(const std::string &fe_name,
669  const std::string &name_row) = 0;
670 
671  /** \brief set field col which finite element use
672  * \ingroup mofem_fe
673  *
674  * \note add_file is a collective, should be executed on all processors.
675  * Otherwise could lead to deadlock.
676  *
677  * \param name finite element name
678  * \param name field name
679  */
680  virtual MoFEMErrorCode
681  modify_finite_element_add_field_col(const std::string &fe_name,
682  const std::string &name_row) = 0;
683 
684  /** \brief unset field col which finite element use
685  * \ingroup mofem_fe
686  *
687  * \note add_file is a collective, should be executed on all processors.
688  * Otherwise could lead to deadlock.
689  *
690  * \param name finite element name
691  * \param name field name
692  */
693  virtual MoFEMErrorCode
694  modify_finite_element_off_field_col(const std::string &fe_name,
695  const std::string &name_row) = 0;
696 
697  /**
698  * \brief add entities to finite element
699  * \ingroup mofem_fe
700  *
701  * \note not collective
702  *
703  * @param entities meshset or range form were entities taken
704  * @param type type of entity
705  * @param name name of field
706  * @param recursive take entities from meshsets in meshset
707  * @return error code
708  */
710  const EntityHandle entities, const EntityType type,
711  const std::string &name, const bool recursive = true) = 0;
712 
713  /**
714  * \brief add entities to finite element
715  * \ingroup mofem_fe
716  *
717  * \note not collective
718  *
719  * @param entities meshset or range form were entities taken
720  * @param dim dimension
721  * @param name name of field
722  * @param recursive take entities from meshsets in meshset
723  * @return error code
724  */
725  virtual MoFEMErrorCode
726  add_ents_to_finite_element_by_dim(const EntityHandle entities, const int dim,
727  const std::string &name,
728  const bool recursive = true) = 0;
729 
730  /**
731  * \brief add entities to finite elements
732  * \ingroup mofem_fe
733  *
734  * \note not collective
735  *
736  * @param ents range of entities
737  * @param type type of entity (MBVERTEX, MBEDGE, MBTRI, ...)
738  * @param name name of finite element
739  * @return error code
740  */
741  virtual MoFEMErrorCode
742  add_ents_to_finite_element_by_type(const Range &ents, const EntityType type,
743  const std::string &name) = 0;
744 
745  /**
746  * \brief add entities to finite elements
747  * \ingroup mofem_fe
748  *
749  * \note not collective
750  *
751  * @param ents range of entities
752  * @param dim dimension of entities
753  * @param name name of finite element
754  * @return error code
755  */
756  virtual MoFEMErrorCode
757  add_ents_to_finite_element_by_dim(const Range &ents, const int dim,
758  const std::string &name) = 0;
759 
760  /** \brief add TET entities from given refinement level to finite element
761  * database given by name
762  * \ingroup mofem_fe
763  *
764  * \note not collective
765  *
766  * \param BitRefLevel bit
767  * \param BitRefLevel mask
768  * \param finite element name
769  * \param finite element type
770  * \param verbose level
771  */
773  const BitRefLevel &bit, const BitRefLevel &mask, const std::string &name,
774  EntityType type, int verb = DEFAULT_VERBOSITY) = 0;
775 
776  /** get finite element meshset
777  * \ingroup mofem_fe
778  *
779  */
780  virtual EntityHandle
781  get_finite_element_meshset(const std::string &name) const = 0;
782 
783  /**
784  * \brief get entities in the finite element by dimension
785  * @param name finite element name
786  * @param dim dim
787  * @param ents ents
788  * @return error code
789 
790  * \ingroup mofem_field
791  */
792  virtual MoFEMErrorCode
793  get_finite_element_entities_by_dimension(const std::string name, int dim,
794  Range &ents) const = 0;
795 
796  /**
797  * \brief get entities in the finite element by type
798  * @param name finite element name
799  * @param type entity type
800  * @param ents ents
801  * @return error code
802 
803  * \ingroup mofem_field
804  */
805  virtual MoFEMErrorCode
806  get_finite_element_entities_by_type(const std::string name, EntityType type,
807  Range &ents) const = 0;
808 
809  /**
810  * \brief get entities in the finite element by handle
811  * @param name finite element name
812  * @param ents ents
813  * @return error code
814 
815  * \ingroup mofem_field
816  */
817  virtual MoFEMErrorCode
818  get_finite_element_entities_by_handle(const std::string name,
819  Range &ents) const = 0;
820 
821  /** \brief remove elements from given refinement level to finite element
822  * database \ingroup mofem_fe
823  *
824  * \param BitRefLevel bit
825  * \param BitRefLevel mask
826  * \param verbose level
827  */
828  virtual MoFEMErrorCode
830  const BitRefLevel mask,
831  int verb = DEFAULT_VERBOSITY) = 0;
832 
833  /** \brief remove entities from given refinement level to finite element
834  * database
835  *
836  */
838  const std::string name, const EntityHandle meshset, const EntityType type,
839  int verb = DEFAULT_VERBOSITY) = 0;
840 
841  /** \brief remove entities from finite element database
842  * \ingroup mofem_fe
843  *
844  */
845  virtual MoFEMErrorCode
846  remove_ents_from_finite_element(const std::string name, const Range ents,
847  int verb = DEFAULT_VERBOSITY) = 0;
848 
849  /** \brief remove entities from finite elements in database
850  * \ingroup mofem_fe
851  *
852  */
853  virtual MoFEMErrorCode
854  remove_ents_from_finite_element(const Range ents,
855  int verb = DEFAULT_VERBOSITY) = 0;
856 
857  /** \brief add MESHSET element to finite element database given by name
858  * \ingroup mofem_fe
859  *
860  * \note not collective
861  *
862  * \param meshset contains all entities that could be used for finite
863  * element \param name Finite Element name
864  */
865  virtual MoFEMErrorCode
867  const std::string &name,
868  const bool recursive = false) = 0;
869 
870  /** \brief list finite elements in database
871  * \ingroup mofem_fe
872  */
873  virtual MoFEMErrorCode list_finite_elements() const = 0;
874 
875  /**@}*/
876 
877  /** \name Problems */
878 
879  /**@{*/
880 
881  /** \brief Add problem
882  * \ingroup mofem_problems
883  *
884  * \note add_file is a collective, should be executed on all processors.
885  * Otherwise could lead to deadlock.
886  *
887  */
888  virtual MoFEMErrorCode add_problem(const std::string &name,
889  enum MoFEMTypes bh = MF_EXCL,
890  int verb = DEFAULT_VERBOSITY) = 0;
891 
892  /**
893  * \brief check if problem exist
894  * @param name problem name
895  * @return true if problem is in database
896  */
897  virtual bool check_problem(const std::string name) = 0;
898 
899  /** \brief Delete problem
900  * \ingroup mofem_problems
901  *
902  * \note add_file is a collective, should be executed on all processors.
903  * Otherwise could lead to deadlock.
904  *
905  */
906  virtual MoFEMErrorCode delete_problem(const std::string name) = 0;
907 
908  /** \brief add finite element to problem, this add entities assigned to
909  * finite element to a particular problem \ingroup mofem_problems
910  *
911  * \note add_file is a collective, should be executed on all processors.
912  * Otherwise could lead to deadlock.
913  *
914  * \param name Problem name
915  * \param name Finite Element name
916  */
917  virtual MoFEMErrorCode
918  modify_problem_add_finite_element(const std::string &name_problem,
919  const std::string &fe_name) = 0;
920 
921  /** \brief unset finite element from problem, this remove entities assigned
922  * to finite element to a particular problem \ingroup mofem_problems
923  *
924  * Note: If problem is build, it need to be cleaned to make this effective
925  *
926  * \note add_file is a collective, should be executed on all processors.
927  * Otherwise could lead to deadlock.
928  *
929  * \param name Problem name
930  * \param name Finite Element name
931  */
932  virtual MoFEMErrorCode
933  modify_problem_unset_finite_element(const std::string &name_problem,
934  const std::string &fe_name) = 0;
935 
936  /** \brief add ref level to problem
937  * \ingroup mofem_problems
938  *
939  * \note add_file is a collective, should be executed on all processors.
940  * Otherwise could lead to deadlock.
941  *
942  * if same finite element is solved using different level of refinements,
943  * than the level of refinement has to be specificied to problem in query
944  *
945  * \param name Problem name
946  * \param BitRefLevel bitLevel
947  * Example: \code
948  CHKERR
949  mField.modify_problem_add_finite_element("BEAM_BENDING_ON_MESH_REF1","ELASTIC");
950  CHKERR
951  mField.modify_problem_add_finite_element("BEAM_BENDING_ON_MESH_REF2","ELASTIC");
952  CHKERR
953  mField.modify_problem_ref_level_add_bit("BEAM_BENDING_ON_MESH_REF1",bit_level1);
954  CHKERR
955  mField.modify_problem_ref_level_add_bit("BEAM_BENDING_ON_MESH_REF2",bit_level2);
956  *\endcode
957  * Two Problems exist and solved independently, both are elastic, but solved
958  using different mesh refinement <br>
959  */
960  virtual MoFEMErrorCode
961  modify_problem_ref_level_add_bit(const std::string &name_problem,
962  const BitRefLevel &bit) = 0;
963 
964  /** \brief set dof mask ref level for problem
965  * \ingroup mofem_problems
966  *
967  */
968  virtual MoFEMErrorCode
969  modify_problem_mask_ref_level_add_bit(const std::string &name_problem,
970  const BitRefLevel &bit) = 0;
971 
972  /** \brief set ref level for problem
973  * \ingroup mofem_problems
974  *
975  * \note add_file is a collective, should be executed on all processors.
976  * Otherwise could lead to deadlock.
977  *
978  * if same finite element is solved using different level of refinements,
979  * than the level of refinement has to be specificied to problem in query
980  *
981  * \param name Problem name
982  * \param BitRefLevel bitLevel
983  * Example: \code
984  CHKERR
985  mField.modify_problem_add_finite_element("BEAM_BENDING_ON_MESH_REF1","ELASTIC");
986  CHKERR
987  mField.modify_problem_add_finite_element("BEAM_BENDING_ON_MESH_REF2","ELASTIC");
988 
989  CHKERR
990  mField.modify_problem_ref_level_set_bit("BEAM_BENDING_ON_MESH_REF1",bit_level1);
991  CHKERR
992  mField.modify_problem_ref_level_set_bit("BEAM_BENDING_ON_MESH_REF2",bit_level2);
993  * \endcode
994  * Two Problems exist and solved independently, both are elastic, but solved
995  * using different mesh refinement <br>
996  *
997  */
998  virtual MoFEMErrorCode
999  modify_problem_ref_level_set_bit(const std::string &name_problem,
1000  const BitRefLevel &bit) = 0;
1001 
1002  /** \brief set dof mask ref level for problem
1003  * \ingroup mofem_problems
1004  *
1005  * \note add_file is a collective, should be executed on all processors.
1006  * Otherwise could lead to deadlock.
1007  *
1008  */
1009  virtual MoFEMErrorCode
1010  modify_problem_mask_ref_level_set_bit(const std::string &name_problem,
1011  const BitRefLevel &bit) = 0;
1012 
1013  /** \brief list problems
1014  * \ingroup mofem_problems
1015  */
1016  virtual MoFEMErrorCode list_problem() const = 0;
1017 
1018  /**@}*/
1019 
1020  /** \name Clear dofs and entities */
1021 
1022  /**@{*/
1023 
1024  /** list dofs
1025  * \ingroup mofem_field
1026  */
1027  virtual MoFEMErrorCode
1028  list_dofs_by_field_name(const std::string &name) const = 0;
1029 
1030  /** Clear inactive dofs
1031  * \ingroup mofem_field
1032  */
1033  virtual MoFEMErrorCode clear_inactive_dofs(int verb = DEFAULT_VERBOSITY) = 0;
1034 
1035  /** Clear dofs by bit level
1036  * \ingroup mofem_field
1037  */
1038  virtual MoFEMErrorCode
1040  int verb = DEFAULT_VERBOSITY) = 0;
1041 
1042  /** Clear dofs by ents
1043  * \ingroup mofem_field
1044  */
1045  virtual MoFEMErrorCode clear_dofs_fields(const Range ents,
1046  int verb = DEFAULT_VERBOSITY) = 0;
1047 
1048  /** Clear dofs by field name and ents
1049  * \ingroup mofem_field
1050  */
1051  virtual MoFEMErrorCode clear_dofs_fields(const std::string name,
1052  const Range ents,
1053  int verb = DEFAULT_VERBOSITY) = 0;
1054 
1055  /** Clear entities by field name
1056  * \ingroup mofem_field
1057  */
1058  virtual MoFEMErrorCode clear_ents_fields(const Range ents,
1059  int verb = DEFAULT_VERBOSITY) = 0;
1060 
1061  /** Clear entities by field name
1062  * \ingroup mofem_field
1063  */
1064  virtual MoFEMErrorCode clear_ents_fields(const std::string name,
1065  const Range ents,
1066  int verb = DEFAULT_VERBOSITY) = 0;
1067 
1068  /** Clear ents by bit level
1069  * \ingroup mofem_field
1070  */
1071  virtual MoFEMErrorCode
1073  int verb = DEFAULT_VERBOSITY) = 0;
1074 
1075  /**@}*/
1076 
1077  /** \name Build fields, finite elements and problems */
1078 
1079  /**@{*/
1080 
1081  /**
1082  * \brief Build finite elements
1083  * \ingroup mofem_fe
1084  *
1085  * Build finite element data structures. Have to be run before problem and
1086  * adjacencies are constructed.
1087  *
1088  * @param verb Verbosity level
1089  * @return Error code
1090  */
1091  virtual MoFEMErrorCode
1092  build_finite_elements(int verb = DEFAULT_VERBOSITY) = 0;
1093 
1094  /**
1095  * \brief Build finite elements
1096  * \ingroup mofem_fe
1097  *
1098  * Build finite element data structures. Have to be run before problem and
1099  * adjacencies are constructed.
1100  *
1101  * @param fe_name Name of finite element
1102  * @param ents_ptr Pointer to range of finite elements
1103  * @param verb Verbosity level
1104  * @return Error code
1105  */
1106  virtual MoFEMErrorCode
1107  build_finite_elements(const string fe_name,
1108  const Range *const ents_ptr = nullptr,
1109  int verb = DEFAULT_VERBOSITY) = 0;
1110 
1111  /**@}*/
1112 
1113  /** \name Clear finite elements */
1114 
1115  /**@{*/
1116 
1117  /** clear finite elements
1118  */
1119  virtual MoFEMErrorCode
1121  const BitRefLevel mask,
1122  int verb = DEFAULT_VERBOSITY) = 0;
1123 
1124  /** clear finite elements
1125  */
1126  virtual MoFEMErrorCode
1127  clear_finite_elements(const Range ents, int verb = DEFAULT_VERBOSITY) = 0;
1128 
1129  /** clear finite elements
1130  */
1131  virtual MoFEMErrorCode
1132  clear_finite_elements(const std::string name, const Range ents,
1133  int verb = DEFAULT_VERBOSITY) = 0;
1134 
1135  /**@}*/
1136 
1137  /** \name Build adjacencies */
1138 
1139  /**@{*/
1140 
1141  /** \brief build adjacencies
1142  *
1143  * \param list of entities
1144  *
1145  * This function will get information of adjacent finite elements and fields
1146  * of all entities. If this is not executed, partitioning the problem is not
1147  * possible. Adjacency map is based on degrees of freedom adjacent to
1148  * elements. This linked to geometric element connectivity.
1149  *
1150  * If new degrees of freedom or new finite elements are added to the
1151  * database, adjacency map has to be rebuild.
1152  *
1153  */
1154  virtual MoFEMErrorCode build_adjacencies(const Range &ents,
1155  int verb = DEFAULT_VERBOSITY) = 0;
1156 
1157  /** \brief build adjacencies
1158  *
1159  * \param bit adjacencies for refine level
1160  *
1161  * This function will get information of adjacent finite elements and fields
1162  * of all entities. If this is not executed, partitioning the problem is not
1163  * possible. Adjacency map is based on degrees of freedom adjacent to
1164  * elements. This linked to geometric element connectivity.
1165  *
1166  * If new degrees of freedom or new finite elements are added to the
1167  * database, adjacency map has to be rebuild.
1168  *
1169  */
1170  virtual MoFEMErrorCode build_adjacencies(const BitRefLevel &bit,
1171  int verb = DEFAULT_VERBOSITY) = 0;
1172 
1173  /** \brief build adjacencies
1174  *
1175  * \param bit adjacencies for refine level
1176  * \param mask mask for bit level
1177  *
1178  * This function will get information of adjacent finite elements and fields
1179  * of all entities. If this is not executed, partitioning the problem is not
1180  * possible. Adjacency map is based on degrees of freedom adjacent to
1181  * elements. This linked to geometric element connectivity.
1182  *
1183  * If new degrees of freedom or new finite elements are added to the
1184  * database, adjacency map has to be rebuild.
1185  *
1186  */
1187  virtual MoFEMErrorCode build_adjacencies(const BitRefLevel &bit,
1188  const BitRefLevel &mask,
1189  int verb = DEFAULT_VERBOSITY) = 0;
1190 
1191  /**@}*/
1192 
1193  /** \name Clear adjacencies */
1194 
1195  /**@{*/
1196 
1197  /** \brief clear adjacency map for finite elements on given bit level
1198  *
1199  * \param bit
1200  * \param mask
1201  */
1202  virtual MoFEMErrorCode
1204  const BitRefLevel mask,
1205  int verb = DEFAULT_VERBOSITY) = 0;
1206 
1207  /** \brief clear adjacency map for entities on given bit level
1208  *
1209  * \param bit
1210  * \param mask
1211  */
1212  virtual MoFEMErrorCode
1213  clear_adjacencies_entities(const BitRefLevel bit, const BitRefLevel mask,
1214  int verb = DEFAULT_VERBOSITY) = 0;
1215 
1216  /** \brief clear adjacencies for field entities by entities
1217  */
1218  virtual MoFEMErrorCode
1219  clear_adjacencies_entities(const Range ents,
1220  int verb = DEFAULT_VERBOSITY) = 0;
1221 
1222  /** \brief clear adjacencies for field entities by entities and field namd
1223  */
1224  virtual MoFEMErrorCode
1225  clear_adjacencies_entities(const std::string name, const Range ents,
1226  int verb = DEFAULT_VERBOSITY) = 0;
1227 
1228  /**@}*/
1229 
1230  /** \name Problems */
1231 
1232  /**@{*/
1233 
1234  /** \brief clear problem
1235  * \ingroup mofem_problems
1236  */
1237  virtual MoFEMErrorCode clear_problem(const std::string name,
1238  int verb = DEFAULT_VERBOSITY) = 0;
1239 
1240  /** \brief clear problems
1241  * \ingroup mofem_problems
1242  */
1243  virtual MoFEMErrorCode clear_problems(int verb = DEFAULT_VERBOSITY) = 0;
1244 
1245  /**
1246  * \brief add finite elements to the meshset
1247  * \ingroup mofem_problems
1248  *
1249  * \param name is problem name
1250  * \param fe_name
1251  * \param meshset
1252  */
1253  virtual MoFEMErrorCode
1254  get_problem_finite_elements_entities(const std::string &name,
1255  const std::string &fe_name,
1256  const EntityHandle meshset) = 0;
1257 
1258  /**@}*/
1259 
1260  /** \name Making loops on elements and entities */
1261 
1262  /**@{*/
1263 
1264  /** \brief Set data for BasicMethod
1265  *
1266  * This function set data about problem, adjacencies and other multi-indices
1267  * in database. This function can be used a special case when user need to
1268  * do some pre- and post-processing before matrix or vector is initiated, or
1269  * to assemble matrix for group of FEMethods. Is used by classes
1270  * SnesCtx and TsCtx. Look for more details there.
1271  *
1272  * FIXME: Here we need example
1273  *
1274  * \param pointer to problem data structure
1275  * \param method user method derived from BasicMethod
1276  *
1277  **/
1278  virtual MoFEMErrorCode
1279  problem_basic_method_preProcess(const Problem *problem_ptr,
1280  BasicMethod &method,
1281  int verb = DEFAULT_VERBOSITY) = 0;
1282 
1283  /** \brief Set data for BasicMethod
1284  *
1285  * This function set data about problem, adjacencies and other multi-indices
1286  * in database. This function can be used a special case when user need to
1287  * do some pre- and post-processing before matrix or vector is initiated, or
1288  * to assemble matrix for group of FEMethods. Is used by classes
1289  * SnesCtx and TsCtx. Look for more details there.
1290  *
1291  * FIXME: Here we need example
1292  *
1293  * \param problem_name name of the problem
1294  * \param method user method derived from BasicMethod
1295  *
1296  **/
1297  virtual MoFEMErrorCode
1298  problem_basic_method_preProcess(const std::string &problem_name,
1299  BasicMethod &method,
1300  int verb = DEFAULT_VERBOSITY) = 0;
1301 
1302  /** \brief Set data for BasicMethod
1303  * \ingroup mofem_loops
1304  *
1305  * This function set data about problem, adjacencies and other multi-indices
1306  * in database. This function can be used a special case when user need to
1307  * do some pre- and post-processing before matrix or vector is initiated, or
1308  * to assemble matrix for group of FEMethods. Is used by classes
1309  * SnesCtx and TsCtx. Look for more details there.
1310  *
1311  * FIXME: Here we need example
1312  *
1313  * \param pointer to problem data structure
1314  * \param method user method derived from BasicMethod
1315  *
1316  **/
1317  virtual MoFEMErrorCode
1318  problem_basic_method_postProcess(const Problem *problem_ptr,
1319  BasicMethod &method,
1320  int verb = DEFAULT_VERBOSITY) = 0;
1321 
1322  /** \brief Set data for BasicMethod
1323  * \ingroup mofem_loops
1324  *
1325  * This function set data about problem, adjacencies and other multi-indices
1326  * in database. This function can be used a special case when user need to
1327  * do some pre- and post-processing before matrix or vector is initiated, or
1328  * to assemble matrix for group of FEMethods. Is used by classes
1329  * SnesCtx and TsCtx. Look for more details there.
1330  *
1331  * FIXME: Here we need example
1332  *
1333  * \param problem_name name of the problem
1334  * \param method user method derived from BasicMethod
1335  *
1336  **/
1337  virtual MoFEMErrorCode
1338  problem_basic_method_postProcess(const std::string &problem_name,
1339  BasicMethod &method,
1340  int verb = DEFAULT_VERBOSITY) = 0;
1341 
1342  /**
1343  * @brief Cache variables
1344  *
1345  * @param prb_name
1346  * @param cache_ptr
1347  * @return MoFEMErrorCode
1348  */
1349  virtual MoFEMErrorCode
1350  cache_problem_entities(const std::string prb_name,
1351  CacheTupleWeakPtr cache_ptr) = 0;
1352 
1353  /** \brief Make a loop over finite elements.
1354  *
1355  * This function is like swiss knife, is can be used to post-processing or
1356  * matrix and vectors assembly. It makes loop over given finite element for
1357  * given
1358  * problem. The particular methods executed on each element are given by
1359  * class derived form Interface::FEMethod. At beginning of each loop user
1360  * defined function (method) preProcess() is called, for each element
1361  * operator() is
1362  * executed, at the end loop finalizes with user defined function (method)
1363  * postProcess().
1364  *
1365  * Methods are executed only for local elements at given processor.
1366  *
1367  * For more details pleas look to examples.
1368  *
1369  * \note If fe_ptr is given it is expected that multi-index is supbes of
1370  * problem multi-index. If this is not the case behavior of the code is
1371  * undetermined.
1372  *
1373  * @param problem_name problem consisting set of elements
1374  * @param fe_name name of element in problem
1375  * @param method class derived form Interface::FEMethod
1376  * @param fe_ptr pointer to finite elements multi-index
1377  * @param bh if bH = MF_EXIST, throws error if fe_name does not
1378  exist
1379  * @param cache_tuple_ptr cache
1380  * @param verb verbosity level
1381  * @return error code
1382 
1383  * \ingroup mofem_loops
1384  **/
1386  const std::string &problem_name, const std::string &fe_name,
1387  FEMethod &method,
1388  boost::shared_ptr<NumeredEntFiniteElement_multiIndex> fe_ptr = nullptr,
1389  MoFEMTypes bh = MF_EXIST,
1390  CacheTupleWeakPtr cache_ptr = CacheTupleSharedPtr(),
1391  int verb = DEFAULT_VERBOSITY) = 0;
1392 
1393  /** \brief Make a loop over finite elements on partitions from upper to
1394  lower rank.
1395  *
1396  * This function is like swiss knife, is can be used to post-processing or
1397  matrix
1398  * and vectors assembly. It makes loop over given finite element for given
1399  * problem. The particular methods executed on each element are given by
1400  * class derived form Interface::FEMethod. At beginning of each loop user
1401  defined
1402  * function (method) preProcess() is called, for each element operator() is
1403  * executed, at the end loop finalizes with user defined function (method)
1404  * postProcess().
1405  *
1406  * \note If fe_ptr is given it is expected that multi-index is supbes of
1407  * problem multi-index. If this is not the case behavior of the code is
1408  * undetermined.
1409  *
1410  * For more details please look to examples.
1411  *
1412  * Interface::FEMethod
1413 
1414  * @param problem_ptr pointer to problem consisting set of elements
1415  * @param fe_name name of element in problem
1416  * @param method class derived form Interface::FEMethod
1417  * @param lower_rank lower rank of process owned by finite element
1418  * @param upper_rank lower rank of process owned by finite element
1419  * @param fe_ptr pointer to finite elements multi-index
1420  * @param bh if bH = MF_EXIST, throws error if fe_name does not
1421  exist
1422  * @param cache_data cache data vector
1423  * @param cache_row cache row vector
1424  * @param cache_col cache row vector
1425  * @param verb verbosity level
1426  * @return error code
1427 
1428  * \ingroup mofem_loops
1429  **/
1431  const Problem *problem_ptr, const std::string &fe_name, FEMethod &method,
1432  int lower_rank, int upper_rank,
1433  boost::shared_ptr<NumeredEntFiniteElement_multiIndex> fe_ptr = nullptr,
1434  MoFEMTypes bh = MF_EXIST,
1435  CacheTupleWeakPtr cache_ptr = CacheTupleSharedPtr(),
1436  int verb = DEFAULT_VERBOSITY) = 0;
1437 
1438  /** \brief Make a loop over finite elements on partitions from upper to
1439  lower rank.
1440  *
1441  * This function is like swiss knife, is can be used to post-processing or
1442  matrix
1443  * and vectors assembly. It makes loop over given finite element for given
1444  * problem. The particular methods executed on each element are given by
1445  * class derived form Interface::FEMethod. At beginning of each loop user
1446  defined
1447  * function (method) preProcess() is called, for each element operator() is
1448  * executed, at the end loop finalizes with user defined function (method)
1449  * postProcess().
1450  *
1451  * \note If fe_ptr is given it is expected that multi-index is supbes of
1452  * problem multi-index. If this is not the case behavior of the code is
1453  * undetermined.
1454  *
1455  * For more details please look to examples.
1456  *
1457  * @param problem_name pointer to problem consisting set of elements
1458  * @param fe_name name of element in problem
1459  * @param method class derived form Interface::FEMethod
1460  * @param lower_rank lower rank of process owned by finite element
1461  * @param upper_rank lower rank of process owned by finite element
1462  * @param fe_ptr pointer to finite elements multi-index
1463  * @param bh if bH = MF_EXIST, throws error if fe_name does not
1464  exist
1465  * @param cache_data cache data vector
1466  * @param cache_row cache row vector
1467  * @param cache_col cache row vector
1468  * @param verb verbosity level
1469  * @return error code
1470 
1471  * \ingroup mofem_loops
1472  **/
1474  const std::string &problem_name, const std::string &fe_name,
1475  FEMethod &method, int lower_rank, int upper_rank,
1476  boost::shared_ptr<NumeredEntFiniteElement_multiIndex> fe_ptr = nullptr,
1477  MoFEMTypes bh = MF_EXIST,
1478  CacheTupleWeakPtr cache_ptr = CacheTupleSharedPtr(),
1479  int verb = DEFAULT_VERBOSITY) = 0;
1480 
1481  /** \brief Make a loop over dofs
1482 
1483  * \ingroup mofem_loops
1484  */
1485  virtual MoFEMErrorCode loop_dofs(const Problem *problem_ptr,
1486  const std::string &field_name, RowColData rc,
1487  DofMethod &method, int lower_rank,
1488  int upper_rank,
1489  int verb = DEFAULT_VERBOSITY) = 0;
1490 
1491  /** \brief Make a loop over dofs
1492 
1493  * \ingroup mofem_loops
1494  */
1495  virtual MoFEMErrorCode loop_dofs(const std::string &problem_name,
1496  const std::string &field_name, RowColData rc,
1497  DofMethod &method, int lower_rank,
1498  int upper_rank,
1499  int verb = DEFAULT_VERBOSITY) = 0;
1500 
1501  /** \brief Make a loop over dofs
1502 
1503  * \ingroup mofem_loops
1504  */
1505  virtual MoFEMErrorCode loop_dofs(const std::string &problem_name,
1506  const std::string &field_name, RowColData rc,
1507  DofMethod &method,
1508  int verb = DEFAULT_VERBOSITY) = 0;
1509 
1510  /** \brief Make a loop over dofs
1511 
1512  * \ingroup mofem_field
1513  */
1514  virtual MoFEMErrorCode loop_dofs(const std::string &field_name,
1515  DofMethod &method,
1516  int verb = DEFAULT_VERBOSITY) = 0;
1517 
1518  /**
1519  * @brief Loop over field entities
1520  * @ingroup mofem_field
1521  *
1522  * @param field_name field entities
1523  * @param method user method
1524  * @param ents if given loop only on subset of entities in the field
1525  * @param verb
1526  * @return MoFEMErrorCode
1527  */
1528  virtual MoFEMErrorCode loop_entities(const std::string field_name,
1529  EntityMethod &method,
1530  Range const *const ents = nullptr,
1531  int verb = DEFAULT_VERBOSITY) = 0;
1532 
1533  /**
1534  * @brief Loop over field entities in the problem
1535  * @ingroup mofem_field
1536  *
1537  * @param problem_ptr
1538  * @param field_name
1539  * @param rc
1540  * @param method
1541  * @param lower_rank
1542  * @param upper_rank
1543  * @param verb
1544  * @return MoFEMErrorCode
1545  */
1546  virtual MoFEMErrorCode loop_entities(const Problem *problem_ptr,
1547  const std::string field_name,
1548  RowColData rc, EntityMethod &method,
1549  int lower_rank, int upper_rank,
1550  int verb = DEFAULT_VERBOSITY) = 0;
1551 
1552  /**
1553  * @brief Loop over field entities in the problem
1554  * @ingroup mofem_field
1555  *
1556  * @param problem_name
1557  * @param field_name
1558  * @param rc
1559  * @param method
1560  * @param lower_rank
1561  * @param upper_rank
1562  * @param verb
1563  * @return MoFEMErrorCode
1564  */
1565  virtual MoFEMErrorCode loop_entities(const std::string problem_name,
1566  const std::string field_name,
1567  RowColData rc, EntityMethod &method,
1568  int lower_rank, int upper_rank,
1569  int verb = DEFAULT_VERBOSITY) = 0;
1570  /**
1571  * @brief Loop over field entities in the problem
1572  * @ingroup mofem_field
1573  *
1574  * @param problem_name
1575  * @param field_name
1576  * @param rc
1577  * @param method
1578  * @param verb
1579  * @return MoFEMErrorCode
1580  */
1581  virtual MoFEMErrorCode loop_entities(const std::string problem_name,
1582  const std::string field_name,
1583  RowColData rc, EntityMethod &method,
1584  int verb = DEFAULT_VERBOSITY) = 0;
1585 
1586  /**@}*/
1587 
1588  /** \name Get pointers to multi-index database */
1589 
1590  /**@{*/
1591 
1592  /**
1593  * @brief Get the fields object
1594  * @ingroup mofem_access
1595  *
1596  * @return const Field_multiIndex*
1597  */
1598  virtual const Field_multiIndex *get_fields() const = 0;
1599 
1600  /**
1601  * @brief Get the ref ents object
1602  * @ingroup mofem_access
1603  *
1604  * @return const RefEntity_multiIndex*
1605  */
1606  virtual const RefEntity_multiIndex *get_ref_ents() const = 0;
1607 
1608  /**
1609  * @brief Get the ref finite elements object
1610  * @ingroup mofem_access
1611  *
1612  * @return const RefElement_multiIndex*
1613  */
1614  virtual const RefElement_multiIndex *get_ref_finite_elements() const = 0;
1615 
1616  /**
1617  * @brief Get the finite elements object
1618  * @ingroup mofem_access
1619  *
1620  * @return const FiniteElement_multiIndex*
1621  */
1622  virtual const FiniteElement_multiIndex *get_finite_elements() const = 0;
1623 
1624  /**
1625  * @brief Get the ents finite elements object
1626  * @ingroup mofem_access
1627  *
1628  * @return const EntFiniteElement_multiIndex*
1629  */
1630  virtual const EntFiniteElement_multiIndex *
1631  get_ents_finite_elements() const = 0;
1632 
1633  /**
1634  * @brief Get the field ents object
1635  * @ingroup mofem_access
1636  *
1637  * @return const FieldEntity_multiIndex*
1638  */
1639  virtual const FieldEntity_multiIndex *get_field_ents() const = 0;
1640 
1641  /**
1642  * @brief Get the dofs object
1643  * @ingroup mofem_access
1644  *
1645  * @return const DofEntity_multiIndex*
1646  */
1647  virtual const DofEntity_multiIndex *get_dofs() const = 0;
1648 
1649  /**
1650  * @brief Get the problem object
1651  * @ingroup mofem_access
1652  *
1653  * @param problem_name
1654  * @return const Problem*
1655  */
1656  virtual const Problem *get_problem(const std::string &problem_name) const = 0;
1657 
1658  /**
1659  * @brief Get the problems object
1660  * @ingroup mofem_access
1661  *
1662  * @return const Problem_multiIndex*
1663  */
1664  virtual const Problem_multiIndex *get_problems() const = 0;
1665 
1666  /**
1667  * @brief Get the dofs elements adjacency object
1668  *
1669  * @param dofs_elements_adjacency
1670  * @return MoFEMErrorCode
1671  */
1674  *dofs_elements_adjacency) const = 0;
1675 
1676  /**
1677  * @brief Get the dofs elements adjacency object
1678  *
1679  * @return const FieldEntityEntFiniteElementAdjacencyMap_multiIndex*
1680  */
1682  get_ents_elements_adjacency() const = 0;
1683 
1684  /** \brief Get fields multi-index from database
1685  * \ingroup mofem_access
1686  */
1687  virtual MoFEMErrorCode
1688  get_fields(const Field_multiIndex **fields_ptr) const = 0;
1689 
1690  /** \brief Get ref entities multi-index from database
1691  * \ingroup mofem_access
1692  */
1693  virtual MoFEMErrorCode
1694  get_ref_ents(const RefEntity_multiIndex **refined_ents_ptr) const = 0;
1695 
1696  /** \brief Get ref finite elements multi-index form database
1697  * \ingroup mofem_access
1698  */
1700  const RefElement_multiIndex **refined_finite_elements_ptr) const = 0;
1701 
1702  /** \brief Get finite elements multi-index
1703  * \ingroup mofem_access
1704  */
1705  virtual MoFEMErrorCode
1706  get_finite_elements(const FiniteElement_multiIndex **fe_ptr) const = 0;
1707 
1708  /** \brief Get entities finite elements multi-index
1709  * \ingroup mofem_access
1710  */
1712  const EntFiniteElement_multiIndex **fe_ent_ptr) const = 0;
1713 
1714  /** \brief Get problem database (data structure)
1715  * \ingroup mofem_access
1716  */
1717  virtual MoFEMErrorCode get_problem(const std::string &problem_name,
1718  const Problem **problem_ptr) const = 0;
1719 
1720  /**
1721  * \brief Get pointer to problems multi-index
1722  * \ingroup mofem_access
1723  */
1724  virtual MoFEMErrorCode
1725  get_problems(const Problem_multiIndex **problems_ptr) const = 0;
1726 
1727  /** \brief Get field multi index
1728  *
1729  * \ingroup mofem_access
1730  *
1731  */
1732  virtual MoFEMErrorCode
1733  get_field_ents(const FieldEntity_multiIndex **field_ents) const = 0;
1734 
1735  /** \brief Get dofs multi index
1736  *
1737  * \ingroup mofem_access
1738  *
1739  */
1740  virtual MoFEMErrorCode
1741  get_dofs(const DofEntity_multiIndex **dofs_ptr) const = 0;
1742 
1743  /**
1744  * \brief get begin iterator of filed ents of given name (instead you can
1745  * use _IT_GET_ENT_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)
1746  *
1747  * \ingroup mofem_field
1748  *
1749  * for(_IT_GET_ENT_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)) {
1750  * ...
1751  * }
1752  *
1753  * \param field_name
1754  */
1755  virtual FieldEntityByUId::iterator
1756  get_ent_field_by_name_begin(const std::string &field_name) const = 0;
1757 
1758  /**
1759  * \brief get begin iterator of filed dofs of given name (instead you can
1760  * use _IT_GET_ENT_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)
1761  * \ingroup mofem_field
1762  *
1763  * for(_IT_GET_ENT_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)) {
1764  * ...
1765  * }
1766  *
1767  * \param field_name
1768  */
1769  virtual FieldEntityByUId::iterator
1770  get_ent_field_by_name_end(const std::string &field_name) const = 0;
1771 
1772  /** \brief loop over all dofs from a moFEM field and particular field
1773  * \ingroup mofem_field
1774  */
1775 #define _IT_GET_ENT_FIELD_BY_NAME_FOR_LOOP_(MFIELD, NAME, IT) \
1776  auto IT = (MFIELD).get_ent_field_by_name_begin(NAME); \
1777  IT != (MFIELD).get_ent_field_by_name_end(NAME); \
1778  IT++
1779 
1780  /**
1781  * \brief get begin iterator of filed dofs of given name (instead you can
1782  * use _IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)
1783  * \ingroup mofem_field
1784  *
1785  * for(_IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)) {
1786  * ...
1787  * }
1788  *
1789  * \param field_name
1790  */
1791  virtual DofEntityByUId::iterator
1792  get_dofs_by_name_begin(const std::string &field_name) const = 0;
1793 
1794  /**
1795  * \brief get begin iterator of filed dofs of given name (instead you can
1796  * use _IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)
1797  * \ingroup mofem_field
1798  *
1799  * for(_IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)) {
1800  * ...
1801  * }
1802  *
1803  * \param field_name
1804  */
1805  virtual DofEntityByUId::iterator
1806  get_dofs_by_name_end(const std::string &field_name) const = 0;
1807 
1808  /** loop over all dofs from a moFEM field and particular field
1809  * \ingroup mofem_field
1810  */
1811 #define _IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD, NAME, IT) \
1812  DofEntityByUId::iterator IT = (MFIELD).get_dofs_by_name_begin(NAME); \
1813  IT != (MFIELD).get_dofs_by_name_end(NAME); \
1814  IT++
1815 
1816  /**
1817  * \brief get begin iterator of filed dofs of given name and ent(instead you
1818  * can use _IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,ENT,IT)
1819  *
1820  * \ingroup mofem_field
1821  *
1822  * for(_IT_GET_DOFS_FIELD_BY_NAME_AND_ENT_FOR_LOOP_(MFIELD,NAME,ENT,IT)) {
1823  * ...
1824  * }
1825  *
1826  * \param field_name
1827  */
1828  virtual DofEntityByUId::iterator
1829  get_dofs_by_name_and_ent_begin(const std::string &field_name,
1830  const EntityHandle ent) const = 0;
1831 
1832  /**
1833  * \brief get begin iterator of filed dofs of given name and ent (instead
1834  * you can use _IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,ENT,IT)
1835  * \ingroup mofem_field
1836  *
1837  * for(_IT_GET_DOFS_FIELD_BY_NAME_AND_ENT_FOR_LOOP_(MFIELD,NAME,ENT,IT)) {
1838  * ...
1839  * }
1840  *
1841  * \param field_name
1842  */
1843  virtual DofEntityByUId::iterator
1844  get_dofs_by_name_and_ent_end(const std::string &field_name,
1845  const EntityHandle ent) const = 0;
1846 
1847  /** \brief loop over all dofs from a moFEM field and particular field
1848  * \ingroup mofem_access
1849  */
1850 #define _IT_GET_DOFS_FIELD_BY_NAME_AND_ENT_FOR_LOOP_(MFIELD, NAME, ENT, IT) \
1851  DofEntityByUId::iterator IT = \
1852  (MFIELD).get_dofs_by_name_and_ent_begin(NAME, ENT); \
1853  IT != (MFIELD).get_dofs_by_name_and_ent_end(NAME, ENT); \
1854  IT++
1855 
1856  /**
1857  * \brief get begin iterator of filed dofs of given name and ent type
1858  * (instead you can use
1859  * _IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,TYPE,IT)
1860  *
1861  * \ingroup mofem_field
1862  *
1863  * for(_IT_GET_DOFS_FIELD_BY_NAME_AND_TYPE_FOR_LOOP_(MFIELD,NAME,TYPE,IT)) {
1864  * ...
1865  * }
1866  *
1867  * \param field_name
1868  */
1869  virtual DofEntityByUId::iterator
1870  get_dofs_by_name_and_type_begin(const std::string &field_name,
1871  const EntityType type) const = 0;
1872 
1873  /**
1874  * \brief get begin iterator of filed dofs of given name end ent
1875  * type(instead you can use
1876  * _IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,TYPE,IT)
1877  *
1878  * \ingroup mofem_field
1879  *
1880  * for(_IT_GET_DOFS_FIELD_BY_NAME_AND_TYPE_FOR_LOOP_(MFIELD,NAME,TYPE,IT)) {
1881  * ...
1882  * }
1883  *
1884  * \param field_name
1885  */
1886  virtual DofEntityByUId::iterator
1887  get_dofs_by_name_and_type_end(const std::string &field_name,
1888  const EntityType type) const = 0;
1889 
1890  /** \brief loop over all dofs from a moFEM field and particular field
1891  * \ingroup mofem_field
1892  */
1893 #define _IT_GET_DOFS_FIELD_BY_NAME_AND_TYPE_FOR_LOOP_(MFIELD, NAME, TYPE, IT) \
1894  DofEntityByUId::iterator IT = \
1895  (MFIELD).get_dofs_by_name_and_type_begin(NAME, TYPE); \
1896  IT != (MFIELD).get_dofs_by_name_and_type_end(NAME, TYPE); \
1897  IT++
1898 
1899  /**
1900  * \brief get begin iterator of finite elements of given name (instead you
1901  * can use _IT_GET_FES_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)
1902  *
1903  * \ingroup mofem_access
1904  *
1905  * for(_IT_GET_FES_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)) {
1906  * ...
1907  * }
1908  *
1909  * \param fe_name
1910  */
1911  virtual EntFiniteElementByName::iterator
1912  get_fe_by_name_begin(const std::string &fe_name) const = 0;
1913 
1914  /**
1915  * \brief get end iterator of finite elements of given name (instead you can
1916  * use _IT_GET_FES_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)
1917  *
1918  * \ingroup mofem_access
1919  *
1920  * for(_IT_GET_FES_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)) {
1921  * ...
1922  * }
1923  *
1924  * \param fe_name
1925  */
1926  virtual EntFiniteElementByName::iterator
1927  get_fe_by_name_end(const std::string &fe_name) const = 0;
1928 
1929  /** \brief loop over all finite elements from a moFEM field and FE
1930  * \ingroup mofem_access
1931  */
1932 #define _IT_GET_FES_BY_NAME_FOR_LOOP_(MFIELD, NAME, IT) \
1933  EntFiniteElementByName::iterator IT = (MFIELD).get_fe_by_name_begin(NAME); \
1934  IT != (MFIELD).get_fe_by_name_end(NAME); \
1935  IT++
1936 };
1937 } // namespace MoFEM
1938 
1939 #include <DeprecatedCoreInterface.hpp>
1940 
1941 namespace MoFEM {
1942 
1944 
1945 } // namespace MoFEM
1946 
1947 #endif // __INTERFACE_HPP__
1948 
1949 /**
1950  * \defgroup mofem_field Fields
1951  * \brief Data structure for adding and managing fields
1952  *
1953  * \ingroup mofem
1954  ******************************************************************************/
1955 
1956 /**
1957  * \defgroup mofem_ref_ents Get entities and adjacencies
1958  * \brief Get adjacencies/entities for given BitRefLevel (mesh refinement)
1959  *
1960  * \ingroup mofem
1961  ******************************************************************************/
1962 
1963 /**
1964  * \defgroup mofem_fe Finite elements
1965  * \brief Adding and managing finite elements
1966  *
1967  * \ingroup mofem
1968  ******************************************************************************/
1969 
1970 /**
1971  * \defgroup mofem_problems Problems
1972  * \brief Adding and managing problems
1973  *
1974  * \ingroup mofem
1975  ******************************************************************************/
1976 
1977 /**
1978  * \defgroup mofem_loops Loops
1979  * \brief Manages complexities for integrating over finite elements and dofs.
1980  *
1981  * \ingroup mofem
1982  ******************************************************************************/
1983 
1984 /**
1985  * \defgroup mofem_access Pointers to multi-indices
1986  * \brief Get direct access to multi-indices in database
1987  *
1988  * \ingroup mofem
1989  ******************************************************************************/
virtual MoFEMErrorCode rebuild_database(int verb=DEFAULT_VERBOSITY)=0
Clear database and initialize it once again.
virtual MoFEMErrorCode add_ents_to_finite_element_by_bit_ref(const BitRefLevel &bit, const BitRefLevel &mask, const std::string &name, EntityType type, int verb=DEFAULT_VERBOSITY)=0
add TET entities from given refinement level to finite element database given by name
structure for User Loop Methods on finite elementsIt can be used to calculate stiffness matrices,...
virtual MoFEMErrorCode modify_finite_element_add_field_col(const std::string &fe_name, const std::string &name_row)=0
set field col which finite element use
static const MOFEMuuid IDD_MOFEMCoreInterface
Definition: Interface.hpp:24
virtual MoFEMErrorCode clear_adjacencies_finite_elements(const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)=0
clear adjacency map for finite elements on given bit level
virtual MoFEMErrorCode add_ents_to_finite_element_by_type(const EntityHandle entities, const EntityType type, const std::string &name, const bool recursive=true)=0
add entities to finite element
Deprecated interface functions.
MoFEM interface unique ID.
virtual MoFEMErrorCode build_adjacencies(const Range &ents, int verb=DEFAULT_VERBOSITY)=0
build adjacencies
virtual MoFEMErrorCode check_number_of_ents_in_ents_finite_element() const =0
check data consistency in entsFiniteElements
virtual bool check_problem(const std::string name)=0
check if problem exist
virtual MoFEMErrorCode get_finite_element_entities_by_dimension(const std::string name, int dim, Range &ents) const =0
get entities in the finite element by dimension
virtual MoFEMErrorCode add_ents_to_finite_element_by_dim(const EntityHandle entities, const int dim, const std::string &name, const bool recursive=true)=0
add entities to finite element
virtual MoFEMErrorCode remove_ents_by_bit_ref(const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)=0
remove entities form mofem database
virtual MeshsetsManager & get_meshsets_manager()=0
get MeshsetsManager pointer
virtual moab::Interface & get_moab()=0
virtual MoFEMErrorCode delete_problem(const std::string name)=0
Delete problem.
virtual DofEntityByUId::iterator get_dofs_by_name_and_type_begin(const std::string &field_name, const EntityType type) const =0
get begin iterator of filed dofs of given name and ent type (instead you can use IT_GET_DOFS_FIELD_BY...
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
virtual MoFEMErrorCode clear_database(int verb=DEFAULT_VERBOSITY)=0
Clear database.
virtual MoFEMErrorCode add_ents_to_finite_element_by_MESHSET(const EntityHandle meshset, const std::string &name, const bool recursive=false)=0
add MESHSET element to finite element database given by name
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.
virtual const DofEntity_multiIndex * get_dofs() const =0
Get the dofs object.
virtual boost::shared_ptr< BasicEntityData > & get_basic_entity_data_ptr()=0
Get pointer to basic entity data.
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.
virtual MoFEMErrorCode cache_problem_entities(const std::string prb_name, CacheTupleWeakPtr cache_ptr)=0
Cache variables.
virtual bool check_finite_element(const std::string &name) const =0
Check if finite element is in database.
int ApproximationOrder
Approximation on the entity.
Definition: Types.hpp:37
virtual FieldEntityByUId::iterator get_ent_field_by_name_begin(const std::string &field_name) const =0
get begin iterator of filed ents of given name (instead you can use IT_GET_ENT_FIELD_BY_NAME_FOR_LOOP...
virtual MoFEMErrorCode get_field_entities_by_handle(const std::string name, Range &ents) const =0
get entities in the field by handle
Data structure to exchange data between mofem and User Loop Methods on entities.It allows to exchange...
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
virtual const Field_multiIndex * get_fields() const =0
Get the fields object.
virtual int get_comm_size() const =0
boost::weak_ptr< CacheTuple > CacheTupleWeakPtr
virtual MoFEMErrorCode get_field_entities_by_type(const std::string name, EntityType type, Range &ents) const =0
get entities in the field by type
virtual MoFEMErrorCode modify_problem_add_finite_element(const std::string &name_problem, const std::string &fe_name)=0
add finite element to problem, this add entities assigned to finite element to a particular problem
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.
virtual const FieldEntity_multiIndex * get_field_ents() const =0
Get the field ents object.
base class for all interface classes
virtual DofEntityByUId::iterator get_dofs_by_name_and_type_end(const std::string &field_name, const EntityType type) const =0
get begin iterator of filed dofs of given name end ent type(instead you can use IT_GET_DOFS_FIELD_BY_...
virtual const RefEntity_multiIndex * get_ref_ents() const =0
Get the ref ents object.
virtual MoFEMErrorCode get_field_entities_by_dimension(const std::string name, int dim, Range &ents) const =0
get entities in the field by dimension
virtual MoFEMErrorCode add_field(const std::string &name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_of_coefficients, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
Add field.
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.
virtual MeshsetsManager * get_meshsets_manager_ptr()=0
get MeshsetsManager pointer
virtual MoFEMErrorCode modify_finite_element_off_field_data(const std::string &fe_name, const std::string &name_filed)=0
unset finite element field data
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.
virtual MoFEMErrorCode delete_ents_by_bit_ref(const BitRefLevel bit, const BitRefLevel mask, const bool remove_parent=false, int verb=DEFAULT_VERBOSITY)=0
delete entities form mofem and moab database
Interface for managing meshsets containing materials and boundary conditions.
virtual MoFEMErrorCode clear_adjacencies_entities(const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)=0
clear adjacency map for entities on given bit level
virtual MoFEMErrorCode remove_parents_by_bit_ref(const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)=0
Remove parent from entities on bit level.
virtual MoFEMErrorCode loop_entities(const std::string field_name, EntityMethod &method, Range const *const ents=nullptr, int verb=DEFAULT_VERBOSITY)=0
Loop over field entities.
virtual EntFiniteElementByName::iterator get_fe_by_name_end(const std::string &fe_name) const =0
get end iterator of finite elements of given name (instead you can use IT_GET_FES_BY_NAME_FOR_LOOP(MF...
virtual MoFEMErrorCode set_field_order(const EntityHandle meshset, const EntityType type, const std::string &name, const ApproximationOrder order, int verb=DEFAULT_VERBOSITY)=0
Set order approximation of the entities in the field.
virtual FieldEntityByUId::iterator get_ent_field_by_name_end(const std::string &field_name) const =0
get begin iterator of filed dofs of given name (instead you can use IT_GET_ENT_FIELD_BY_NAME_FOR_LOOP...
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
virtual const RefElement_multiIndex * get_ref_finite_elements() const =0
Get the ref finite elements object.
RowColData
RowColData.
Definition: definitions.h:192
std::bitset< BITINTERFACEUID_SIZE > BitIntefaceId
Definition: Types.hpp:56
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:21
virtual MoFEMErrorCode list_finite_elements() const =0
list finite elements in database
Deprecated interface functions.
virtual MoFEMErrorCode remove_ents(const Range ents, int verb=DEFAULT_VERBOSITY)=0
remove entities form mofem database
virtual const int getValue() const =0
Get the core.
const int dim
virtual MoFEMErrorCode modify_problem_ref_level_set_bit(const std::string &name_problem, const BitRefLevel &bit)=0
set ref level for problem
virtual MoFEMErrorCode modify_finite_element_off_field_col(const std::string &fe_name, const std::string &name_row)=0
unset field col which finite element use
virtual const FieldEntityEntFiniteElementAdjacencyMap_multiIndex * get_ents_elements_adjacency() const =0
Get the dofs elements adjacency object.
virtual MoFEMErrorCode clear_dofs_fields_by_bit_ref(const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)=0
virtual DofEntityByUId::iterator get_dofs_by_name_and_ent_begin(const std::string &field_name, const EntityHandle ent) const =0
get begin iterator of filed dofs of given name and ent(instead you can use IT_GET_DOFS_FIELD_BY_NAME_...
virtual MoFEMErrorCode get_finite_element_entities_by_handle(const std::string name, Range &ents) const =0
get entities in the finite element by handle
virtual ~CoreInterface()=default
virtual int get_comm_rank() const =0
virtual DofEntityByUId::iterator get_dofs_by_name_end(const std::string &field_name) const =0
get begin iterator of filed dofs of given name (instead you can use IT_GET_DOFS_FIELD_BY_NAME_FOR_LOO...
constexpr int order
virtual MoFEMErrorCode clear_problems(int verb=DEFAULT_VERBOSITY)=0
clear problems
FieldApproximationBase
approximation base
Definition: definitions.h:150
virtual MoFEMErrorCode clear_dofs_fields(const Range ents, int verb=DEFAULT_VERBOSITY)=0
virtual MoFEMErrorCode list_problem() const =0
list problems
virtual MoFEMErrorCode add_ents_to_field_by_type(const Range &ents, const EntityType type, const std::string &name, int verb=DEFAULT_VERBOSITY)=0
Add entities to field meshset.
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.
InterfaceThis interface is used by user to:
Definition: Interface.hpp:42
virtual const FiniteElement_multiIndex * get_finite_elements() const =0
Get the finite elements object.
virtual MoFEMErrorCode remove_ents_from_finite_element_by_bit_ref(const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)=0
remove elements from given refinement level to finite element database
virtual MoFEMErrorCode clear_finite_elements(const Range ents, int verb=DEFAULT_VERBOSITY)=0
virtual DofEntityByUId::iterator get_dofs_by_name_begin(const std::string &field_name) const =0
get begin iterator of filed dofs of given name (instead you can use IT_GET_DOFS_FIELD_BY_NAME_FOR_LOO...
virtual MoFEMErrorCode check_number_of_ents_in_ents_field() const =0
check data consistency in entitiesPtr
virtual FieldBitNumber get_field_bit_number(const std::string name) const =0
get field bit number
virtual MoFEMErrorCode modify_problem_unset_finite_element(const std::string &name_problem, const std::string &fe_name)=0
unset finite element from problem, this remove entities assigned to finite element to a particular pr...
virtual MoFEMErrorCode loop_dofs(const Problem *problem_ptr, const std::string &field_name, RowColData rc, DofMethod &method, int lower_rank, int upper_rank, int verb=DEFAULT_VERBOSITY)=0
Make a loop over dofs.
virtual MoFEMErrorCode modify_problem_ref_level_add_bit(const std::string &name_problem, const BitRefLevel &bit)=0
add ref level to problem
FieldSpace
approximation spaces
Definition: definitions.h:174
virtual MoFEMErrorCode problem_basic_method_preProcess(const Problem *problem_ptr, BasicMethod &method, int verb=DEFAULT_VERBOSITY)=0
Set data for BasicMethod.
virtual MoFEMErrorCode modify_finite_element_adjacency_table(const std::string &fe_name, const EntityType type, ElementAdjacencyFunct function)=0
modify finite element table, only for advanced user
virtual MoFEMErrorCode modify_finite_element_off_field_row(const std::string &fe_name, const std::string &name_row)=0
unset field row which finite element use
virtual MoFEMErrorCode add_finite_element(const std::string &fe_name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
add finite element
virtual EntityHandle get_finite_element_meshset(const std::string &name) const =0
virtual MoFEMErrorCode list_dofs_by_field_name(const std::string &name) const =0
virtual MoFEMErrorCode modify_finite_element_add_field_data(const std::string &fe_name, const std::string &name_filed)=0
set finite element field data
virtual MoFEMErrorCode remove_ents_from_field(const std::string name, const EntityHandle meshset, const EntityType type, int verb=DEFAULT_VERBOSITY)=0
remove entities from field
virtual MoFEMErrorCode clear_finite_elements_by_bit_ref(const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)=0
virtual EntityHandle get_field_meshset(const std::string name) const =0
get field meshset
virtual MoFEMErrorCode remove_parents_by_ents(const Range &ents, int verb=DEFAULT_VERBOSITY)=0
Remove parents from entities.
virtual MoFEMErrorCode clear_ents_fields_by_bit_ref(const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)=0
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:51
virtual MoFEMErrorCode create_vertices_and_add_to_field(const std::string name, const double coords[], int size, int verb=DEFAULT_VERBOSITY)=0
Create a vertices and add to field object.
virtual MoFEMErrorCode build_fields(int verb=DEFAULT_VERBOSITY)=0
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
virtual MoFEMErrorCode remove_parents_by_parents(const Range &ents, int verb=DEFAULT_VERBOSITY)=0
Remove paremts from entities having parents in passed range.
virtual MoFEMErrorCode remove_ents_from_finite_element(const std::string name, const EntityHandle meshset, const EntityType type, int verb=DEFAULT_VERBOSITY)=0
remove entities from given refinement level to finite element database
virtual MoFEMErrorCode add_problem(const std::string &name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
Add problem.
virtual MoFEMErrorCode modify_problem_mask_ref_level_set_bit(const std::string &name_problem, const BitRefLevel &bit)=0
set dof mask ref level for problem
virtual const Problem * get_problem(const std::string &problem_name) const =0
Get the problem object.
virtual MoFEMErrorCode get_problem_finite_elements_entities(const std::string &name, const std::string &fe_name, const EntityHandle meshset)=0
add finite elements to the meshset
virtual bool check_field(const std::string &name) const =0
check if field is in database
virtual const EntFiniteElement_multiIndex * get_ents_finite_elements() const =0
Get the ents finite elements object.
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
virtual const Problem_multiIndex * get_problems() const =0
Get the problems object.
virtual EntFiniteElementByName::iterator get_fe_by_name_begin(const std::string &fe_name) const =0
get begin iterator of finite elements of given name (instead you can use IT_GET_FES_BY_NAME_FOR_LOOP(...
virtual MoFEMErrorCode clear_inactive_dofs(int verb=DEFAULT_VERBOSITY)=0
virtual MoFEMErrorCode set_moab_interface(moab::Interface &new_moab, int verb=VERBOSE)=0
Set the moab interface object.
virtual MoFEMErrorCode modify_finite_element_add_field_row(const std::string &fe_name, const std::string &name_row)=0
set field row which finite element use
virtual DofEntityByUId::iterator get_dofs_by_name_and_ent_end(const std::string &field_name, const EntityHandle ent) const =0
get begin iterator of filed dofs of given name and ent (instead you can use IT_GET_DOFS_FIELD_BY_NAME...
virtual MoFEMErrorCode set_field_order_by_entity_type_and_bit_ref(const BitRefLevel &bit, const BitRefLevel &mask, const EntityType type, const std::string &name, const ApproximationOrder order, int verb=DEFAULT_VERBOSITY)=0
Set order approximation of the entities in the field.
virtual MoFEMErrorCode loop_finite_elements(const std::string &problem_name, const std::string &fe_name, FEMethod &method, boost::shared_ptr< NumeredEntFiniteElement_multiIndex > fe_ptr=nullptr, MoFEMTypes bh=MF_EXIST, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr(), int verb=DEFAULT_VERBOSITY)=0
Make a loop over finite elements.
virtual MoFEMErrorCode get_finite_element_entities_by_type(const std::string name, EntityType type, Range &ents) const =0
get entities in the finite element by type
virtual MPI_Comm & get_comm() const =0
virtual MoFEMErrorCode build_field(const std::string field_name, int verb=DEFAULT_VERBOSITY)=0
build field by name
virtual const Field * get_field_structure(const std::string &name)=0
get field structure
virtual boost::shared_ptr< RefEntityTmp< 0 > > make_shared_ref_entity(const EntityHandle ent)=0
Get RefEntity.
static const MOFEMuuid IDD_MOFEMDeprecatedCoreInterface
Definition: Interface.hpp:26
virtual MoFEMErrorCode add_ents_to_field_by_dim(const Range &ents, const int dim, const std::string &name, int verb=DEFAULT_VERBOSITY)=0
Add entities to field meshset.
virtual MoFEMErrorCode problem_basic_method_postProcess(const Problem *problem_ptr, BasicMethod &method, int verb=DEFAULT_VERBOSITY)=0
Set data for BasicMethodThis function set data about problem, adjacencies and other multi-indices in ...
virtual MoFEMErrorCode build_finite_elements(int verb=DEFAULT_VERBOSITY)=0
Build finite elementsBuild finite element data structures. Have to be run before problem and adjacenc...
Data structure to exchange data between mofem and User Loop Methods.It allows to exchange data betwee...
virtual MoFEMErrorCode clear_ents_fields(const Range ents, int verb=DEFAULT_VERBOSITY)=0
virtual MoFEMErrorCode clear_problem(const std::string name, int verb=DEFAULT_VERBOSITY)=0
clear problem
MoFEMTypes
Those types control how functions respond on arguments, f.e. error handling.
Definition: definitions.h:189
virtual MoFEMErrorCode delete_finite_element(const std::string name, int verb=DEFAULT_VERBOSITY)=0
delete finite element from mofem database
virtual MoFEMErrorCode remove_ents_from_field_by_bit_ref(const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)=0
remove entities from field
virtual MoFEMErrorCode modify_problem_mask_ref_level_add_bit(const std::string &name_problem, const BitRefLevel &bit)=0
set dof mask ref level for problem
virtual MoFEMErrorCode list_fields() const =0
list entities in the field