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