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