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