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