v0.16.0
Loading...
Searching...
No Matches
PipelineManager.hpp
Go to the documentation of this file.
1/** \file PipelineManager.hpp
2 * \brief Header file for basic interface
3 * \ingroup mofem_basic_interface
4 *
5 * Make basic interface, to speed up problem setup and analysis.
6 * See discussion here
7 * <a
8 * href=https://groups.google.com/d/msg/mofem-group/Vkc00aia4dU/o9RF3ZmPAAAJ>link
9 * to google groups</a>
10 *
11 */
12
13#ifndef __BASIC_HPP__
14#define __BASIC_HPP__
15
16#include "UnknownInterface.hpp"
17
18namespace MoFEM {
19
20/**
21 * \brief PipelineManager interface
22 * \ingroup mofem_basic_interface
23 */
25
26 /**
27 * @brief Query interface for type-safe casting
28 *
29 * @param type_index Type index of the requested interface
30 * @param iface Pointer to interface pointer to be set
31 * @return MoFEMErrorCode Error code (0 on success)
32 */
33 MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
34 UnknownInterface **iface) const;
35
36 /**
37 * @brief Construct PipelineManager
38 *
39 * @param core Reference to MoFEM core instance
40 */
41 PipelineManager(const MoFEM::Core &core);
42
45
49
50 /**
51 * @brief Template struct for dimension-specific finite element types
52 *
53 * @tparam DIM Problem dimension (1, 2, or 3)
54 */
55 template <int DIM> struct ElementsAndOpsByDim;
56
57 /**
58 * @brief Get domain left-hand side finite element
59 *
60 * @return boost::shared_ptr<FEMethod>& Reference to domain LHS finite element for matrix assembly
61 */
62 inline boost::shared_ptr<FEMethod> &getDomainLhsFE();
63
64 /**
65 * @brief Get domain right-hand side finite element
66 *
67 * @return boost::shared_ptr<FEMethod>& Reference to domain RHS finite element for vector assembly
68 */
69 inline boost::shared_ptr<FEMethod> &getDomainRhsFE();
70
71 /**
72 * @brief Get boundary left-hand side finite element
73 *
74 * @return boost::shared_ptr<FEMethod>& Reference to boundary LHS finite element for matrix assembly
75 */
76 inline boost::shared_ptr<FEMethod> &getBoundaryLhsFE();
77
78 /**
79 * @brief Get boundary right-hand side finite element
80 *
81 * @return boost::shared_ptr<FEMethod>& Reference to boundary RHS finite element for vector assembly
82 */
83 inline boost::shared_ptr<FEMethod> &getBoundaryRhsFE();
84
85 /**
86 * @brief Get domain postprocessing finite element
87 *
88 * @return boost::shared_ptr<FEMethod>& Reference to domain postprocessing finite element
89 */
90 inline boost::shared_ptr<FEMethod> &getDomainPostProcFE();
91
92 /**
93 * @brief Get boundary postprocessing finite element
94 *
95 * @return boost::shared_ptr<FEMethod>& Reference to boundary postprocessing finite element
96 */
97 inline boost::shared_ptr<FEMethod> &getBoundaryPostProcFE();
98
99 /**
100 * @brief Get domain evaluation finite element
101 *
102 * @return boost::shared_ptr<FEMethod>& Reference to domain evaluation finite element
103 */
104 inline boost::shared_ptr<FEMethod> &getEvaluationFE();
105
106 /**
107 * @brief Get skeleton left-hand side finite element
108 *
109 * @return boost::shared_ptr<FEMethod>& Reference to skeleton LHS finite element for matrix assembly
110 */
111 inline boost::shared_ptr<FEMethod> &getSkeletonLhsFE();
112
113 /**
114 * @brief Get skeleton right-hand side finite element
115 *
116 * @return boost::shared_ptr<FEMethod>& Reference to skeleton RHS finite element for vector assembly
117 */
118 inline boost::shared_ptr<FEMethod> &getSkeletonRhsFE();
119
120 /**
121 * @brief Get domain explicit right-hand side finite element
122 *
123 * @return boost::shared_ptr<FEMethod>& Reference to domain explicit RHS finite element for IMEX schemes
124 */
125 inline boost::shared_ptr<FEMethod> &getDomainExplicitRhsFE();
126
127 /**
128 * @brief Get boundary explicit right-hand side finite element
129 *
130 * @return boost::shared_ptr<FEMethod>& Reference to boundary explicit RHS finite element for IMEX schemes
131 */
132 inline boost::shared_ptr<FEMethod> &getBoundaryExplicitRhsFE();
133
134 /**
135 * @brief Get skeleton explicit right-hand side finite element
136 *
137 * @return boost::shared_ptr<FEMethod>& Reference to skeleton explicit RHS finite element for IMEX schemes
138 */
139 inline boost::shared_ptr<FEMethod> &getSkeletonExplicitRhsFE();
140
141 /**
142 * @brief Get meshset right-hand side finite element
143 *
144 * @return boost::shared_ptr<FEMethod>& Reference to meshset RHS finite element for vector assembly
145 */
146 inline boost::shared_ptr<FEMethod> &getMeshsetRhsFE();
147
148 /**
149 * @brief Get meshset left-hand side finite element
150 *
151 * @return boost::shared_ptr<FEMethod>& Reference to meshset LHS finite element for matrix assembly
152 */
153 inline boost::shared_ptr<FEMethod> &getMeshsetLhsFE();
154
155 /**
156 * @brief Get meshset explicit right-hand side finite element
157 *
158 * @return boost::shared_ptr<FEMethod>& Reference to meshset explicit RHS finite element for IMEX schemes
159 */
160 inline boost::shared_ptr<FEMethod> &getMeshsetExplicitRhsFE();
161
162 /**
163 * @brief Get typed domain left-hand side finite element
164 *
165 * @tparam T Target finite element type (default: ForcesAndSourcesCore)
166 * @tparam DIM Dimension (-1 for automatic detection from problem)
167 * @return auto Shared pointer to typed domain LHS finite element
168 */
169 template <typename T = ForcesAndSourcesCore, int DIM = -1>
170 inline auto getCastDomainLhsFE();
171
172 /**
173 * @brief Get typed domain right-hand side finite element
174 *
175 * @tparam T Target finite element type (default: ForcesAndSourcesCore)
176 * @tparam DIM Dimension (-1 for automatic detection from problem)
177 * @return auto Shared pointer to typed domain RHS finite element
178 */
179 template <typename T = ForcesAndSourcesCore, int DIM = -1>
180 inline auto getCastDomainRhsFE();
181
182 /**
183 * @brief Get typed boundary left-hand side finite element
184 *
185 * @tparam T Target finite element type (default: ForcesAndSourcesCore)
186 * @tparam DIM Dimension (-1 for automatic detection from problem)
187 * @return auto Shared pointer to typed boundary LHS finite element
188 */
189 template <typename T = ForcesAndSourcesCore, int DIM = -1>
190 inline auto getCastBoundaryLhsFE();
191
192 /**
193 * @brief Get typed boundary right-hand side finite element
194 *
195 * @tparam T Target finite element type (default: ForcesAndSourcesCore)
196 * @tparam DIM Dimension (-1 for automatic detection from problem)
197 * @return auto Shared pointer to typed boundary RHS finite element
198 */
199 template <typename T = ForcesAndSourcesCore, int DIM = -1>
200 inline auto getCastBoundaryRhsFE();
201
202 /**
203 * @brief Get typed domain postprocessing finite element
204 *
205 * @tparam T Target finite element type (default: ForcesAndSourcesCore)
206 * @tparam DIM Dimension (-1 for automatic detection from problem)
207 * @return auto Shared pointer to typed domain postprocessing finite element
208 */
209 template <typename T = ForcesAndSourcesCore, int DIM = -1>
210 inline auto getCastDomainPostProcFE();
211
212 /**
213 * @brief Get typed boundary postprocessing finite element
214 *
215 * @tparam T Target finite element type (default: ForcesAndSourcesCore)
216 * @tparam DIM Dimension (-1 for automatic detection from problem)
217 * @return auto Shared pointer to typed boundary postprocessing finite element
218 */
219 template <typename T = ForcesAndSourcesCore, int DIM = -1>
220 inline auto getCastBoundaryPostProcFE();
221
222 /**
223 * @brief Get typed domain evaluation finite element
224 *
225 * @tparam T Target finite element type (default: ForcesAndSourcesCore)
226 * @tparam DIM Dimension (-1 for automatic detection from problem)
227 * @return auto Shared pointer to typed domain evaluation finite element
228 */
229 template <typename T = ForcesAndSourcesCore, int DIM = -1>
230 inline auto getCastEvaluationFE();
231
232 /**
233 * @brief Get typed skeleton left-hand side finite element
234 *
235 * @tparam T Target finite element type (default: ForcesAndSourcesCore)
236 * @tparam DIM Dimension (-1 for automatic detection from problem)
237 * @return auto Shared pointer to typed skeleton LHS finite element
238 */
239 template <typename T = ForcesAndSourcesCore, int DIM = -1>
240 inline auto getCastSkeletonLhsFE();
241
242 /**
243 * @brief Get typed skeleton right-hand side finite element
244 *
245 * @tparam T Target finite element type (default: ForcesAndSourcesCore)
246 * @tparam DIM Dimension (-1 for automatic detection from problem)
247 * @return auto Shared pointer to typed skeleton RHS finite element
248 */
249 template <typename T = ForcesAndSourcesCore, int DIM = -1>
250 inline auto getCastSkeletonRhsFE();
251
252 /**
253 * @brief Get typed domain explicit right-hand side finite element
254 *
255 * @tparam T Target finite element type (default: ForcesAndSourcesCore)
256 * @tparam DIM Dimension (-1 for automatic detection from problem)
257 * @return auto Shared pointer to typed domain explicit RHS finite element
258 */
259 template <typename T = ForcesAndSourcesCore, int DIM = -1>
260 inline auto getCastDomainExplicitRhsFE();
261
262 /**
263 * @brief Get typed boundary explicit right-hand side finite element
264 *
265 * @tparam T Target finite element type (default: ForcesAndSourcesCore)
266 * @tparam DIM Dimension (-1 for automatic detection from problem)
267 * @return auto Shared pointer to typed boundary explicit RHS finite element
268 */
269 template <typename T = ForcesAndSourcesCore, int DIM = -1>
270 inline auto getCastBoundaryExplicitRhsFE();
271
272 /**
273 * @brief Get typed skeleton explicit right-hand side finite element
274 *
275 * @tparam T Target finite element type (default: ForcesAndSourcesCore)
276 * @tparam DIM Dimension (-1 for automatic detection from problem)
277 * @return auto Shared pointer to typed skeleton explicit RHS finite element
278 */
279 template <typename T = ForcesAndSourcesCore, int DIM = -1>
280 inline auto getCastSkeletonExplicitRhsFE();
281
282 /**
283 * @brief Get typed meshset right-hand side finite element
284 *
285 * @tparam T Target finite element type (default: ForcesAndSourcesCore)
286 * @return auto Shared pointer to typed meshset RHS finite element
287 */
288 template <typename T = ForcesAndSourcesCore>
289 inline auto getCastMeshsetRhsFE();
290
291 /**
292 * @brief Get typed meshset left-hand side finite element
293 *
294 * @tparam T Target finite element type (default: ForcesAndSourcesCore)
295 * @return auto Shared pointer to typed meshset LHS finite element
296 */
297 template <typename T = ForcesAndSourcesCore>
298 inline auto getCastMeshsetLhsFE();
299
300 /**
301 * @brief Get typed meshset explicit right-hand side finite element
302 *
303 * @tparam T Target finite element type (default: ForcesAndSourcesCore)
304 * @return auto Shared pointer to typed meshset explicit RHS finite element
305 */
306 template <typename T = ForcesAndSourcesCore>
307 inline auto getCastMeshsetExplicitRhsFE();
308
309 /**
310 * @brief Set integration rule for domain left-hand side finite element
311 *
312 * @tparam DIM Dimension (-1 for automatic detection from problem)
313 * @param rule Integration rule hook function
314 * @return MoFEMErrorCode Error code (0 on success)
315 */
316 template <int DIM = -1>
318
319 /**
320 * @brief Set integration rule for domain right-hand side finite element
321 *
322 * @tparam DIM Dimension (-1 for automatic detection from problem)
323 * @param rule Integration rule hook function
324 * @return MoFEMErrorCode Error code (0 on success)
325 */
326 template <int DIM = -1>
328
329 /**
330 * @brief Set integration rule for boundary left-hand side finite element
331 *
332 * @tparam DIM Dimension (-1 for automatic detection from problem)
333 * @param rule Integration rule hook function
334 * @return MoFEMErrorCode Error code (0 on success)
335 */
336 template <int DIM = -1>
338
339 /**
340 * @brief Set integration rule for boundary right-hand side finite element
341 *
342 * @tparam DIM Dimension (-1 for automatic detection from problem)
343 * @param rule Integration rule hook function
344 * @return MoFEMErrorCode Error code (0 on success)
345 */
346 template <int DIM = -1>
348
349 /**
350 * @brief Set integration rule for domain evaluation finite element
351 *
352 * @tparam DIM Dimension (-1 for automatic detection from problem)
353 * @param rule Integration rule hook function
354 * @return MoFEMErrorCode Error code (0 on success)
355 */
356 template <int DIM = -1>
358
359 /**
360 * @brief Set integration rule for skeleton left-hand side finite element
361 *
362 * @tparam DIM Dimension (-1 for automatic detection from problem)
363 * @param rule Integration rule hook function
364 * @return MoFEMErrorCode Error code (0 on success)
365 */
366 template <int DIM = -1>
368
369 /**
370 * @brief Set integration rule for skeleton right-hand side finite element
371 *
372 * @tparam DIM Dimension (-1 for automatic detection from problem)
373 * @param rule Integration rule hook function
374 * @return MoFEMErrorCode Error code (0 on success)
375 */
376 template <int DIM = -1>
378
379 /**
380 * @brief Set integration rule for domain explicit right-hand side finite element
381 *
382 * @tparam DIM Dimension (-1 for automatic detection from problem)
383 * @param rule Integration rule hook function
384 * @return MoFEMErrorCode Error code (0 on success)
385 */
386 template <int DIM = -1>
388
389 /**
390 * @brief Set integration rule for boundary explicit right-hand side finite element
391 *
392 * @tparam DIM Dimension (-1 for automatic detection from problem)
393 * @param rule Integration rule hook function
394 * @return MoFEMErrorCode Error code (0 on success)
395 */
396 template <int DIM = -1>
398
399 /**
400 * @brief Set integration rule for skeleton explicit right-hand side finite element
401 *
402 * @tparam DIM Dimension (-1 for automatic detection from problem)
403 * @param rule Integration rule hook function
404 * @return MoFEMErrorCode Error code (0 on success)
405 */
406 template <int DIM = -1>
408
409 /**
410 * @brief Get the Op Domain Lhs Pipeline object
411 * @ingroup mofem_basic_interface
412 *
413 * @tparam -1
414 * @return boost::ptr_deque<UserDataOperator>&
415 */
416 template <int DIM = -1>
417 inline boost::ptr_deque<UserDataOperator> &getOpDomainLhsPipeline();
418
419 /**
420 * @brief Get the Op Domain Rhs Pipeline object
421 * @ingroup mofem_basic_interface
422 *
423 * @tparam -1
424 * @return boost::ptr_deque<UserDataOperator>&
425 */
426 template <int DIM = -1>
427 inline boost::ptr_deque<UserDataOperator> &getOpDomainRhsPipeline();
428
429 /**
430 * @brief Get the Op Boundary Lhs Pipeline object
431 * @ingroup mofem_basic_interface
432 *
433 * @tparam -1
434 * @return boost::ptr_deque<UserDataOperator>&
435 */
436 template <int DIM = -1>
437 inline boost::ptr_deque<UserDataOperator> &getOpBoundaryLhsPipeline();
438
439 /**
440 * @brief Get the Op Boundary Rhs Pipeline object
441 * @ingroup mofem_basic_interface
442 *
443 * @tparam -1
444 * @return boost::ptr_deque<UserDataOperator>&
445 */
446 template <int DIM = -1>
447 inline boost::ptr_deque<UserDataOperator> &getOpBoundaryRhsPipeline();
448
449 /**
450 * @brief Get the Op Domain PostProc Pipeline object
451 * @ingroup mofem_basic_interface
452 *
453 * @tparam -1
454 * @return boost::ptr_deque<UserDataOperator>&
455 */
456 template <int DIM = -1>
457 inline boost::ptr_deque<UserDataOperator> &getOpDomainPostProcPipeline();
458
459 /**
460 * @brief Get the Op Boundary PostProc Pipeline object
461 * @ingroup mofem_basic_interface
462 *
463 * @tparam -1
464 * @return boost::ptr_deque<UserDataOperator>&
465 */
466 template <int DIM = -1>
467 inline boost::ptr_deque<UserDataOperator> &getOpBoundaryPostProcPipeline();
468
469 /**
470 * @brief Get the Op Domain Evaluation Pipeline object
471 * @ingroup mofem_basic_interface
472 *
473 * @tparam -1
474 * @return boost::ptr_deque<UserDataOperator>&
475 */
476 template <int DIM = -1>
477 inline boost::ptr_deque<UserDataOperator> &getOpEvaluationPipeline();
478
479 /**
480 * @brief Get the Op Skeleton Lhs Pipeline object
481 * @ingroup mofem_basic_interface
482 *
483 * @return boost::ptr_deque<UserDataOperator>&
484 */
485 template <int DIM = -1>
486 inline boost::ptr_deque<UserDataOperator> &getOpSkeletonLhsPipeline();
487
488 /**
489 * @brief Get the Op Skeleton Rhs Pipeline object
490 * @ingroup mofem_basic_interface
491 *
492 * @tparam -1
493 * @return boost::ptr_deque<UserDataOperator>&
494 */
495 template <int DIM = -1>
496 inline boost::ptr_deque<UserDataOperator> &getOpSkeletonRhsPipeline();
497
498 /**
499 * @brief Get the Op Domain Rhs Pipeline object for implicit-explicit G term
500 * @ingroup mofem_basic_interface
501 *
502 * @tparam -1
503 * @return boost::ptr_deque<UserDataOperator>&
504 */
505 template <int DIM = -1>
506 inline boost::ptr_deque<UserDataOperator> &getOpDomainExplicitRhsPipeline();
507
508 /**
509 * @brief Get the Op Boundary Rhs Pipeline object for implicit-explicit G term
510 * @ingroup mofem_basic_interface
511 *
512 * @tparam -1
513 * @return boost::ptr_deque<UserDataOperator>&
514 */
515 template <int DIM = -1>
516 inline boost::ptr_deque<UserDataOperator> &getOpBoundaryExplicitRhsPipeline();
517
518 /**
519 * @brief Get the Op Skeleton Rhs Pipeline object for implicit-explicit G term
520 * @ingroup mofem_basic_interface
521 *
522 * @tparam -1
523 * @return boost::ptr_deque<UserDataOperator>&
524 */
525 template <int DIM = -1>
526 inline boost::ptr_deque<UserDataOperator> &getOpSkeletonExplicitRhsPipeline();
527
528 /**
529 * @brief Get the Op Meshset Rhs Pipeline object
530 *
531 * @return boost::ptr_deque<UserDataOperator>&
532 */
533 boost::ptr_deque<UserDataOperator> &getOpMeshsetRhsPipeline();
534
535 /**
536 * @brief Get the Op Meshset Lhs Pipeline object
537 *
538 * @return boost::ptr_deque<UserDataOperator>&
539 */
540 boost::ptr_deque<UserDataOperator> &getOpMeshsetLhsPipeline();
541
542 /**
543 * @brief Get the Op Meshset Explicit Rhs Pipeline object
544 *
545 * @return boost::ptr_deque<UserDataOperator>&
546 */
547 boost::ptr_deque<UserDataOperator> &getOpMeshsetExplicitRhsPipeline();
548
549 /**
550 * @brief Iterate finite elements
551 * @ingroup mofem_basic_interface
552 *
553 * @param dm Optional DM object (default: nullptr)
554 * @return MoFEMErrorCode Error code (0 on success)
555 */
557
558 /**
559 * @brief Iterate postprocessing finite elements
560 * @ingroup mofem_basic_interface
561 *
562 * @param dm Optional DM object (default: nullptr)
563 * @return MoFEMErrorCode Error code (0 on success)
564 */
566
567 /**
568 * @brief Iterate domain postprocessing finite elements only
569 * @ingroup mofem_basic_interface
570 *
571 * @param dm Optional DM object (default: nullptr)
572 * @return MoFEMErrorCode Error code (0 on success)
573 */
575
576 /**
577 * @brief Iterate boundary postprocessing finite elements only
578 * @ingroup mofem_basic_interface
579 *
580 * @param dm Optional DM object (default: nullptr)
581 * @return MoFEMErrorCode Error code (0 on success)
582 */
584
585 /**
586 * @brief Iterate evaluation finite elements
587 * @ingroup mofem_basic_interface
588 *
589 * @param dm Optional DM object (default: nullptr)
590 * @return MoFEMErrorCode Error code (0 on success)
591 */
593
594 /**
595 * @brief Create KSP (linear) solver
596 * @ingroup mofem_basic_interface
597 *
598 * @param dm Optional DM object (default: nullptr)
599 * @return SmartPetscObj<KSP> Smart pointer to PETSc KSP linear solver
600 */
602
603 /**
604 * @brief Create SNES (nonlinear) solver
605 * @ingroup mofem_basic_interface
606 *
607 * @param dm Optional DM object (default: nullptr)
608 * @return SmartPetscObj<SNES> Smart pointer to PETSc SNES nonlinear solver
609 */
611
612 /**
613 * @brief Enumeration of time solver types
614 */
615 enum TSType {
616 EX, ///< Explicit time integration
617 IM, ///< Implicit time integration
618 IM2, ///< Second-order implicit time integration
619 IMEX ///< Implicit-explicit time integration
620 };
621
622 /**
623 * @brief Create TS (time) solver with specified type
624 *
625 * @param type Type of time solver (EX/IM/IM2/IMEX)
626 * @param dm Optional DM object (default: nullptr)
627 * @return SmartPetscObj<TS> Smart pointer to PETSc TS solver
628 */
630
631 /**
632 * @brief Create TS (time) explicit solver
633 * @ingroup mofem_basic_interface
634 *
635 * @param dm Optional DM object (default: nullptr)
636 * @return SmartPetscObj<TS> Smart pointer to PETSc TS explicit time solver
637 */
639
640 /**
641 * @brief Create TS (time) implicit solver
642 * @ingroup mofem_basic_interface
643 *
644 * @param dm Optional DM object (default: nullptr)
645 * @return SmartPetscObj<TS> Smart pointer to PETSc TS implicit time solver
646 */
648
649 /**
650 * @deprecated Use version with explicit TS solver type
651 */
653 return createTSIM(dm);
654 }
655
656 /**
657 * @brief Create TS (time) solver for second order equation in time
658 * @ingroup mofem_basic_interface
659 *
660 * @param dm Optional DM object (default: nullptr)
661 * @return SmartPetscObj<TS> Smart pointer to PETSc TS second-order time solver
662 */
664
665 /**
666 * @deprecated Change name. Use createTSIM2 instead.
667 */
668 inline DEPRECATED auto createTS2(SmartPetscObj<DM> dm = nullptr) {
669 return createTSIM2(dm);
670 }
671
672 /**
673 * @brief Create TS (time) implicit-explicit solver
674 * @ingroup mofem_basic_interface
675 *
676 * @param dm Optional DM object (default: nullptr)
677 * @return SmartPetscObj<TS> Smart pointer to PETSc TS implicit-explicit time solver
678 */
680
681private:
682 MoFEM::Core &cOre; ///< Reference to MoFEM core instance
683
684 boost::shared_ptr<FEMethod>
685 feDomainRhs; ///< Element to assemble RHS side by integrating domain
686 boost::shared_ptr<FEMethod>
687 feDomainLhs; ///< Element to assemble LHS side by integrating domain
688 boost::shared_ptr<FEMethod>
689 feBoundaryRhs; ///< Element to assemble RHS side by integrating boundary
690 boost::shared_ptr<FEMethod>
691 feDomainPostProc; ///< Element for postprocessing by integrating domain
692 boost::shared_ptr<FEMethod>
693 feBoundaryPostProc; ///< Element for postprocessing by integrating boundary
694 boost::shared_ptr<FEMethod>
695 feEvaluation; ///< Element for evaluation by integrating domain
696 boost::shared_ptr<FEMethod>
697 feBoundaryLhs; ///< Element to assemble LHS side by integrating boundary
698 boost::shared_ptr<FEMethod>
699 feSkeletonRhs; ///< Element to assemble RHS side by integrating skeleton
700 boost::shared_ptr<FEMethod>
701 feSkeletonLhs; ///< Element to assemble LHS side by integrating skeleton
702
703 boost::shared_ptr<FEMethod>
704 feDomainExplicitRhs; ///< Element to assemble explicit Rhs for IMEX solver
705 boost::shared_ptr<FEMethod>
706 feBoundaryExplicitRhs; ///< Element to assemble explicit Rhs for IMEX
707 ///< solver
708 boost::shared_ptr<FEMethod>
709 feSkeletonExplicitRhs; ///< Element to assemble explicit Rhs for IMEX
710 ///< solver
711
712 boost::shared_ptr<FEMethod> feMeshsetRhs; ///< Element to assemble RHS side by
713 ///< integrating meshset
714 boost::shared_ptr<FEMethod> feMeshsetLhs; ///< Element to assemble LHS side by
715 ///< integrating meshset
716 boost::shared_ptr<FEMethod> feMeshsetExplicitRhs; ///< Element to assemble
717 ///< explicit RHS side by
718 ///< integrating meshset
719
720 /**
721 * @brief Create domain finite element pipeline based on dimension
722 *
723 * @tparam DIM Problem dimension (1, 2, 3, or -1 for automatic detection)
724 * @param fe Reference to finite element method shared pointer
725 * @return boost::shared_ptr<FEMethod>& Reference to created finite element
726 */
727 template <int DIM>
728 inline boost::shared_ptr<FEMethod> &
729 createDomainFEPipeline(boost::shared_ptr<FEMethod> &fe);
730
731 /**
732 * @brief Create boundary finite element pipeline based on dimension
733 *
734 * @tparam DIM Problem dimension (1, 2, 3, or -1 for automatic detection)
735 * @param fe Reference to finite element method shared pointer
736 * @return boost::shared_ptr<FEMethod>& Reference to created finite element
737 */
738 template <int DIM>
739 inline boost::shared_ptr<FEMethod> &
740 createBoundaryFEPipeline(boost::shared_ptr<FEMethod> &fe);
741
742 /**
743 * @brief Create meshset finite element pipeline
744 *
745 * @param fe Reference to finite element method shared pointer
746 * @return boost::shared_ptr<FEMethod>& Reference to created finite element
747 */
748 inline boost::shared_ptr<FEMethod> &
749 createMeshsetFEPipeline(boost::shared_ptr<FEMethod> &fe);
750
751private:
752 /**
753 * @brief Forward declaration for meshset finite element implementation
754 */
755 struct MeshsetFE;
756};
757
758template <int DIM>
759boost::shared_ptr<FEMethod> &
760PipelineManager::createDomainFEPipeline(boost::shared_ptr<FEMethod> &fe) {
761 static_assert(DIM == 1 || DIM == 2 || DIM == 3, "not implemented");
762 fe = boost::make_shared<FEMethod>();
763 return fe;
764}
765
766template <>
767inline boost::shared_ptr<FEMethod> &
768PipelineManager::createDomainFEPipeline<3>(boost::shared_ptr<FEMethod> &fe) {
769 if (!fe)
770 fe = boost::make_shared<VolEle>(cOre);
771 return fe;
772}
773
774template <>
775inline boost::shared_ptr<FEMethod> &
776PipelineManager::createDomainFEPipeline<2>(boost::shared_ptr<FEMethod> &fe) {
777 if (!fe)
778 fe = boost::make_shared<FaceEle>(cOre);
779 return fe;
780}
781
782template <>
783inline boost::shared_ptr<FEMethod> &
784PipelineManager::createDomainFEPipeline<1>(boost::shared_ptr<FEMethod> &fe) {
785 if (!fe)
786 fe = boost::make_shared<EdgeEle>(cOre);
787 return fe;
788}
789
790template <>
791inline boost::shared_ptr<FEMethod> &
792PipelineManager::createDomainFEPipeline<-1>(boost::shared_ptr<FEMethod> &fe) {
793 switch (cOre.getInterface<Simple>()->getDim()) {
794 case 1:
795 return createDomainFEPipeline<1>(fe);
796 case 2:
797 return createDomainFEPipeline<2>(fe);
798 case 3:
799 return createDomainFEPipeline<3>(fe);
800 default:
801 THROW_MESSAGE("Not implemented");
802 }
803}
804
805template <int DIM>
806boost::shared_ptr<FEMethod> &
807PipelineManager::createBoundaryFEPipeline(boost::shared_ptr<FEMethod> &fe) {
808 static_assert(DIM == 1 || DIM == 2 || DIM == 3, "not implemented");
809 fe = boost::make_shared<FEMethod>();
810 return fe;
811}
812
813template <>
814inline boost::shared_ptr<FEMethod> &
815PipelineManager::createBoundaryFEPipeline<3>(boost::shared_ptr<FEMethod> &fe) {
816 if (!fe)
817 fe = boost::make_shared<FaceElementForcesAndSourcesCore>(cOre);
818 return fe;
819}
820
821template <>
822inline boost::shared_ptr<FEMethod> &
823PipelineManager::createBoundaryFEPipeline<2>(boost::shared_ptr<FEMethod> &fe) {
824 if (!fe)
825 fe = boost::make_shared<EdgeEle>(cOre);
826 return fe;
827}
828
829template <>
830inline boost::shared_ptr<FEMethod> &
831PipelineManager::createBoundaryFEPipeline<1>(boost::shared_ptr<FEMethod> &fe) {
832 if (!fe)
833 fe = boost::make_shared<VertexElementForcesAndSourcesCore>(cOre);
834 return fe;
835}
836
837boost::shared_ptr<FEMethod> &PipelineManager::getDomainLhsFE() {
838 return feDomainLhs;
839}
840
841boost::shared_ptr<FEMethod> &PipelineManager::getDomainRhsFE() {
842 return feDomainRhs;
843}
844
845boost::shared_ptr<FEMethod> &PipelineManager::getBoundaryLhsFE() {
846 return feBoundaryLhs;
847}
848
849boost::shared_ptr<FEMethod> &PipelineManager::getBoundaryRhsFE() {
850 return feBoundaryRhs;
851}
852
853boost::shared_ptr<FEMethod> &PipelineManager::getDomainPostProcFE() {
854 return feDomainPostProc;
855}
856
857boost::shared_ptr<FEMethod> &PipelineManager::getBoundaryPostProcFE() {
858 return feBoundaryPostProc;
859}
860
861boost::shared_ptr<FEMethod> &PipelineManager::getEvaluationFE() {
862 return feEvaluation;
863}
864
865boost::shared_ptr<FEMethod> &PipelineManager::getSkeletonLhsFE() {
866 return feSkeletonLhs;
867}
868
869boost::shared_ptr<FEMethod> &PipelineManager::getSkeletonRhsFE() {
870 return feSkeletonRhs;
871}
872
873boost::shared_ptr<FEMethod> &PipelineManager::getDomainExplicitRhsFE() {
874 return feDomainExplicitRhs;
875}
876
877boost::shared_ptr<FEMethod> &PipelineManager::getBoundaryExplicitRhsFE() {
879}
880
881boost::shared_ptr<FEMethod> &PipelineManager::getSkeletonExplicitRhsFE() {
883}
884
885boost::shared_ptr<FEMethod> &PipelineManager::getMeshsetRhsFE() {
886 return feMeshsetRhs;
887}
888
889boost::shared_ptr<FEMethod> &PipelineManager::getMeshsetLhsFE() {
890 return feMeshsetLhs;
891}
892
893boost::shared_ptr<FEMethod> &PipelineManager::getMeshsetExplicitRhsFE() {
895}
896
897template <>
898inline boost::shared_ptr<FEMethod> &
899PipelineManager::createBoundaryFEPipeline<-1>(boost::shared_ptr<FEMethod> &fe) {
900 switch (cOre.getInterface<Simple>()->getDim()) {
901 case 1:
902 return createBoundaryFEPipeline<1>(fe);
903 case 2:
904 return createBoundaryFEPipeline<2>(fe);
905 case 3:
906 return createBoundaryFEPipeline<3>(fe);
907 default:
908 THROW_MESSAGE("Not implemented");
909 }
910}
911
912template <typename T, int DIM> auto PipelineManager::getCastDomainLhsFE() {
913 return boost::dynamic_pointer_cast<T>(
914 createDomainFEPipeline<DIM>(feDomainLhs));
915}
916
917template <typename T, int DIM> auto PipelineManager::getCastDomainRhsFE() {
918 return boost::dynamic_pointer_cast<T>(
919 createDomainFEPipeline<DIM>(feDomainRhs));
920}
921
922template <typename T, int DIM> auto PipelineManager::getCastBoundaryLhsFE() {
923 return boost::dynamic_pointer_cast<T>(
924 createBoundaryFEPipeline<DIM>(feBoundaryLhs));
925}
926
927template <typename T, int DIM>
929 return boost::dynamic_pointer_cast<T>(
930 createBoundaryFEPipeline<DIM>(feBoundaryRhs));
931}
932
933template <typename T, int DIM> auto PipelineManager::getCastDomainPostProcFE() {
934 return boost::dynamic_pointer_cast<T>(
935 createDomainFEPipeline<DIM>(feDomainPostProc));
936}
937
938template <typename T, int DIM>
940 return boost::dynamic_pointer_cast<T>(
941 createBoundaryFEPipeline<DIM>(feBoundaryPostProc));
942}
943
944template <typename T, int DIM> auto PipelineManager::getCastEvaluationFE() {
945 return boost::dynamic_pointer_cast<T>(
946 createDomainFEPipeline<DIM>(feEvaluation));
947}
948
949template <typename T, int DIM>
951 return boost::dynamic_pointer_cast<T>(
952 createBoundaryFEPipeline<DIM>(feSkeletonLhs));
953}
954
955template <typename T, int DIM> auto PipelineManager::getCastSkeletonRhsFE() {
956 return boost::dynamic_pointer_cast<T>(
957 createBoundaryFEPipeline<DIM>(feSkeletonRhs));
958}
959
960template <typename T, int DIM>
962 return boost::dynamic_pointer_cast<T>(
963 createDomainFEPipeline<DIM>(feDomainExplicitRhs));
964}
965
966template <typename T, int DIM>
968 return boost::dynamic_pointer_cast<T>(
969 createBoundaryFEPipeline<DIM>(feBoundaryExplicitRhs));
970}
971
972template <typename T, int DIM>
974 return boost::dynamic_pointer_cast<T>(
975 createBoundaryFEPipeline<DIM>(feSkeletonExplicitRhs));
976}
977
978template <typename T> auto PipelineManager::getCastMeshsetRhsFE() {
979 return boost::dynamic_pointer_cast<T>(createMeshsetFEPipeline(feMeshsetRhs));
980}
981
982template <typename T> auto PipelineManager::getCastMeshsetLhsFE() {
983 return boost::dynamic_pointer_cast<T>(createMeshsetFEPipeline(feMeshsetLhs));
984}
985
987 return boost::dynamic_pointer_cast<T>(
989}
990
991template <int DIM>
995 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
996 createDomainFEPipeline<DIM>(feDomainLhs))
997 ->getRuleHook = rule;
999}
1000
1001template <>
1005 switch (cOre.getInterface<Simple>()->getDim()) {
1006 case 1:
1007 MoFEMFunctionReturnHot(setDomainLhsIntegrationRule<1>(rule));
1008 case 2:
1009 MoFEMFunctionReturnHot(setDomainLhsIntegrationRule<2>(rule));
1010 case 3:
1011 MoFEMFunctionReturnHot(setDomainLhsIntegrationRule<3>(rule));
1012 default:
1013 THROW_MESSAGE("Not implemented");
1014 }
1016}
1017
1018template <int DIM>
1022 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
1023 createDomainFEPipeline<DIM>(feDomainRhs))
1024 ->getRuleHook = rule;
1026}
1027
1028template <>
1032 switch (cOre.getInterface<Simple>()->getDim()) {
1033 case 1:
1034 MoFEMFunctionReturnHot(setDomainRhsIntegrationRule<1>(rule));
1035 case 2:
1036 MoFEMFunctionReturnHot(setDomainRhsIntegrationRule<2>(rule));
1037 case 3:
1038 MoFEMFunctionReturnHot(setDomainRhsIntegrationRule<3>(rule));
1039 default:
1040 THROW_MESSAGE("Not implemented");
1041 }
1043}
1044
1045template <int DIM>
1049 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
1050 createBoundaryFEPipeline<DIM>(feBoundaryLhs))
1051 ->getRuleHook = rule;
1053}
1054
1055template <>
1059 switch (cOre.getInterface<Simple>()->getDim()) {
1060 case 1:
1061 MoFEMFunctionReturnHot(setBoundaryLhsIntegrationRule<1>(rule));
1062 case 2:
1063 MoFEMFunctionReturnHot(setBoundaryLhsIntegrationRule<2>(rule));
1064 case 3:
1065 MoFEMFunctionReturnHot(setBoundaryLhsIntegrationRule<3>(rule));
1066 default:
1067 THROW_MESSAGE("Not implemented");
1068 }
1070}
1071
1072template <int DIM>
1076 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
1077 createBoundaryFEPipeline<DIM>(feBoundaryRhs))
1078 ->getRuleHook = rule;
1080}
1081
1082template <>
1086 switch (cOre.getInterface<Simple>()->getDim()) {
1087 case 1:
1088 MoFEMFunctionReturnHot(setBoundaryRhsIntegrationRule<1>(rule));
1089 case 2:
1090 MoFEMFunctionReturnHot(setBoundaryRhsIntegrationRule<2>(rule));
1091 case 3:
1092 MoFEMFunctionReturnHot(setBoundaryRhsIntegrationRule<3>(rule));
1093 default:
1094 THROW_MESSAGE("Not implemented");
1095 }
1097}
1098
1099template <int DIM>
1103 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
1104 createDomainFEPipeline<DIM>(feEvaluation))
1105 ->getRuleHook = rule;
1107}
1108
1109template <>
1113 switch (cOre.getInterface<Simple>()->getDim()) {
1114 case 1:
1115 MoFEMFunctionReturnHot(setEvaluationIntegrationRule<1>(rule));
1116 case 2:
1117 MoFEMFunctionReturnHot(setEvaluationIntegrationRule<2>(rule));
1118 case 3:
1119 MoFEMFunctionReturnHot(setEvaluationIntegrationRule<3>(rule));
1120 default:
1121 THROW_MESSAGE("Not implemented");
1122 }
1124}
1125
1126template <int DIM>
1130 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
1131 createBoundaryFEPipeline<DIM>(feSkeletonLhs))
1132 ->getRuleHook = rule;
1134}
1135
1136template <>
1140 switch (cOre.getInterface<Simple>()->getDim()) {
1141 case 1:
1142 MoFEMFunctionReturnHot(setSkeletonLhsIntegrationRule<1>(rule));
1143 case 2:
1144 MoFEMFunctionReturnHot(setSkeletonLhsIntegrationRule<2>(rule));
1145 case 3:
1146 MoFEMFunctionReturnHot(setSkeletonLhsIntegrationRule<3>(rule));
1147 default:
1148 THROW_MESSAGE("Not implemented");
1149 }
1151}
1152
1153template <int DIM>
1157 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
1158 createBoundaryFEPipeline<DIM>(feSkeletonRhs))
1159 ->getRuleHook = rule;
1161}
1162
1163template <>
1167 switch (cOre.getInterface<Simple>()->getDim()) {
1168 case 1:
1169 MoFEMFunctionReturnHot(setSkeletonRhsIntegrationRule<1>(rule));
1170 case 2:
1171 MoFEMFunctionReturnHot(setSkeletonRhsIntegrationRule<2>(rule));
1172 case 3:
1173 MoFEMFunctionReturnHot(setSkeletonRhsIntegrationRule<3>(rule));
1174 default:
1175 THROW_MESSAGE("Not implemented");
1176 }
1178}
1179
1180template <int DIM>
1184 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
1185 createDomainFEPipeline<DIM>(feDomainExplicitRhs))
1186 ->getRuleHook = rule;
1188}
1189
1190template <>
1194 switch (cOre.getInterface<Simple>()->getDim()) {
1195 case 1:
1196 MoFEMFunctionReturnHot(setDomainExplicitRhsIntegrationRule<1>(rule));
1197 case 2:
1198 MoFEMFunctionReturnHot(setDomainExplicitRhsIntegrationRule<2>(rule));
1199 case 3:
1200 MoFEMFunctionReturnHot(setDomainExplicitRhsIntegrationRule<3>(rule));
1201 default:
1202 THROW_MESSAGE("Not implemented");
1203 }
1205}
1206
1207template <int DIM>
1211 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
1212 createBoundaryFEPipeline<DIM>(feBoundaryExplicitRhs))
1213 ->getRuleHook = rule;
1215}
1216
1217template <>
1222 switch (cOre.getInterface<Simple>()->getDim()) {
1223 case 1:
1224 MoFEMFunctionReturnHot(setBoundaryExplicitRhsIntegrationRule<1>(rule));
1225 case 2:
1226 MoFEMFunctionReturnHot(setBoundaryExplicitRhsIntegrationRule<2>(rule));
1227 case 3:
1228 MoFEMFunctionReturnHot(setBoundaryExplicitRhsIntegrationRule<3>(rule));
1229 default:
1230 THROW_MESSAGE("Not implemented");
1231 }
1233}
1234
1235template <int DIM>
1239 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
1240 createBoundaryFEPipeline<DIM>(feSkeletonExplicitRhs))
1241 ->getRuleHook = rule;
1243}
1244
1245template <>
1250 switch (cOre.getInterface<Simple>()->getDim()) {
1251 case 1:
1252 MoFEMFunctionReturnHot(setSkeletonExplicitRhsIntegrationRule<1>(rule));
1253 case 2:
1254 MoFEMFunctionReturnHot(setSkeletonExplicitRhsIntegrationRule<2>(rule));
1255 case 3:
1256 MoFEMFunctionReturnHot(setSkeletonExplicitRhsIntegrationRule<3>(rule));
1257 default:
1258 THROW_MESSAGE("Not implemented");
1259 }
1261}
1262
1263template <int DIM>
1264boost::ptr_deque<PipelineManager::UserDataOperator> &
1266 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
1267 createDomainFEPipeline<DIM>(feDomainLhs))
1268 ->getOpPtrVector();
1269}
1270
1271template <>
1272inline boost::ptr_deque<PipelineManager::UserDataOperator> &
1274 switch (cOre.getInterface<Simple>()->getDim()) {
1275 case 1:
1276 return getOpDomainLhsPipeline<1>();
1277 case 2:
1278 return getOpDomainLhsPipeline<2>();
1279 case 3:
1280 break;
1281 default:
1282 THROW_MESSAGE("Not implemented");
1283 }
1284 return getOpDomainLhsPipeline<3>();
1285}
1286
1287template <int DIM>
1288boost::ptr_deque<PipelineManager::UserDataOperator> &
1290 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
1291 createDomainFEPipeline<DIM>(feDomainRhs))
1292 ->getOpPtrVector();
1293}
1294
1295template <>
1296inline boost::ptr_deque<PipelineManager::UserDataOperator> &
1298 switch (cOre.getInterface<Simple>()->getDim()) {
1299 case 1:
1300 return getOpDomainRhsPipeline<1>();
1301 case 2:
1302 return getOpDomainRhsPipeline<2>();
1303 case 3:
1304 break;
1305 default:
1306 THROW_MESSAGE("Not implemented");
1307 }
1308 return getOpDomainRhsPipeline<3>();
1309}
1310
1311template <int DIM>
1312boost::ptr_deque<PipelineManager::UserDataOperator> &
1314 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
1315 createBoundaryFEPipeline<DIM>(feBoundaryLhs))
1316 ->getOpPtrVector();
1317}
1318
1319template <>
1320inline boost::ptr_deque<PipelineManager::UserDataOperator> &
1322 switch (cOre.getInterface<Simple>()->getDim()) {
1323 case 1:
1324 return getOpBoundaryLhsPipeline<1>();
1325 case 2:
1326 return getOpBoundaryLhsPipeline<2>();
1327 case 3:
1328 break;
1329 default:
1330 THROW_MESSAGE("Not implemented");
1331 }
1332 return getOpBoundaryLhsPipeline<3>();
1333}
1334
1335template <int DIM>
1336boost::ptr_deque<PipelineManager::UserDataOperator> &
1338 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
1339 createBoundaryFEPipeline<DIM>(feBoundaryRhs))
1340 ->getOpPtrVector();
1341}
1342
1343template <>
1344inline boost::ptr_deque<PipelineManager::UserDataOperator> &
1346 switch (cOre.getInterface<Simple>()->getDim()) {
1347 case 1:
1348 return getOpBoundaryRhsPipeline<1>();
1349 case 2:
1350 return getOpBoundaryRhsPipeline<2>();
1351 case 3:
1352 break;
1353 default:
1354 THROW_MESSAGE("Not implemented");
1355 }
1356 return getOpBoundaryRhsPipeline<3>();
1357}
1358
1359template <int DIM>
1360boost::ptr_deque<PipelineManager::UserDataOperator> &
1362 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
1363 createDomainFEPipeline<DIM>(feDomainPostProc))
1364 ->getOpPtrVector();
1365}
1366
1367template <>
1368inline boost::ptr_deque<PipelineManager::UserDataOperator> &
1370 switch (cOre.getInterface<Simple>()->getDim()) {
1371 case 1:
1372 return getOpDomainPostProcPipeline<1>();
1373 case 2:
1374 return getOpDomainPostProcPipeline<2>();
1375 case 3:
1376 break;
1377 default:
1378 THROW_MESSAGE("Not implemented");
1379 }
1380 return getOpDomainPostProcPipeline<3>();
1381}
1382
1383template <int DIM>
1384boost::ptr_deque<PipelineManager::UserDataOperator> &
1386 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
1387 createBoundaryFEPipeline<DIM>(feBoundaryPostProc))
1388 ->getOpPtrVector();
1389}
1390
1391template <>
1392inline boost::ptr_deque<PipelineManager::UserDataOperator> &
1394 switch (cOre.getInterface<Simple>()->getDim()) {
1395 case 1:
1396 return getOpBoundaryPostProcPipeline<1>();
1397 case 2:
1398 return getOpBoundaryPostProcPipeline<2>();
1399 case 3:
1400 break;
1401 default:
1402 THROW_MESSAGE("Not implemented");
1403 }
1404 return getOpBoundaryPostProcPipeline<3>();
1405}
1406
1407template <int DIM>
1408boost::ptr_deque<PipelineManager::UserDataOperator> &
1410 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
1411 createDomainFEPipeline<DIM>(feEvaluation))
1412 ->getOpPtrVector();
1413}
1414
1415template <>
1416inline boost::ptr_deque<PipelineManager::UserDataOperator> &
1418 switch (cOre.getInterface<Simple>()->getDim()) {
1419 case 1:
1420 return getOpEvaluationPipeline<1>();
1421 case 2:
1422 return getOpEvaluationPipeline<2>();
1423 case 3:
1424 break;
1425 default:
1426 THROW_MESSAGE("Not implemented");
1427 }
1428 return getOpEvaluationPipeline<3>();
1429}
1430
1431template <int DIM>
1432boost::ptr_deque<PipelineManager::UserDataOperator> &
1434 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
1435 createBoundaryFEPipeline<DIM>(feSkeletonLhs))
1436 ->getOpPtrVector();
1437}
1438
1439template <>
1440inline boost::ptr_deque<PipelineManager::UserDataOperator> &
1442 switch (cOre.getInterface<Simple>()->getDim()) {
1443 case 1:
1444 return getOpSkeletonLhsPipeline<1>();
1445 case 2:
1446 return getOpSkeletonLhsPipeline<2>();
1447 case 3:
1448 break;
1449 default:
1450 THROW_MESSAGE("Not implemented");
1451 }
1452 return getOpSkeletonLhsPipeline<3>();
1453}
1454
1455template <int DIM>
1456boost::ptr_deque<PipelineManager::UserDataOperator> &
1458 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
1459 createBoundaryFEPipeline<DIM>(feSkeletonRhs))
1460 ->getOpPtrVector();
1461}
1462
1463template <>
1464inline boost::ptr_deque<PipelineManager::UserDataOperator> &
1466 switch (cOre.getInterface<Simple>()->getDim()) {
1467 case 1:
1468 return getOpSkeletonRhsPipeline<1>();
1469 case 2:
1470 return getOpSkeletonRhsPipeline<2>();
1471 case 3:
1472 break;
1473 default:
1474 THROW_MESSAGE("Not implemented");
1475 }
1476 return getOpSkeletonRhsPipeline<3>();
1477}
1478
1479template <int DIM>
1480boost::ptr_deque<PipelineManager::UserDataOperator> &
1482 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
1483 createDomainFEPipeline<DIM>(feDomainExplicitRhs))
1484 ->getOpPtrVector();
1485}
1486
1487template <>
1488inline boost::ptr_deque<PipelineManager::UserDataOperator> &
1490 switch (cOre.getInterface<Simple>()->getDim()) {
1491 case 1:
1492 return getOpDomainExplicitRhsPipeline<1>();
1493 case 2:
1494 return getOpDomainExplicitRhsPipeline<2>();
1495 case 3:
1496 break;
1497 default:
1498 THROW_MESSAGE("Not implemented");
1499 }
1500 return getOpDomainExplicitRhsPipeline<3>();
1501}
1502
1503template <int DIM>
1504boost::ptr_deque<PipelineManager::UserDataOperator> &
1506 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
1507 createBoundaryFEPipeline<DIM>(feBoundaryExplicitRhs))
1508 ->getOpPtrVector();
1509}
1510
1511template <>
1512inline boost::ptr_deque<PipelineManager::UserDataOperator> &
1514 switch (cOre.getInterface<Simple>()->getDim()) {
1515 case 1:
1516 return getOpBoundaryExplicitRhsPipeline<1>();
1517 case 2:
1518 return getOpBoundaryExplicitRhsPipeline<2>();
1519 case 3:
1520 break;
1521 default:
1522 THROW_MESSAGE("Not implemented");
1523 }
1524 return getOpBoundaryExplicitRhsPipeline<3>();
1525}
1526
1527template <int DIM>
1528boost::ptr_deque<PipelineManager::UserDataOperator> &
1530 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
1531 createBoundaryFEPipeline<DIM>(feSkeletonExplicitRhs))
1532 ->getOpPtrVector();
1533}
1534
1535template <>
1536inline boost::ptr_deque<PipelineManager::UserDataOperator> &
1538 switch (cOre.getInterface<Simple>()->getDim()) {
1539 case 1:
1540 return getOpSkeletonExplicitRhsPipeline<1>();
1541 case 2:
1542 return getOpSkeletonExplicitRhsPipeline<2>();
1543 case 3:
1544 break;
1545 default:
1546 THROW_MESSAGE("Not implemented");
1547 }
1548 return getOpSkeletonExplicitRhsPipeline<3>();
1549}
1550
1551/**
1552 * @brief Specialization for 2D problems
1553 */
1555 using DomainEle = PipelineManager::FaceEle; ///< 2D domain elements (faces)
1556 using BoundaryEle = PipelineManager::EdgeEle; ///< 2D boundary elements (edges)
1558 using DomainParentEle = FaceElementForcesAndSourcesCoreOnChildParent; ///< Domain parent-child elements
1559 using BoundaryParentEle = EdgeElementForcesAndSourcesCoreOnChildParent; ///< Boundary parent-child elements
1560
1561 using DomianParentEle = DomainParentEle; //< @deprecated Use DomainParentEle instead
1562};
1563
1564/**
1565 * @brief Specialization for 3D problems
1566 */
1568 using DomainEle = PipelineManager::VolEle; ///< 3D domain elements (volumes)
1569 using BoundaryEle = PipelineManager::FaceEle; ///< 3D boundary elements (faces)
1570 using FaceSideEle = VolumeElementForcesAndSourcesCoreOnSide; ///< Volume side elements
1571 // !!! Not yet implemented
1572 // using DomainParentEle = VolumeElementForcesAndSourcesCoreOnChildParent;
1573 using BoundaryParentEle = FaceElementForcesAndSourcesCoreOnChildParent; ///< Boundary parent-child elements
1574};
1575
1576} // namespace MoFEM
1577
1578#endif // __BASIC_HPP__
1579
1580/**
1581 * \defgroup mofem_basic_interface PipelineManager interface
1582 * \brief Implementation of basic interface for rapid problem implementation.
1583 *
1584 * \ingroup mofem
1585 **/
std::string type
MoFEM interface.
ElementsAndOps< SPACE_DIM >::DomainParentEle DomainParentEle
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define DEPRECATED
Definition definitions.h:17
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
MoFEMErrorCode loopFiniteElementsEvaluation(SmartPetscObj< DM > dm=nullptr)
Iterate evaluation finite elements.
MoFEMErrorCode loopBoundaryPostProc(SmartPetscObj< DM > dm=nullptr)
Iterate boundary postprocessing finite elements only.
boost::ptr_deque< UserDataOperator > & getOpBoundaryExplicitRhsPipeline()
Get the Op Boundary Rhs Pipeline object for implicit-explicit G term.
boost::ptr_deque< UserDataOperator > & getOpBoundaryPostProcPipeline()
Get the Op Boundary PostProc Pipeline object.
boost::ptr_deque< UserDataOperator > & getOpDomainExplicitRhsPipeline()
Get the Op Domain Rhs Pipeline object for implicit-explicit G term.
MoFEMErrorCode loopFiniteElements(SmartPetscObj< DM > dm=nullptr)
Iterate finite elements.
boost::ptr_deque< UserDataOperator > & getOpSkeletonExplicitRhsPipeline()
Get the Op Skeleton Rhs Pipeline object for implicit-explicit G term.
boost::ptr_deque< UserDataOperator > & getOpDomainLhsPipeline()
Get the Op Domain Lhs Pipeline object.
SmartPetscObj< SNES > createSNES(SmartPetscObj< DM > dm=nullptr)
Create SNES (nonlinear) solver.
boost::ptr_deque< UserDataOperator > & getOpSkeletonLhsPipeline()
Get the Op Skeleton Lhs Pipeline object.
SmartPetscObj< TS > createTSIM(SmartPetscObj< DM > dm=nullptr)
Create TS (time) implicit solver.
SmartPetscObj< TS > createTSIM2(SmartPetscObj< DM > dm=nullptr)
Create TS (time) solver for second order equation in time.
boost::ptr_deque< UserDataOperator > & getOpBoundaryLhsPipeline()
Get the Op Boundary Lhs Pipeline object.
SmartPetscObj< KSP > createKSP(SmartPetscObj< DM > dm=nullptr)
Create KSP (linear) solver.
boost::ptr_deque< UserDataOperator > & getOpBoundaryRhsPipeline()
Get the Op Boundary Rhs Pipeline object.
boost::ptr_deque< UserDataOperator > & getOpDomainPostProcPipeline()
Get the Op Domain PostProc Pipeline object.
SmartPetscObj< TS > createTSIMEX(SmartPetscObj< DM > dm=nullptr)
Create TS (time) implicit-explicit solver.
boost::ptr_deque< UserDataOperator > & getOpSkeletonRhsPipeline()
Get the Op Skeleton Rhs Pipeline object.
SmartPetscObj< TS > createTSEX(SmartPetscObj< DM > dm=nullptr)
Create TS (time) explicit solver.
MoFEMErrorCode loopFiniteElementsPostProc(SmartPetscObj< DM > dm=nullptr)
Iterate postprocessing finite elements.
boost::ptr_deque< UserDataOperator > & getOpDomainRhsPipeline()
Get the Op Domain Rhs Pipeline object.
boost::ptr_deque< UserDataOperator > & getOpEvaluationPipeline()
Get the Op Domain Evaluation Pipeline object.
MoFEMErrorCode loopDomainPostProc(SmartPetscObj< DM > dm=nullptr)
Iterate domain postprocessing finite elements only.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
Definition Common.hpp:10
Core (interface) class.
Definition Core.hpp:83
Base face element used to integrate on skeleton.
structure to get information from mofem into EntitiesFieldData
boost::function< int(int order_row, int order_col, int order_data)> RuleHookFun
Template struct for dimension-specific finite element types.
PipelineManager interface.
TSType
Enumeration of time solver types.
@ IM
Implicit time integration.
@ IM2
Second-order implicit time integration.
@ IMEX
Implicit-explicit time integration.
@ EX
Explicit time integration.
boost::shared_ptr< FEMethod > feBoundaryRhs
Element to assemble RHS side by integrating boundary.
boost::shared_ptr< FEMethod > & getDomainRhsFE()
Get domain right-hand side finite element.
boost::ptr_deque< UserDataOperator > & getOpMeshsetRhsPipeline()
Get the Op Meshset Rhs Pipeline object.
MoFEMErrorCode setSkeletonLhsIntegrationRule(RuleHookFun rule)
Set integration rule for skeleton left-hand side finite element.
auto getCastEvaluationFE()
Get typed domain evaluation finite element.
auto getCastDomainLhsFE()
Get typed domain left-hand side finite element.
MoFEM::VolumeElementForcesAndSourcesCore VolEle
auto getCastBoundaryExplicitRhsFE()
Get typed boundary explicit right-hand side finite element.
boost::shared_ptr< FEMethod > feDomainExplicitRhs
Element to assemble explicit Rhs for IMEX solver.
boost::shared_ptr< FEMethod > feEvaluation
Element for evaluation by integrating domain.
auto getCastMeshsetExplicitRhsFE()
Get typed meshset explicit right-hand side finite element.
boost::shared_ptr< FEMethod > feMeshsetLhs
DEPRECATED auto createTS2(SmartPetscObj< DM > dm=nullptr)
MoFEMErrorCode setEvaluationIntegrationRule(RuleHookFun rule)
Set integration rule for domain evaluation finite element.
boost::shared_ptr< FEMethod > & getDomainLhsFE()
Get domain left-hand side finite element.
auto getCastBoundaryLhsFE()
Get typed boundary left-hand side finite element.
auto getCastSkeletonRhsFE()
Get typed skeleton right-hand side finite element.
MoFEM::ForcesAndSourcesCore::RuleHookFun RuleHookFun
boost::ptr_deque< UserDataOperator > & getOpMeshsetExplicitRhsPipeline()
Get the Op Meshset Explicit Rhs Pipeline object.
boost::shared_ptr< FEMethod > feBoundaryLhs
Element to assemble LHS side by integrating boundary.
boost::shared_ptr< FEMethod > & getSkeletonRhsFE()
Get skeleton right-hand side finite element.
MoFEMErrorCode setBoundaryExplicitRhsIntegrationRule(RuleHookFun rule)
Set integration rule for boundary explicit right-hand side finite element.
MoFEM::FaceElementForcesAndSourcesCore FaceEle
boost::shared_ptr< FEMethod > & getDomainPostProcFE()
Get domain postprocessing finite element.
boost::shared_ptr< FEMethod > & getMeshsetLhsFE()
Get meshset left-hand side finite element.
boost::shared_ptr< FEMethod > feSkeletonExplicitRhs
boost::shared_ptr< FEMethod > feMeshsetExplicitRhs
SmartPetscObj< TS > createTS(const TSType type, SmartPetscObj< DM > dm=nullptr)
Create TS (time) solver with specified type.
auto getCastSkeletonLhsFE()
Get typed skeleton left-hand side finite element.
boost::shared_ptr< FEMethod > & getBoundaryLhsFE()
Get boundary left-hand side finite element.
boost::shared_ptr< FEMethod > & getSkeletonLhsFE()
Get skeleton left-hand side finite element.
MoFEMErrorCode setDomainRhsIntegrationRule(RuleHookFun rule)
Set integration rule for domain right-hand side finite element.
auto getCastSkeletonExplicitRhsFE()
Get typed skeleton explicit right-hand side finite element.
MoFEMErrorCode setBoundaryLhsIntegrationRule(RuleHookFun rule)
Set integration rule for boundary left-hand side finite element.
boost::shared_ptr< FEMethod > feSkeletonLhs
Element to assemble LHS side by integrating skeleton.
boost::shared_ptr< FEMethod > & createBoundaryFEPipeline(boost::shared_ptr< FEMethod > &fe)
Create boundary finite element pipeline based on dimension.
auto getCastDomainExplicitRhsFE()
Get typed domain explicit right-hand side finite element.
MoFEMErrorCode setBoundaryRhsIntegrationRule(RuleHookFun rule)
Set integration rule for boundary right-hand side finite element.
MoFEMErrorCode setDomainExplicitRhsIntegrationRule(RuleHookFun rule)
Set integration rule for domain explicit right-hand side finite element.
boost::shared_ptr< FEMethod > & getEvaluationFE()
Get domain evaluation finite element.
boost::shared_ptr< FEMethod > feDomainLhs
Element to assemble LHS side by integrating domain.
boost::shared_ptr< FEMethod > & getBoundaryPostProcFE()
Get boundary postprocessing finite element.
boost::shared_ptr< FEMethod > feSkeletonRhs
Element to assemble RHS side by integrating skeleton.
MoFEM::EdgeElementForcesAndSourcesCore EdgeEle
boost::shared_ptr< FEMethod > feMeshsetRhs
boost::shared_ptr< FEMethod > & getMeshsetRhsFE()
Get meshset right-hand side finite element.
boost::shared_ptr< FEMethod > & getDomainExplicitRhsFE()
Get domain explicit right-hand side finite element.
boost::shared_ptr< FEMethod > feDomainPostProc
Element for postprocessing by integrating domain.
boost::shared_ptr< FEMethod > & getBoundaryRhsFE()
Get boundary right-hand side finite element.
boost::shared_ptr< FEMethod > feBoundaryPostProc
Element for postprocessing by integrating boundary.
boost::shared_ptr< FEMethod > feDomainRhs
Element to assemble RHS side by integrating domain.
boost::ptr_deque< UserDataOperator > & getOpMeshsetLhsPipeline()
Get the Op Meshset Lhs Pipeline object.
boost::shared_ptr< FEMethod > & createMeshsetFEPipeline(boost::shared_ptr< FEMethod > &fe)
Create meshset finite element pipeline.
boost::shared_ptr< FEMethod > & getSkeletonExplicitRhsFE()
Get skeleton explicit right-hand side finite element.
MoFEMErrorCode setDomainLhsIntegrationRule(RuleHookFun rule)
Set integration rule for domain left-hand side finite element.
auto getCastMeshsetRhsFE()
Get typed meshset right-hand side finite element.
MoFEM::Core & cOre
Reference to MoFEM core instance.
DEPRECATED auto createTS(SmartPetscObj< DM > dm=nullptr)
boost::shared_ptr< FEMethod > & getBoundaryExplicitRhsFE()
Get boundary explicit right-hand side finite element.
auto getCastMeshsetLhsFE()
Get typed meshset left-hand side finite element.
auto getCastBoundaryRhsFE()
Get typed boundary right-hand side finite element.
boost::shared_ptr< FEMethod > & getMeshsetExplicitRhsFE()
Get meshset explicit right-hand side finite element.
MoFEMErrorCode setSkeletonRhsIntegrationRule(RuleHookFun rule)
Set integration rule for skeleton right-hand side finite element.
auto getCastDomainRhsFE()
Get typed domain right-hand side finite element.
boost::shared_ptr< FEMethod > feBoundaryExplicitRhs
auto getCastDomainPostProcFE()
Get typed domain postprocessing finite element.
boost::shared_ptr< FEMethod > & createDomainFEPipeline(boost::shared_ptr< FEMethod > &fe)
Create domain finite element pipeline based on dimension.
auto getCastBoundaryPostProcFE()
Get typed boundary postprocessing finite element.
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Query interface for type-safe casting.
MoFEMErrorCode setSkeletonExplicitRhsIntegrationRule(RuleHookFun rule)
Set integration rule for skeleton explicit right-hand side finite element.
Simple interface for fast problem set-up.
Definition Simple.hpp:27
int getDim() const
Get the problem dimension.
Definition Simple.hpp:373
intrusive_ptr for managing petsc objects
base class for all interface classes