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