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