v0.8.23
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 and vectors assembly. It makes loop over given finite element for
1383  * 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 function (method) preProcess() is called, for each element
1387  * 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  * \note If fe_ptr is given it is expected that multi-index is supbes of
1396  * problem multi-index. If this is not the case behavior of the code is
1397  * undetermined.
1398  *
1399  * @param problem_name problem consisting set of elements
1400  * @param fe_name name of element in problem
1401  * @param method class derived form Interface::FEMethod
1402  * @param fe_ptr pointer to finite elements multi-index
1403  * @param bh if bH = MF_EXIST, throws error if fe_name does not
1404  exist
1405  * @param verb verbosity level
1406  * @return error code
1407 
1408  * \ingroup mofem_loops
1409  **/
1411  const std::string &problem_name, const std::string &fe_name,
1412  FEMethod &method,
1413  boost::shared_ptr<NumeredEntFiniteElement_multiIndex> fe_ptr = nullptr,
1414  MoFEMTypes bh = MF_EXIST, int verb = DEFAULT_VERBOSITY) = 0;
1415 
1416  /** \brief Make a loop over finite elements on partitions from upper to
1417  lower rank.
1418  *
1419  * This function is like swiss knife, is can be used to post-processing or
1420  matrix
1421  * and vectors assembly. It makes loop over given finite element for given
1422  * problem. The particular methods executed on each element are given by
1423  * class derived form Interface::FEMethod. At beginning of each loop user
1424  defined
1425  * function (method) preProcess() is called, for each element operator() is
1426  * executed, at the end loop finalizes with user defined function (method)
1427  * postProcess().
1428  *
1429  * \note If fe_ptr is given it is expected that multi-index is supbes of
1430  * problem multi-index. If this is not the case behavior of the code is
1431  * undetermined.
1432  *
1433  * For more details please look to examples.
1434  *
1435  * Interface::FEMethod
1436 
1437  * @param problem_ptr pointer to problem consisting set of elements
1438  * @param fe_name name of element in problem
1439  * @param method class derived form Interface::FEMethod
1440  * @param lower_rank lower rank of process owned by finite element
1441  * @param upper_rank lower rank of process owned by finite element
1442  * @param fe_ptr pointer to finite elements multi-index
1443  * @param bh if bH = MF_EXIST, throws error if fe_name does not
1444  exist
1445  * @param verb verbosity level
1446  * @return error code
1447 
1448  * \ingroup mofem_loops
1449  **/
1451  const Problem *problem_ptr, const std::string &fe_name, FEMethod &method,
1452  int lower_rank, int upper_rank,
1453  boost::shared_ptr<NumeredEntFiniteElement_multiIndex> fe_ptr = nullptr,
1454  MoFEMTypes bh = MF_EXIST, int verb = DEFAULT_VERBOSITY) = 0;
1455 
1456  /** \brief Make a loop over finite elements on partitions from upper to
1457  lower rank.
1458  *
1459  * This function is like swiss knife, is can be used to post-processing or
1460  matrix
1461  * and vectors assembly. It makes loop over given finite element for given
1462  * problem. The particular methods executed on each element are given by
1463  * class derived form Interface::FEMethod. At beginning of each loop user
1464  defined
1465  * function (method) preProcess() is called, for each element operator() is
1466  * executed, at the end loop finalizes with user defined function (method)
1467  * postProcess().
1468  *
1469  * \note If fe_ptr is given it is expected that multi-index is supbes of
1470  * problem multi-index. If this is not the case behavior of the code is
1471  * undetermined.
1472  *
1473  * For more details please look to examples.
1474  *
1475  * @param problem_name pointer to problem consisting set of elements
1476  * @param fe_name name of element in problem
1477  * @param method class derived form Interface::FEMethod
1478  * @param lower_rank lower rank of process owned by finite element
1479  * @param upper_rank lower rank of process owned by finite element
1480  * @param fe_ptr pointer to finite elements multi-index
1481  * @param bh if bH = MF_EXIST, throws error if fe_name does not
1482  exist
1483  * @param verb verbosity level
1484  * @return error code
1485 
1486  * \ingroup mofem_loops
1487  **/
1489  const std::string &problem_name, const std::string &fe_name,
1490  FEMethod &method, int lower_rank, int upper_rank,
1491  boost::shared_ptr<NumeredEntFiniteElement_multiIndex> fe_ptr = nullptr,
1492  MoFEMTypes bh = MF_EXIST, int verb = DEFAULT_VERBOSITY) = 0;
1493 
1494  /** \brief Make a loop over dofs
1495 
1496  * \ingroup mofem_loops
1497  */
1498  virtual MoFEMErrorCode loop_dofs(const Problem *problem_ptr,
1499  const std::string &field_name, RowColData rc,
1500  DofMethod &method, int lower_rank,
1501  int upper_rank,
1502  int verb = DEFAULT_VERBOSITY) = 0;
1503 
1504  /** \brief Make a loop over dofs
1505 
1506  * \ingroup mofem_loops
1507  */
1508  virtual MoFEMErrorCode loop_dofs(const std::string &problem_name,
1509  const std::string &field_name, RowColData rc,
1510  DofMethod &method, int lower_rank,
1511  int upper_rank,
1512  int verb = DEFAULT_VERBOSITY) = 0;
1513 
1514  /** \brief Make a loop over dofs
1515 
1516  * \ingroup mofem_loops
1517  */
1518  virtual MoFEMErrorCode loop_dofs(const std::string &problem_name,
1519  const std::string &field_name, RowColData rc,
1520  DofMethod &method,
1521  int verb = DEFAULT_VERBOSITY) = 0;
1522 
1523  /** \brief Make a loop over dofs
1524 
1525  * \ingroup mofem_field
1526  */
1527  virtual MoFEMErrorCode loop_dofs(const std::string &field_name,
1528  DofMethod &method,
1529  int verb = DEFAULT_VERBOSITY) = 0;
1530 
1531  /**
1532  * @brief Loop over field entities
1533  * @ingroup mofem_field
1534  *
1535  * @param field_name field entities
1536  * @param method user method
1537  * @param ents if given loop only on subset of entities in the field
1538  * @param verb
1539  * @return MoFEMErrorCode
1540  */
1541  virtual MoFEMErrorCode loop_entities(const std::string field_name,
1542  EntityMethod &method,
1543  Range const *const ents = nullptr,
1544  int verb = DEFAULT_VERBOSITY) = 0;
1545 
1546  /**
1547  * @brief Loop over field entities in the problem
1548  * @ingroup mofem_field
1549  *
1550  * @param problem_ptr
1551  * @param field_name
1552  * @param rc
1553  * @param method
1554  * @param lower_rank
1555  * @param upper_rank
1556  * @param verb
1557  * @return MoFEMErrorCode
1558  */
1559  virtual MoFEMErrorCode loop_entities(const Problem *problem_ptr,
1560  const std::string field_name,
1561  RowColData rc, EntityMethod &method,
1562  int lower_rank, int upper_rank,
1563  int verb = DEFAULT_VERBOSITY) = 0;
1564 
1565  /**
1566  * @brief Loop over field entities in the problem
1567  * @ingroup mofem_field
1568  *
1569  * @param problem_name
1570  * @param field_name
1571  * @param rc
1572  * @param method
1573  * @param lower_rank
1574  * @param upper_rank
1575  * @param verb
1576  * @return MoFEMErrorCode
1577  */
1578  virtual MoFEMErrorCode loop_entities(const std::string problem_name,
1579  const std::string field_name,
1580  RowColData rc, EntityMethod &method,
1581  int lower_rank, int upper_rank,
1582  int verb = DEFAULT_VERBOSITY) = 0;
1583  /**
1584  * @brief Loop over field entities in the problem
1585  * @ingroup mofem_field
1586  *
1587  * @param problem_name
1588  * @param field_name
1589  * @param rc
1590  * @param method
1591  * @param verb
1592  * @return MoFEMErrorCode
1593  */
1594  virtual MoFEMErrorCode loop_entities(const std::string problem_name,
1595  const std::string field_name,
1596  RowColData rc, EntityMethod &method,
1597  int verb = DEFAULT_VERBOSITY) = 0;
1598 
1599  /**@}*/
1600 
1601  /** \name Get pointers to multi-index database */
1602 
1603  /**@{*/
1604 
1605  /** \brief Get fields multi-index from database
1606  * \ingroup mofem_access
1607  */
1608  virtual MoFEMErrorCode
1609  get_fields(const Field_multiIndex **fields_ptr) const = 0;
1610 
1611  /** \brief Get ref entities multi-index from database
1612  * \ingroup mofem_access
1613  */
1614  virtual MoFEMErrorCode
1615  get_ref_ents(const RefEntity_multiIndex **refined_ents_ptr) const = 0;
1616 
1617  /** \brief Get ref finite elements multi-index form database
1618  * \ingroup mofem_access
1619  */
1621  const RefElement_multiIndex **refined_finite_elements_ptr) const = 0;
1622 
1623  /** \brief Get finite elements multi-index
1624  * \ingroup mofem_access
1625  */
1626  virtual MoFEMErrorCode
1627  get_finite_elements(const FiniteElement_multiIndex **fe_ptr) const = 0;
1628 
1629  /** \brief Get entities finite elements multi-index
1630  * \ingroup mofem_access
1631  */
1633  const EntFiniteElement_multiIndex **fe_ent_ptr) const = 0;
1634 
1635  /** \brief Get problem database (data structure)
1636  * \ingroup mofem_access
1637  */
1638  virtual MoFEMErrorCode get_problem(const std::string &problem_name,
1639  const Problem **problem_ptr) const = 0;
1640 
1641  /**
1642  * \brief Get pointer to problems multi-index
1643  * \ingroup mofem_access
1644  */
1645  virtual MoFEMErrorCode
1646  get_problems(const Problem_multiIndex **problems_ptr) const = 0;
1647 
1648  /** \brief Get field multi index
1649  *
1650  * \ingroup mofem_access
1651  *
1652  */
1653  virtual MoFEMErrorCode
1654  get_field_ents(const FieldEntity_multiIndex **field_ents) const = 0;
1655 
1656  /** \brief Get dofs multi index
1657  *
1658  * \ingroup mofem_access
1659  *
1660  */
1661  virtual MoFEMErrorCode
1662  get_dofs(const DofEntity_multiIndex **dofs_ptr) const = 0;
1663 
1664  /**
1665  * \brief get begin iterator of filed ents of given name (instead you can
1666  * use _IT_GET_ENT_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)
1667  *
1668  * \ingroup mofem_field
1669  *
1670  * for(_IT_GET_ENT_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)) {
1671  * ...
1672  * }
1673  *
1674  * \param field_name
1675  */
1676  virtual FieldEntityByFieldName::iterator
1677  get_ent_field_by_name_begin(const std::string &field_name) const = 0;
1678 
1679  /**
1680  * \brief get begin iterator of filed dofs of given name (instead you can
1681  * use _IT_GET_ENT_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)
1682  * \ingroup mofem_field
1683  *
1684  * for(_IT_GET_ENT_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)) {
1685  * ...
1686  * }
1687  *
1688  * \param field_name
1689  */
1690  virtual FieldEntityByFieldName::iterator
1691  get_ent_field_by_name_end(const std::string &field_name) const = 0;
1692 
1693  /** \brief loop over all dofs from a moFEM field and particular field
1694  * \ingroup mofem_field
1695  */
1696 #define _IT_GET_ENT_FIELD_BY_NAME_FOR_LOOP_(MFIELD, NAME, IT) \
1697  FieldEntityByFieldName::iterator IT = \
1698  (MFIELD).get_ent_field_by_name_begin(NAME); \
1699  IT != (MFIELD).get_ent_field_by_name_end(NAME); \
1700  IT++
1701 
1702  /**
1703  * \brief get begin iterator of filed dofs of given name (instead you can
1704  * use _IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)
1705  * \ingroup mofem_field
1706  *
1707  * for(_IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)) {
1708  * ...
1709  * }
1710  *
1711  * \param field_name
1712  */
1713  virtual DofEntityByFieldName::iterator
1714  get_dofs_by_name_begin(const std::string &field_name) const = 0;
1715 
1716  /**
1717  * \brief get begin iterator of filed dofs of given name (instead you can
1718  * use _IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)
1719  * \ingroup mofem_field
1720  *
1721  * for(_IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)) {
1722  * ...
1723  * }
1724  *
1725  * \param field_name
1726  */
1727  virtual DofEntityByFieldName::iterator
1728  get_dofs_by_name_end(const std::string &field_name) const = 0;
1729 
1730  /** loop over all dofs from a moFEM field and particular field
1731  * \ingroup mofem_field
1732  */
1733 #define _IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD, NAME, IT) \
1734  DofEntityByFieldName::iterator IT = (MFIELD).get_dofs_by_name_begin(NAME); \
1735  IT != (MFIELD).get_dofs_by_name_end(NAME); \
1736  IT++
1737 
1738  /**
1739  * \brief get begin iterator of filed dofs of given name and ent(instead you
1740  * can use _IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,ENT,IT)
1741  *
1742  * \ingroup mofem_field
1743  *
1744  * for(_IT_GET_DOFS_FIELD_BY_NAME_AND_ENT_FOR_LOOP_(MFIELD,NAME,ENT,IT)) {
1745  * ...
1746  * }
1747  *
1748  * \param field_name
1749  */
1750  virtual DofEntityByNameAndEnt::iterator
1751  get_dofs_by_name_and_ent_begin(const std::string &field_name,
1752  const EntityHandle ent) const = 0;
1753 
1754  /**
1755  * \brief get begin iterator of filed dofs of given name and ent (instead
1756  * you can use _IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,ENT,IT)
1757  * \ingroup mofem_field
1758  *
1759  * for(_IT_GET_DOFS_FIELD_BY_NAME_AND_ENT_FOR_LOOP_(MFIELD,NAME,ENT,IT)) {
1760  * ...
1761  * }
1762  *
1763  * \param field_name
1764  */
1765  virtual DofEntityByNameAndEnt::iterator
1766  get_dofs_by_name_and_ent_end(const std::string &field_name,
1767  const EntityHandle ent) const = 0;
1768 
1769  /** \brief loop over all dofs from a moFEM field and particular field
1770  * \ingroup mofem_access
1771  */
1772 #define _IT_GET_DOFS_FIELD_BY_NAME_AND_ENT_FOR_LOOP_(MFIELD, NAME, ENT, IT) \
1773  DofEntityByNameAndEnt::iterator IT = \
1774  (MFIELD).get_dofs_by_name_and_ent_begin(NAME, ENT); \
1775  IT != (MFIELD).get_dofs_by_name_and_ent_end(NAME, ENT); \
1776  IT++
1777 
1778  /**
1779  * \brief get begin iterator of filed dofs of given name and ent type
1780  * (instead you can use
1781  * _IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,TYPE,IT)
1782  *
1783  * \ingroup mofem_field
1784  *
1785  * for(_IT_GET_DOFS_FIELD_BY_NAME_AND_TYPE_FOR_LOOP_(MFIELD,NAME,TYPE,IT)) {
1786  * ...
1787  * }
1788  *
1789  * \param field_name
1790  */
1791  virtual DofEntityByNameAndType::iterator
1792  get_dofs_by_name_and_type_begin(const std::string &field_name,
1793  const EntityType type) const = 0;
1794 
1795  /**
1796  * \brief get begin iterator of filed dofs of given name end ent
1797  * type(instead you can use
1798  * _IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD,NAME,TYPE,IT)
1799  *
1800  * \ingroup mofem_field
1801  *
1802  * for(_IT_GET_DOFS_FIELD_BY_NAME_AND_TYPE_FOR_LOOP_(MFIELD,NAME,TYPE,IT)) {
1803  * ...
1804  * }
1805  *
1806  * \param field_name
1807  */
1808  virtual DofEntityByNameAndType::iterator
1809  get_dofs_by_name_and_type_end(const std::string &field_name,
1810  const EntityType type) const = 0;
1811 
1812  /** \brief loop over all dofs from a moFEM field and particular field
1813  * \ingroup mofem_field
1814  */
1815 #define _IT_GET_DOFS_FIELD_BY_NAME_AND_TYPE_FOR_LOOP_(MFIELD, NAME, TYPE, IT) \
1816  DofEntityByNameAndType::iterator IT = \
1817  (MFIELD).get_dofs_by_name_and_type_begin(NAME, TYPE); \
1818  IT != (MFIELD).get_dofs_by_name_and_type_end(NAME, TYPE); \
1819  IT++
1820 
1821  /**
1822  * \brief get begin iterator of finite elements of given name (instead you
1823  * can use _IT_GET_FES_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)
1824  *
1825  * \ingroup mofem_access
1826  *
1827  * for(_IT_GET_FES_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)) {
1828  * ...
1829  * }
1830  *
1831  * \param fe_name
1832  */
1833  virtual EntFiniteElementByName::iterator
1834  get_fe_by_name_begin(const std::string &fe_name) const = 0;
1835 
1836  /**
1837  * \brief get end iterator of finite elements of given name (instead you can
1838  * use _IT_GET_FES_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)
1839  *
1840  * \ingroup mofem_access
1841  *
1842  * for(_IT_GET_FES_BY_NAME_FOR_LOOP_(MFIELD,NAME,IT)) {
1843  * ...
1844  * }
1845  *
1846  * \param fe_name
1847  */
1848  virtual EntFiniteElementByName::iterator
1849  get_fe_by_name_end(const std::string &fe_name) const = 0;
1850 
1851  /** \brief loop over all finite elements from a moFEM field and FE
1852  * \ingroup mofem_access
1853  */
1854 #define _IT_GET_FES_BY_NAME_FOR_LOOP_(MFIELD, NAME, IT) \
1855  EntFiniteElementByName::iterator IT = (MFIELD).get_fe_by_name_begin(NAME); \
1856  IT != (MFIELD).get_fe_by_name_end(NAME); \
1857  IT++
1858 };
1859 } // namespace MoFEM
1860 
1861 #include <DeprecatedCoreInterface.hpp>
1862 
1863 namespace MoFEM {
1864 
1865 #if __cplusplus <= 199711L
1867 #else
1869 #endif
1870 }
1871 
1872 #endif // __INTERFACE_HPP__
1873 
1874 /**
1875  * \defgroup mofem_field Fields
1876  * \brief Data structure for adding and managing fields
1877  *
1878  * \ingroup mofem
1879  ******************************************************************************/
1880 
1881 /**
1882  * \defgroup mofem_ref_ents Get entities and adjacencies
1883  * \brief Get adjacencies/entities for given BitRefLevel (mesh refinement)
1884  *
1885  * \ingroup mofem
1886  ******************************************************************************/
1887 
1888 /**
1889  * \defgroup mofem_fe Finite elements
1890  * \brief Adding and managing finite elements
1891  *
1892  * \ingroup mofem
1893  ******************************************************************************/
1894 
1895 /**
1896  * \defgroup mofem_problems Problems
1897  * \brief Adding and managing problems
1898  *
1899  * \ingroup mofem
1900  ******************************************************************************/
1901 
1902 /**
1903  * \defgroup mofem_loops Loops
1904  * \brief Manages complexities for integrating over finite elements and dofs.
1905  *
1906  * \ingroup mofem
1907  ******************************************************************************/
1908 
1909 /**
1910  * \defgroup mofem_access Pointers to multi-indices
1911  * \brief Get direct access to multi-indices in database
1912  *
1913  * \ingroup mofem
1914  ******************************************************************************/
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.
virtual MoFEMErrorCode loop_finite_elements(const std::string &problem_name, const std::string &fe_name, FEMethod &method, boost::shared_ptr< NumeredEntFiniteElement_multiIndex > fe_ptr=nullptr, MoFEMTypes bh=MF_EXIST, int verb=DEFAULT_VERBOSITY)=0
Make a loop over finite elements.
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,...
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:185
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 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:142
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:167
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:182
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...