v0.8.21
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,
1092  const Range *const ents_ptr = nullptr,
1093  int verb = DEFAULT_VERBOSITY) = 0;
1094 
1095  /**@}*/
1096 
1097  /** \name Clear finite elements */
1098 
1099  /**@{*/
1100 
1101  /** clear finite elements
1102  */
1103  virtual MoFEMErrorCode
1105  const BitRefLevel &mask,
1106  int verb = DEFAULT_VERBOSITY) = 0;
1107 
1108  /** clear finite elements
1109  */
1110  virtual MoFEMErrorCode
1111  clear_finite_elements(const Range &ents, int verb = DEFAULT_VERBOSITY) = 0;
1112 
1113  /** clear finite elements
1114  */
1115  virtual MoFEMErrorCode
1116  clear_finite_elements(const std::string &name, const Range &ents,
1117  int verb = DEFAULT_VERBOSITY) = 0;
1118 
1119  /**@}*/
1120 
1121  /** \name Build adjacencies */
1122 
1123  /**@{*/
1124 
1125  /** \brief build adjacencies
1126  *
1127  * \param list of entities
1128  *
1129  * This function will get information of adjacent finite elements and fields
1130  * of all entities. If this is not executed, partitioning the problem is not
1131  * possible. Adjacency map is based on degrees of freedom adjacent to
1132  * elements. This linked to geometric element connectivity.
1133  *
1134  * If new degrees of freedom or new finite elements are added to the
1135  * database, adjacency map has to be rebuild.
1136  *
1137  */
1138  virtual MoFEMErrorCode build_adjacencies(const Range &ents,
1139  int verb = DEFAULT_VERBOSITY) = 0;
1140 
1141  /** \brief build adjacencies
1142  *
1143  * \param bit adjacencies for refine level
1144  *
1145  * This function will get information of adjacent finite elements and fields
1146  * of all entities. If this is not executed, partitioning the problem is not
1147  * possible. Adjacency map is based on degrees of freedom adjacent to
1148  * elements. This linked to geometric element connectivity.
1149  *
1150  * If new degrees of freedom or new finite elements are added to the
1151  * database, adjacency map has to be rebuild.
1152  *
1153  */
1154  virtual MoFEMErrorCode build_adjacencies(const BitRefLevel &bit,
1155  int verb = DEFAULT_VERBOSITY) = 0;
1156 
1157  /** \brief build adjacencies
1158  *
1159  * \param bit adjacencies for refine level
1160  * \param mask mask for bit level
1161  *
1162  * This function will get information of adjacent finite elements and fields
1163  * of all entities. If this is not executed, partitioning the problem is not
1164  * possible. Adjacency map is based on degrees of freedom adjacent to
1165  * elements. This linked to geometric element connectivity.
1166  *
1167  * If new degrees of freedom or new finite elements are added to the
1168  * database, adjacency map has to be rebuild.
1169  *
1170  */
1171  virtual MoFEMErrorCode build_adjacencies(const BitRefLevel &bit,
1172  const BitRefLevel &mask,
1173  int verb = DEFAULT_VERBOSITY) = 0;
1174 
1175  /**@}*/
1176 
1177  /** \name Clear adjacencies */
1178 
1179  /**@{*/
1180 
1181  /** \brief clear adjacency map for finite elements on given bit level
1182  *
1183  * \param bit
1184  * \param mask
1185  */
1186  virtual MoFEMErrorCode
1188  const BitRefLevel &mask,
1189  int verb = DEFAULT_VERBOSITY) = 0;
1190 
1191  /** \brief clear adjacency map for entities on given bit level
1192  *
1193  * \param bit
1194  * \param mask
1195  */
1196  virtual MoFEMErrorCode
1197  clear_adjacencies_entities(const BitRefLevel &bit, const BitRefLevel &mask,
1198  int verb = DEFAULT_VERBOSITY) = 0;
1199 
1200  /** \brief clear adjacencies for field entities by entities
1201  */
1202  virtual MoFEMErrorCode
1203  clear_adjacencies_entities(const Range &ents,
1204  int verb = DEFAULT_VERBOSITY) = 0;
1205 
1206  /** \brief clear adjacencies for field entities by entities and field namd
1207  */
1208  virtual MoFEMErrorCode
1209  clear_adjacencies_entities(const std::string &name, const Range &ents,
1210  int verb = DEFAULT_VERBOSITY) = 0;
1211 
1212  /**@}*/
1213 
1214  /** \name Problems */
1215 
1216  /**@{*/
1217 
1218  /** \brief clear problem
1219  * \ingroup mofem_problems
1220  */
1221  virtual MoFEMErrorCode clear_problem(const std::string &name,
1222  int verb = DEFAULT_VERBOSITY) = 0;
1223 
1224  /** \brief clear problems
1225  * \ingroup mofem_problems
1226  */
1227  virtual MoFEMErrorCode clear_problems(int verb = DEFAULT_VERBOSITY) = 0;
1228 
1229  /**
1230  * \brief resolve shared entities for finite elements in the problem
1231  * \ingroup mofem_problems
1232 
1233  * @param problem_ptr problem pointer
1234  * @param fe_name finite element name
1235  * @param verb verbosity level
1236  * @return error code
1237  *
1238  * This allows for tag reduction or tag exchange, f.e.
1239 
1240  \code
1241  Tag th;
1242  rval = mField.get_moab().tag_get_handle("ADAPT_ORDER",th);
1243  CHKERRQ_MOAB(rval); ParallelComm* pcomm =
1244  ParallelComm::get_pcomm(&mField.get_moab(),MYPCOMM_INDEX);
1245  // rval = pcomm->reduce_tags(th,MPI_SUM,prisms);
1246  rval = pcomm->exchange_tags(th,prisms);
1247  \endcode
1248 
1249  *
1250  */
1251  virtual MoFEMErrorCode resolve_shared_ents(const Problem *problem_ptr,
1252  const std::string &fe_name,
1253  int verb = DEFAULT_VERBOSITY) = 0;
1254 
1255  /**
1256  * \brief resolve shared entities for finite elements in the problem
1257  * \ingroup mofem_problems
1258 
1259  * @param name problem name
1260  * @param fe_name finite element name
1261  * @param verb verbosity level
1262  * @return error code
1263  *
1264  * This allows for tag reduction or tag exchange, f.e.
1265 
1266  \code
1267  CHKERR m_field.resolve_shared_ents(problem_ptr,"SHELL_ELEMENT");
1268  Tag th;
1269  CHKERR mField.get_moab().tag_get_handle("ADAPT_ORDER",th); CHKERRQ_MOAB(rval);
1270  ParallelComm* pcomm =
1271  ParallelComm::get_pcomm(&mField.get_moab(),MYPCOMM_INDEX);
1272  // CHKERR pcomm->reduce_tags(th,MPI_SUM,prisms);
1273  CHKERR pcomm->exchange_tags(th,prisms);
1274  \endcode
1275 
1276  *
1277  */
1278  virtual MoFEMErrorCode resolve_shared_ents(const std::string &name,
1279  const std::string &fe_name,
1280  int verb = DEFAULT_VERBOSITY) = 0;
1281 
1282  /**
1283  * \brief add finite elements to the meshset
1284  * \ingroup mofem_problems
1285  *
1286  * \param name is problem name
1287  * \param fe_name
1288  * \param meshset
1289  */
1290  virtual MoFEMErrorCode
1291  get_problem_finite_elements_entities(const std::string &name,
1292  const std::string &fe_name,
1293  const EntityHandle meshset) = 0;
1294 
1295  /**@}*/
1296 
1297  /** \name Making loops on elements and entities */
1298 
1299  /**@{*/
1300 
1301  /** \brief Set data for BasicMethod
1302  *
1303  * This function set data about problem, adjacencies and other multi-indices
1304  * in database. This function can be used a special case when user need to
1305  * do some pre- and post-processing before matrix or vector is initiated, or
1306  * to assemble matrix for group of FEMethods. Is used by classes
1307  * SnesCtx and TsCtx. Look for more details there.
1308  *
1309  * FIXME: Here we need example
1310  *
1311  * \param pointer to problem data structure
1312  * \param method user method derived from BasicMethod
1313  *
1314  **/
1315  virtual MoFEMErrorCode
1316  problem_basic_method_preProcess(const Problem *problem_ptr,
1317  BasicMethod &method,
1318  int verb = DEFAULT_VERBOSITY) = 0;
1319 
1320  /** \brief Set data for BasicMethod
1321  *
1322  * This function set data about problem, adjacencies and other multi-indices
1323  * in database. This function can be used a special case when user need to
1324  * do some pre- and post-processing before matrix or vector is initiated, or
1325  * to assemble matrix for group of FEMethods. Is used by classes
1326  * SnesCtx and TsCtx. Look for more details there.
1327  *
1328  * FIXME: Here we need example
1329  *
1330  * \param problem_name name of the problem
1331  * \param method user method derived from BasicMethod
1332  *
1333  **/
1334  virtual MoFEMErrorCode
1335  problem_basic_method_preProcess(const std::string &problem_name,
1336  BasicMethod &method,
1337  int verb = DEFAULT_VERBOSITY) = 0;
1338 
1339  /** \brief Set data for BasicMethod
1340  * \ingroup mofem_loops
1341  *
1342  * This function set data about problem, adjacencies and other multi-indices
1343  * in database. This function can be used a special case when user need to
1344  * do some pre- and post-processing before matrix or vector is initiated, or
1345  * to assemble matrix for group of FEMethods. Is used by classes
1346  * SnesCtx and TsCtx. Look for more details there.
1347  *
1348  * FIXME: Here we need example
1349  *
1350  * \param pointer to problem data structure
1351  * \param method user method derived from BasicMethod
1352  *
1353  **/
1354  virtual MoFEMErrorCode
1355  problem_basic_method_postProcess(const Problem *problem_ptr,
1356  BasicMethod &method,
1357  int verb = DEFAULT_VERBOSITY) = 0;
1358 
1359  /** \brief Set data for BasicMethod
1360  * \ingroup mofem_loops
1361  *
1362  * This function set data about problem, adjacencies and other multi-indices
1363  * in database. This function can be used a special case when user need to
1364  * do some pre- and post-processing before matrix or vector is initiated, or
1365  * to assemble matrix for group of FEMethods. Is used by classes
1366  * SnesCtx and TsCtx. Look for more details there.
1367  *
1368  * FIXME: Here we need example
1369  *
1370  * \param problem_name name of the problem
1371  * \param method user method derived from BasicMethod
1372  *
1373  **/
1374  virtual MoFEMErrorCode
1375  problem_basic_method_postProcess(const std::string &problem_name,
1376  BasicMethod &method,
1377  int verb = DEFAULT_VERBOSITY) = 0;
1378 
1379  /** \brief Make a loop over finite elements.
1380  *
1381  * This function is like swiss knife, is can be used to post-processing or
1382  matrix
1383  * and vectors assembly. It makes loop over given finite element for given
1384  * problem. The particular methods executed on each element are given by
1385  * class derived form Interface::FEMethod. At beginning of each loop user
1386  defined
1387  * function (method) preProcess() is called, for each element operator() is
1388  * executed, at the end loop finalizes with user defined function (method)
1389  * postProcess().
1390  *
1391  * Methods are executed only for local elements at given processor.
1392  *
1393  * For more details pleas look to examples.
1394 
1395  * @param problem_name problem consisting set of elements
1396  * @param fe_name name of element in problem
1397  * @param method class derived form Interface::FEMethod
1398  * @param bh if bH = MF_EXIST, throws error if fe_name does not
1399  exist
1400  * @param verb verbosity level
1401  * @return error code
1402 
1403  * \ingroup mofem_loops
1404  **/
1405  virtual MoFEMErrorCode loop_finite_elements(const std::string &problem_name,
1406  const std::string &fe_name,
1407  FEMethod &method,
1408  MoFEMTypes bh = MF_EXIST,
1409  int verb = DEFAULT_VERBOSITY) = 0;
1410 
1411  /** \brief Make a loop over finite elements on partitions from upper to
1412  lower rank.
1413  *
1414  * This function is like swiss knife, is can be used to post-processing or
1415  matrix
1416  * and vectors assembly. It makes loop over given finite element for given
1417  * problem. The particular methods executed on each element are given by
1418  * class derived form Interface::FEMethod. At beginning of each loop user
1419  defined
1420  * function (method) preProcess() is called, for each element operator() is
1421  * executed, at the end loop finalizes with user defined function (method)
1422  * postProcess().
1423  *
1424  * For more details please look to examples.
1425  *
1426  * Interface::FEMethod
1427 
1428  * @param problem_ptr pointer to problem consisting set of elements
1429  * @param fe_name name of element in problem
1430  * @param method class derived form Interface::FEMethod
1431  * @param lower_rank lower rank of process owned by finite element
1432  * @param upper_rank lower rank of process owned by finite element
1433  * @param bh if bH = MF_EXIST, throws error if fe_name does not
1434  exist
1435  * @param verb verbosity level
1436  * @return error code
1437 
1438  * \ingroup mofem_loops
1439  **/
1440  virtual MoFEMErrorCode loop_finite_elements(const Problem *problem_ptr,
1441  const std::string &fe_name,
1442  FEMethod &method, int lower_rank,
1443  int upper_rank,
1444  MoFEMTypes bh = MF_EXIST,
1445  int verb = DEFAULT_VERBOSITY) = 0;
1446 
1447  /** \brief Make a loop over finite elements on partitions from upper to
1448  lower rank.
1449  *
1450  * This function is like swiss knife, is can be used to post-processing or
1451  matrix
1452  * and vectors assembly. It makes loop over given finite element for given
1453  * problem. The particular methods executed on each element are given by
1454  * class derived form Interface::FEMethod. At beginning of each loop user
1455  defined
1456  * function (method) preProcess() is called, for each element operator() is
1457  * executed, at the end loop finalizes with user defined function (method)
1458  * postProcess().
1459  *
1460  * For more details please look to examples.
1461  *
1462 
1463  * @param problem_name pointer to problem consisting set of elements
1464  * @param fe_name name of element in problem
1465  * @param method class derived form Interface::FEMethod
1466  * @param lower_rank lower rank of process owned by finite element
1467  * @param upper_rank lower rank of process owned by finite element
1468  * @param bh if bH = MF_EXIST, throws error if fe_name does not
1469  exist
1470  * @param verb verbosity level
1471  * @return error code
1472 
1473  * \ingroup mofem_loops
1474  **/
1475  virtual MoFEMErrorCode loop_finite_elements(const std::string &problem_name,
1476  const std::string &fe_name,
1477  FEMethod &method, int lower_rank,
1478  int upper_rank,
1479  MoFEMTypes bh = MF_EXIST,
1480  int verb = DEFAULT_VERBOSITY) = 0;
1481 
1482  /** \brief Make a loop over dofs
1483 
1484  * \ingroup mofem_loops
1485  */
1486  virtual MoFEMErrorCode loop_dofs(const Problem *problem_ptr,
1487  const std::string &field_name, RowColData rc,
1488  DofMethod &method, int lower_rank,
1489  int upper_rank,
1490  int verb = DEFAULT_VERBOSITY) = 0;
1491 
1492  /** \brief Make a loop over dofs
1493 
1494  * \ingroup mofem_loops
1495  */
1496  virtual MoFEMErrorCode loop_dofs(const std::string &problem_name,
1497  const std::string &field_name, RowColData rc,
1498  DofMethod &method, int lower_rank,
1499  int upper_rank,
1500  int verb = DEFAULT_VERBOSITY) = 0;
1501 
1502  /** \brief Make a loop over dofs
1503 
1504  * \ingroup mofem_loops
1505  */
1506  virtual MoFEMErrorCode loop_dofs(const std::string &problem_name,
1507  const std::string &field_name, RowColData rc,
1508  DofMethod &method,
1509  int verb = DEFAULT_VERBOSITY) = 0;
1510 
1511  /** \brief Make a loop over dofs
1512 
1513  * \ingroup mofem_field
1514  */
1515  virtual MoFEMErrorCode loop_dofs(const std::string &field_name,
1516  DofMethod &method,
1517  int verb = DEFAULT_VERBOSITY) = 0;
1518 
1519  /**
1520  * @brief Loop over field entities
1521  * @ingroup mofem_field
1522  *
1523  * @param field_name field entities
1524  * @param method user method
1525  * @param ents if given loop only on subset of entities in the field
1526  * @param verb
1527  * @return MoFEMErrorCode
1528  */
1529  virtual MoFEMErrorCode loop_entities(const std::string field_name,
1530  EntityMethod &method,
1531  Range const *const ents = nullptr,
1532  int verb = DEFAULT_VERBOSITY) = 0;
1533 
1534  /**
1535  * @brief Loop over field entities in the problem
1536  * @ingroup mofem_field
1537  *
1538  * @param problem_ptr
1539  * @param field_name
1540  * @param rc
1541  * @param method
1542  * @param lower_rank
1543  * @param upper_rank
1544  * @param verb
1545  * @return MoFEMErrorCode
1546  */
1547  virtual MoFEMErrorCode loop_entities(const Problem *problem_ptr,
1548  const std::string field_name,
1549  RowColData rc, EntityMethod &method,
1550  int lower_rank, int upper_rank,
1551  int verb = DEFAULT_VERBOSITY) = 0;
1552 
1553  /**
1554  * @brief Loop over field entities in the problem
1555  * @ingroup mofem_field
1556  *
1557  * @param problem_name
1558  * @param field_name
1559  * @param rc
1560  * @param method
1561  * @param lower_rank
1562  * @param upper_rank
1563  * @param verb
1564  * @return MoFEMErrorCode
1565  */
1566  virtual MoFEMErrorCode loop_entities(const std::string problem_name,
1567  const std::string field_name,
1568  RowColData rc, EntityMethod &method,
1569  int lower_rank, int upper_rank,
1570  int verb = DEFAULT_VERBOSITY) = 0;
1571  /**
1572  * @brief Loop over field entities in the problem
1573  * @ingroup mofem_field
1574  *
1575  * @param problem_name
1576  * @param field_name
1577  * @param rc
1578  * @param method
1579  * @param verb
1580  * @return MoFEMErrorCode
1581  */
1582  virtual MoFEMErrorCode loop_entities(const std::string problem_name,
1583  const std::string field_name,
1584  RowColData rc, EntityMethod &method,
1585  int verb = DEFAULT_VERBOSITY) = 0;
1586 
1587  /**@}*/
1588 
1589  /** \name Get pointers to multi-index database */
1590 
1591  /**@{*/
1592 
1593  /** \brief Get fields multi-index from database
1594  * \ingroup mofem_access
1595  */
1596  virtual MoFEMErrorCode
1597  get_fields(const Field_multiIndex **fields_ptr) const = 0;
1598 
1599  /** \brief Get ref entities multi-index from database
1600  * \ingroup mofem_access
1601  */
1602  virtual MoFEMErrorCode
1603  get_ref_ents(const RefEntity_multiIndex **refined_ents_ptr) const = 0;
1604 
1605  /** \brief Get ref finite elements multi-index form database
1606  * \ingroup mofem_access
1607  */
1609  const RefElement_multiIndex **refined_finite_elements_ptr) const = 0;
1610 
1611  /** \brief Get finite elements multi-index
1612  * \ingroup mofem_access
1613  */
1614  virtual MoFEMErrorCode
1615  get_finite_elements(const FiniteElement_multiIndex **fe_ptr) const = 0;
1616 
1617  /** \brief Get entities finite elements multi-index
1618  * \ingroup mofem_access
1619  */
1621  const EntFiniteElement_multiIndex **fe_ent_ptr) const = 0;
1622 
1623  /** \brief Get problem database (data structure)
1624  * \ingroup mofem_access
1625  */
1626  virtual MoFEMErrorCode get_problem(const std::string &problem_name,
1627  const Problem **problem_ptr) const = 0;
1628 
1629  /**
1630  * \brief Get pointer to problems multi-index
1631  * \ingroup mofem_access
1632  */
1633  virtual MoFEMErrorCode
1634  get_problems(const Problem_multiIndex **problems_ptr) const = 0;
1635 
1636  /** \brief Get field multi index
1637  *
1638  * \ingroup mofem_access
1639  *
1640  */
1641  virtual MoFEMErrorCode
1642  get_field_ents(const FieldEntity_multiIndex **field_ents) const = 0;
1643 
1644  /** \brief Get dofs multi index
1645  *
1646  * \ingroup mofem_access
1647  *
1648  */
1649  virtual MoFEMErrorCode
1650  get_dofs(const DofEntity_multiIndex **dofs_ptr) const = 0;
1651 
1652  /**
1653  * \brief get begin iterator of filed ents of given name (instead you can
1654  * use _IT_GET_ENT_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)
1655  *
1656  * \ingroup mofem_field
1657  *
1658  * for(_IT_GET_ENT_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)) {
1659  * ...
1660  * }
1661  *
1662  * \param field_name
1663  */
1664  virtual FieldEntityByFieldName::iterator
1665  get_ent_field_by_name_begin(const std::string &field_name) const = 0;
1666 
1667  /**
1668  * \brief get begin iterator of filed dofs of given name (instead you can
1669  * use _IT_GET_ENT_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)
1670  * \ingroup mofem_field
1671  *
1672  * for(_IT_GET_ENT_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)) {
1673  * ...
1674  * }
1675  *
1676  * \param field_name
1677  */
1678  virtual FieldEntityByFieldName::iterator
1679  get_ent_field_by_name_end(const std::string &field_name) const = 0;
1680 
1681  /** \brief loop over all dofs from a moFEM field and particular field
1682  * \ingroup mofem_field
1683  */
1684 #define _IT_GET_ENT_FIELD_BY_NAME_FOR_LOOP_(MFIELD, NAME, IT) \
1685  FieldEntityByFieldName::iterator IT = \
1686  (MFIELD).get_ent_field_by_name_begin(NAME); \
1687  IT != (MFIELD).get_ent_field_by_name_end(NAME); \
1688  IT++
1689 
1690  /**
1691  * \brief get begin iterator of filed dofs of given name (instead you can
1692  * use _IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)
1693  * \ingroup mofem_field
1694  *
1695  * for(_IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)) {
1696  * ...
1697  * }
1698  *
1699  * \param field_name
1700  */
1701  virtual DofEntityByFieldName::iterator
1702  get_dofs_by_name_begin(const std::string &field_name) const = 0;
1703 
1704  /**
1705  * \brief get begin iterator of filed dofs of given name (instead you can
1706  * use _IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)
1707  * \ingroup mofem_field
1708  *
1709  * for(_IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)) {
1710  * ...
1711  * }
1712  *
1713  * \param field_name
1714  */
1715  virtual DofEntityByFieldName::iterator
1716  get_dofs_by_name_end(const std::string &field_name) const = 0;
1717 
1718  /** loop over all dofs from a moFEM field and particular field
1719  * \ingroup mofem_field
1720  */
1721 #define _IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD, NAME, IT) \
1722  DofEntityByFieldName::iterator IT = (MFIELD).get_dofs_by_name_begin(NAME); \
1723  IT != (MFIELD).get_dofs_by_name_end(NAME); \
1724  IT++
1725 
1726  /**
1727  * \brief get begin iterator of filed dofs of given name and ent(instead you
1728  * can use _IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,ENT,IT)
1729  *
1730  * \ingroup mofem_field
1731  *
1732  * for(_IT_GET_DOFS_FIELD_BY_NAME_AND_ENT_FOR_LOOP_(MFIELD,NAME,ENT,IT)) {
1733  * ...
1734  * }
1735  *
1736  * \param field_name
1737  */
1738  virtual DofEntityByNameAndEnt::iterator
1739  get_dofs_by_name_and_ent_begin(const std::string &field_name,
1740  const EntityHandle ent) const = 0;
1741 
1742  /**
1743  * \brief get begin iterator of filed dofs of given name and ent (instead
1744  * you can use _IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,ENT,IT)
1745  * \ingroup mofem_field
1746  *
1747  * for(_IT_GET_DOFS_FIELD_BY_NAME_AND_ENT_FOR_LOOP_(MFIELD,NAME,ENT,IT)) {
1748  * ...
1749  * }
1750  *
1751  * \param field_name
1752  */
1753  virtual DofEntityByNameAndEnt::iterator
1754  get_dofs_by_name_and_ent_end(const std::string &field_name,
1755  const EntityHandle ent) const = 0;
1756 
1757  /** \brief loop over all dofs from a moFEM field and particular field
1758  * \ingroup mofem_access
1759  */
1760 #define _IT_GET_DOFS_FIELD_BY_NAME_AND_ENT_FOR_LOOP_(MFIELD, NAME, ENT, IT) \
1761  DofEntityByNameAndEnt::iterator IT = \
1762  (MFIELD).get_dofs_by_name_and_ent_begin(NAME, ENT); \
1763  IT != (MFIELD).get_dofs_by_name_and_ent_end(NAME, ENT); \
1764  IT++
1765 
1766  /**
1767  * \brief get begin iterator of filed dofs of given name and ent type
1768  * (instead you can use
1769  * _IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,TYPE,IT)
1770  *
1771  * \ingroup mofem_field
1772  *
1773  * for(_IT_GET_DOFS_FIELD_BY_NAME_AND_TYPE_FOR_LOOP_(MFIELD,NAME,TYPE,IT)) {
1774  * ...
1775  * }
1776  *
1777  * \param field_name
1778  */
1779  virtual DofEntityByNameAndType::iterator
1780  get_dofs_by_name_and_type_begin(const std::string &field_name,
1781  const EntityType type) const = 0;
1782 
1783  /**
1784  * \brief get begin iterator of filed dofs of given name end ent
1785  * type(instead you can use
1786  * _IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,TYPE,IT)
1787  *
1788  * \ingroup mofem_field
1789  *
1790  * for(_IT_GET_DOFS_FIELD_BY_NAME_AND_TYPE_FOR_LOOP_(MFIELD,NAME,TYPE,IT)) {
1791  * ...
1792  * }
1793  *
1794  * \param field_name
1795  */
1796  virtual DofEntityByNameAndType::iterator
1797  get_dofs_by_name_and_type_end(const std::string &field_name,
1798  const EntityType type) const = 0;
1799 
1800  /** \brief loop over all dofs from a moFEM field and particular field
1801  * \ingroup mofem_field
1802  */
1803 #define _IT_GET_DOFS_FIELD_BY_NAME_AND_TYPE_FOR_LOOP_(MFIELD, NAME, TYPE, IT) \
1804  DofEntityByNameAndType::iterator IT = \
1805  (MFIELD).get_dofs_by_name_and_type_begin(NAME, TYPE); \
1806  IT != (MFIELD).get_dofs_by_name_and_type_end(NAME, TYPE); \
1807  IT++
1808 
1809  /**
1810  * \brief get begin iterator of finite elements of given name (instead you
1811  * can use _IT_GET_FES_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)
1812  *
1813  * \ingroup mofem_access
1814  *
1815  * for(_IT_GET_FES_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)) {
1816  * ...
1817  * }
1818  *
1819  * \param fe_name
1820  */
1821  virtual EntFiniteElementByName::iterator
1822  get_fe_by_name_begin(const std::string &fe_name) const = 0;
1823 
1824  /**
1825  * \brief get end iterator of finite elements of given name (instead you can
1826  * use _IT_GET_FES_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)
1827  *
1828  * \ingroup mofem_access
1829  *
1830  * for(_IT_GET_FES_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)) {
1831  * ...
1832  * }
1833  *
1834  * \param fe_name
1835  */
1836  virtual EntFiniteElementByName::iterator
1837  get_fe_by_name_end(const std::string &fe_name) const = 0;
1838 
1839  /** \brief loop over all finite elements from a moFEM field and FE
1840  * \ingroup mofem_access
1841  */
1842 #define _IT_GET_FES_BY_NAME_FOR_LOOP_(MFIELD, NAME, IT) \
1843  EntFiniteElementByName::iterator IT = (MFIELD).get_fe_by_name_begin(NAME); \
1844  IT != (MFIELD).get_fe_by_name_end(NAME); \
1845  IT++
1846 };
1847 } // namespace MoFEM
1848 
1849 #include <DeprecatedCoreInterface.hpp>
1850 
1851 namespace MoFEM {
1852 
1853 #if __cplusplus <= 199711L
1855 #else
1857 #endif
1858 }
1859 
1860 #endif // __INTERFACE_HPP__
1861 
1862 /**
1863  * \defgroup mofem_field Fields
1864  * \brief Data structure for adding and managing fields
1865  *
1866  * \ingroup mofem
1867  ******************************************************************************/
1868 
1869 /**
1870  * \defgroup mofem_ref_ents Get entities and adjacencies
1871  * \brief Get adjacencies/entities for given BitRefLevel (mesh refinement)
1872  *
1873  * \ingroup mofem
1874  ******************************************************************************/
1875 
1876 /**
1877  * \defgroup mofem_fe Finite elements
1878  * \brief Adding and managing finite elements
1879  *
1880  * \ingroup mofem
1881  ******************************************************************************/
1882 
1883 /**
1884  * \defgroup mofem_problems Problems
1885  * \brief Adding and managing problems
1886  *
1887  * \ingroup mofem
1888  ******************************************************************************/
1889 
1890 /**
1891  * \defgroup mofem_loops Loops
1892  * \brief Manages complexities for integrating over finite elements and dofs.
1893  *
1894  * \ingroup mofem
1895  ******************************************************************************/
1896 
1897 /**
1898  * \defgroup mofem_access Pointers to multi-indices
1899  * \brief Get direct access to multi-indices in database
1900  *
1901  * \ingroup mofem
1902  ******************************************************************************/
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
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 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.It allows to exchange...
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
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.
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_...
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
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
std::bitset< BITINTERFACEUID_SIZE > BitIntefaceId
Definition: Types.hpp:56
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.
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
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.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:66
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
std::bitset< BITFIELDID_SIZE > BitFieldId
Field Id.
Definition: Types.hpp:53
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...
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:51
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
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...