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