v0.14.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 speedup problem setup and analysts.
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 MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
27 UnknownInterface **iface) const;
28
29 PipelineManager(const MoFEM::Core &core);
30
33
37
38 template <int DIM> struct ElementsAndOpsByDim;
39
40 inline boost::shared_ptr<FEMethod> &getDomainLhsFE();
41
42 inline boost::shared_ptr<FEMethod> &getDomainRhsFE();
43
44 inline boost::shared_ptr<FEMethod> &getBoundaryLhsFE();
45
46 inline boost::shared_ptr<FEMethod> &getBoundaryRhsFE();
47
48 inline boost::shared_ptr<FEMethod> &getSkeletonLhsFE();
49
50 inline boost::shared_ptr<FEMethod> &getSkeletonRhsFE();
51
52 inline boost::shared_ptr<FEMethod> &getDomainExplicitRhsFE();
53
54 inline boost::shared_ptr<FEMethod> &getBoundaryExplicitRhsFE();
55
56 inline boost::shared_ptr<FEMethod> &getSkeletonExplicitRhsFE();
57
58 template <typename T = ForcesAndSourcesCore, int DIM = -1>
59 inline auto getCastDomainLhsFE();
60
61 template <typename T = ForcesAndSourcesCore, int DIM = -1>
62 inline auto getCastDomainRhsFE();
63
64 template <typename T = ForcesAndSourcesCore, int DIM = -1>
65 inline auto getCastBoundaryLhsFE();
66
67 template <typename T = ForcesAndSourcesCore, int DIM = -1>
68 inline auto getCastBoundaryRhsFE();
69
70 template <typename T = ForcesAndSourcesCore, int DIM = -1>
71 inline auto getCastSkeletonLhsFE();
72
73 template <typename T = ForcesAndSourcesCore, int DIM = -1>
74 inline auto getCastSkeletonRhsFE();
75
76 template <typename T = ForcesAndSourcesCore, int DIM = -1>
77 inline auto getCastDomainExplicitRhsFE();
78
79 template <typename T = ForcesAndSourcesCore, int DIM = -1>
80 inline auto getCastBoundaryExplicitRhsFE();
81
82 template <typename T = ForcesAndSourcesCore, int DIM = -1>
83 inline auto getCastSkeletonExplicitRhsFE();
84
85 template <int DIM = -1>
87
88 template <int DIM = -1>
90
91 template <int DIM = -1>
93
94 template <int DIM = -1>
96
97 template <int DIM = -1>
99
100 template <int DIM = -1>
102
103 template <int DIM = -1>
105
106 template <int DIM = -1>
108
109 template <int DIM = -1>
111
112 /**
113 * @brief Get the Op Domain Lhs Pipeline object
114 * @ingroup mofem_basic_interface
115 *
116 * @tparam -1
117 * @return boost::ptr_deque<UserDataOperator>&
118 */
119 template <int DIM = -1>
120 inline boost::ptr_deque<UserDataOperator> &getOpDomainLhsPipeline();
121
122 /**
123 * @brief Get the Op Domain Rhs Pipeline object
124 * @ingroup mofem_basic_interface
125 *
126 * @tparam -1
127 * @return boost::ptr_deque<UserDataOperator>&
128 */
129 template <int DIM = -1>
130 inline boost::ptr_deque<UserDataOperator> &getOpDomainRhsPipeline();
131
132 /**
133 * @brief Get the Op Boundary Lhs Pipeline object
134 * @ingroup mofem_basic_interface
135 *
136 * @tparam -1
137 * @return boost::ptr_deque<UserDataOperator>&
138 */
139 template <int DIM = -1>
140 inline boost::ptr_deque<UserDataOperator> &getOpBoundaryLhsPipeline();
141
142 /**
143 * @brief Get the Op Boundary Rhs Pipeline object
144 * @ingroup mofem_basic_interface
145 *
146 * @tparam -1
147 * @return boost::ptr_deque<UserDataOperator>&
148 */
149 template <int DIM = -1>
150 inline boost::ptr_deque<UserDataOperator> &getOpBoundaryRhsPipeline();
151
152 /**
153 * @brief Get the Op Skeleton Lhs Pipeline object
154 * @ingroup mofem_basic_interface
155 *
156 * @return boost::ptr_deque<UserDataOperator>&
157 */
158 template <int DIM = -1>
159 inline boost::ptr_deque<UserDataOperator> &getOpSkeletonLhsPipeline();
160
161 /**
162 * @brief Get the Op Skeleton Rhs Pipeline object
163 * @ingroup mofem_basic_interface
164 *
165 * @tparam -1
166 * @return boost::ptr_deque<UserDataOperator>&
167 */
168 template <int DIM = -1>
169 inline boost::ptr_deque<UserDataOperator> &getOpSkeletonRhsPipeline();
170
171 /**
172 * @brief Get the Op Domain Rhs Pipeline object for implicit-explicit G term
173 * @ingroup mofem_basic_interface
174 *
175 * @tparam -1
176 * @return boost::ptr_deque<UserDataOperator>&
177 */
178 template <int DIM = -1>
179 inline boost::ptr_deque<UserDataOperator> &getOpDomainExplicitRhsPipeline();
180
181 /**
182 * @brief Get the Op Bondary Rhs Pipeline object for implicit-explicit G term
183 * @ingroup mofem_basic_interface
184 *
185 * @tparam -1
186 * @return boost::ptr_deque<UserDataOperator>&
187 */
188 template <int DIM = -1>
189 inline boost::ptr_deque<UserDataOperator> &getOpBoundaryExplicitRhsPipeline();
190
191 /**
192 * @brief Get the Op Skeleton Rhs Pipeline object for implicit-explicit G term
193 * @ingroup mofem_basic_interface
194 *
195 * @tparam -1
196 * @return boost::ptr_deque<UserDataOperator>&
197 */
198 template <int DIM = -1>
199 inline boost::ptr_deque<UserDataOperator> &getOpSkeletonExplicitRhsPipeline();
200
201 /**
202 * @brief Iterate finite elements
203 * @ingroup mofem_basic_interface
204 *
205 * @return MoFEMErrorCode
206 */
208
209 /**
210 * @brief Create KSP (linear) solver
211 * @ingroup mofem_basic_interface
212 *
213 * @param dm
214 * @return SmartPetscObj<KSP>
215 */
217
218 /**
219 * @brief Create SNES (nonlinear) solver
220 * @ingroup mofem_basic_interface
221 *
222 * @param dm
223 * @return SmartPetscObj<SNES>
224 */
226
227 enum TSType { EX, IM, IM2, IMEX };
228
229 /**
230 * @brief create TS (time) solver
231 *
232 * @param type Type of time solver PipelineManager:EX/IM/IM2/IMEX
233 * @param dm
234 * @return SmartPetscObj<TS>
235 */
236 SmartPetscObj<TS> createTS(const TSType type, SmartPetscObj<DM> dm = nullptr);
237
238 /**
239 * @brief Create TS (time) explit solver
240 * @ingroup mofem_basic_interface
241 *
242 * @param dm
243 * @return SmartPetscObj<TS>
244 */
246
247 /**
248 * @brief Create TS (time) implicit solver
249 * @ingroup mofem_basic_interface
250 *
251 * @param dm
252 * @return SmartPetscObj<TS>
253 */
255
256 /**
257 * @deprecated Use version with explicit TS solver type
258 */
260 return createTSIM(dm);
261 }
262
263 /**
264 * @brief Create TS (time) solver for second order equation in time
265 * @ingroup mofem_basic_interface
266 *
267 * @param dm
268 * @return SmartPetscObj<TS>
269 */
271
272 /**
273 * @deprecated Change name. Use createTSIM2 instead.
274 */
275 inline DEPRECATED auto createTS2(SmartPetscObj<DM> dm = nullptr) {
276 return createTSIM2(dm);
277 }
278
279 /**
280 * @brief Create TS (time) implicit-explicit solver
281 * @ingroup mofem_basic_interface
282 *
283 * @param dm
284 * @return SmartPetscObj<TS>
285 */
287
288private:
290
291 boost::shared_ptr<FEMethod>
292 feDomainRhs; ///< Element to assemble RHS side by integrating domain
293 boost::shared_ptr<FEMethod>
294 feDomainLhs; ///< Element to assemble LHS side by integrating domain
295 boost::shared_ptr<FEMethod>
296 feBoundaryRhs; ///< Element to assemble RHS side by integrating boundary
297 boost::shared_ptr<FEMethod>
298 feBoundaryLhs; ///< Element to assemble LHS side by integrating boundary
299 boost::shared_ptr<FEMethod>
300 feSkeletonRhs; ///< Element to assemble RHS side by integrating skeleton
301 boost::shared_ptr<FEMethod>
302 feSkeletonLhs; ///< Element to assemble LHS side by integrating skeleton
303
304 boost::shared_ptr<FEMethod>
305 feDomainExplicitRhs; ///< Element to assemble explict Rhs for IMEX solver
306 boost::shared_ptr<FEMethod>
307 feBoundaryExplicitRhs; ///< Element to assemble explict Rhs for IMEX
308 ///< solver
309 boost::shared_ptr<FEMethod>
310 feSkeletonExplicitRhs; ///< Element to assemble explict Rhs for IMEX
311 ///< solver
312
313 template <int DIM>
314 inline boost::shared_ptr<FEMethod> &
315 createDomainFEPipeline(boost::shared_ptr<FEMethod> &fe);
316
317 template <int DIM>
318 inline boost::shared_ptr<FEMethod> &
319 createBoundaryFEPipeline(boost::shared_ptr<FEMethod> &fe);
320};
321
322template <int DIM>
323boost::shared_ptr<FEMethod> &
324PipelineManager::createDomainFEPipeline(boost::shared_ptr<FEMethod> &fe) {
325 static_assert(DIM == 1 || DIM == 2 || DIM == 3, "not implemented");
326 fe = boost::make_shared<FEMethod>();
327 return fe;
328}
329
330template <>
331inline boost::shared_ptr<FEMethod> &
332PipelineManager::createDomainFEPipeline<3>(boost::shared_ptr<FEMethod> &fe) {
333 if (!fe)
334 fe = boost::make_shared<VolEle>(cOre);
335 return fe;
336}
337
338template <>
339inline boost::shared_ptr<FEMethod> &
340PipelineManager::createDomainFEPipeline<2>(boost::shared_ptr<FEMethod> &fe) {
341 if (!fe)
342 fe = boost::make_shared<FaceEle>(cOre);
343 return fe;
344}
345
346template <>
347inline boost::shared_ptr<FEMethod> &
348PipelineManager::createDomainFEPipeline<1>(boost::shared_ptr<FEMethod> &fe) {
349 if (!fe)
350 fe = boost::make_shared<EdgeEle>(cOre);
351 return fe;
352}
353
354template <>
355inline boost::shared_ptr<FEMethod> &
356PipelineManager::createDomainFEPipeline<-1>(boost::shared_ptr<FEMethod> &fe) {
357 switch (cOre.getInterface<Simple>()->getDim()) {
358 case 1:
359 return createDomainFEPipeline<1>(fe);
360 case 2:
361 return createDomainFEPipeline<2>(fe);
362 case 3:
363 return createDomainFEPipeline<3>(fe);
364 default:
365 THROW_MESSAGE("Not implemented");
366 }
367}
368
369template <int DIM>
370boost::shared_ptr<FEMethod> &
371PipelineManager::createBoundaryFEPipeline(boost::shared_ptr<FEMethod> &fe) {
372 static_assert(DIM == 1 || DIM == 2 || DIM == 3, "not implemented");
373 fe = boost::make_shared<FEMethod>();
374 return fe;
375}
376
377template <>
378inline boost::shared_ptr<FEMethod> &
379PipelineManager::createBoundaryFEPipeline<3>(boost::shared_ptr<FEMethod> &fe) {
380 if (!fe)
381 fe = boost::make_shared<FaceElementForcesAndSourcesCore>(cOre);
382 return fe;
383}
384
385template <>
386inline boost::shared_ptr<FEMethod> &
387PipelineManager::createBoundaryFEPipeline<2>(boost::shared_ptr<FEMethod> &fe) {
388 if (!fe)
389 fe = boost::make_shared<EdgeEle>(cOre);
390 return fe;
391}
392
393template <>
394inline boost::shared_ptr<FEMethod> &
395PipelineManager::createBoundaryFEPipeline<1>(boost::shared_ptr<FEMethod> &fe) {
396 if (!fe)
397 fe = boost::make_shared<VertexElementForcesAndSourcesCore>(cOre);
398 return fe;
399}
400
401boost::shared_ptr<FEMethod> &PipelineManager::getDomainLhsFE() {
402 return feDomainLhs;
403}
404
405boost::shared_ptr<FEMethod> &PipelineManager::getDomainRhsFE() {
406 return feDomainRhs;
407}
408
409boost::shared_ptr<FEMethod> &PipelineManager::getBoundaryLhsFE() {
410 return feBoundaryLhs;
411}
412
413boost::shared_ptr<FEMethod> &PipelineManager::getBoundaryRhsFE() {
414 return feBoundaryRhs;
415}
416
417boost::shared_ptr<FEMethod> &PipelineManager::getSkeletonLhsFE() {
418 return feSkeletonLhs;
419}
420
421boost::shared_ptr<FEMethod> &PipelineManager::getSkeletonRhsFE() {
422 return feSkeletonRhs;
423}
424
425boost::shared_ptr<FEMethod> &PipelineManager::getDomainExplicitRhsFE() {
426 return feDomainExplicitRhs;
427}
428
429boost::shared_ptr<FEMethod> &PipelineManager::getBoundaryExplicitRhsFE() {
431}
432
433boost::shared_ptr<FEMethod> &PipelineManager::getSkeletonExplicitRhsFE() {
435}
436
437template <>
438inline boost::shared_ptr<FEMethod> &
439PipelineManager::createBoundaryFEPipeline<-1>(boost::shared_ptr<FEMethod> &fe) {
440 switch (cOre.getInterface<Simple>()->getDim()) {
441 case 1:
442 return createBoundaryFEPipeline<1>(fe);
443 case 2:
444 return createBoundaryFEPipeline<2>(fe);
445 case 3:
446 return createBoundaryFEPipeline<3>(fe);
447 default:
448 THROW_MESSAGE("Not implemented");
449 }
450}
451
452template <typename T, int DIM> auto PipelineManager::getCastDomainLhsFE() {
453 return boost::dynamic_pointer_cast<T>(
454 createDomainFEPipeline<DIM>(feDomainLhs));
455}
456
457template <typename T, int DIM> auto PipelineManager::getCastDomainRhsFE() {
458 return boost::dynamic_pointer_cast<T>(
459 createDomainFEPipeline<DIM>(feDomainRhs));
460}
461
462template <typename T, int DIM> auto PipelineManager::getCastBoundaryLhsFE() {
463 return boost::dynamic_pointer_cast<T>(
464 createBoundaryFEPipeline<DIM>(feBoundaryLhs));
465}
466
467template <typename T, int DIM>
469 return boost::dynamic_pointer_cast<T>(
470 createBoundaryFEPipeline<DIM>(feBoundaryRhs));
471}
472
473template <typename T, int DIM>
475 return boost::dynamic_pointer_cast<T>(
476 createBoundaryFEPipeline<DIM>(feSkeletonLhs));
477}
478
479template <typename T, int DIM> auto PipelineManager::getCastSkeletonRhsFE() {
480 return boost::dynamic_pointer_cast<T>(
481 createBoundaryFEPipeline<DIM>(feSkeletonRhs));
482}
483
484template <typename T, int DIM>
486 return boost::dynamic_pointer_cast<T>(
487 createDomainFEPipeline<DIM>(feDomainExplicitRhs));
488}
489
490template <typename T, int DIM>
492 return boost::dynamic_pointer_cast<T>(
493 createBoundaryFEPipeline<DIM>(feBoundaryExplicitRhs));
494}
495
496template <typename T, int DIM>
498 return boost::dynamic_pointer_cast<T>(
499 createBoundaryFEPipeline<DIM>(feSkeletonExplicitRhs));
500}
501
502template <int DIM>
506 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
507 createDomainFEPipeline<DIM>(feDomainLhs))
508 ->getRuleHook = rule;
510}
511
512template <>
516 switch (cOre.getInterface<Simple>()->getDim()) {
517 case 1:
518 return setDomainLhsIntegrationRule<1>(rule);
519 case 2:
520 return setDomainLhsIntegrationRule<2>(rule);
521 case 3:
522 return setDomainLhsIntegrationRule<3>(rule);
523 default:
524 THROW_MESSAGE("Not implemented");
525 }
527}
528
529template <int DIM>
533 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
534 createDomainFEPipeline<DIM>(feDomainRhs))
535 ->getRuleHook = rule;
537}
538
539template <>
543 switch (cOre.getInterface<Simple>()->getDim()) {
544 case 1:
545 return setDomainRhsIntegrationRule<1>(rule);
546 case 2:
547 return setDomainRhsIntegrationRule<2>(rule);
548 case 3:
549 return setDomainRhsIntegrationRule<3>(rule);
550 default:
551 THROW_MESSAGE("Not implemented");
552 }
554}
555
556template <int DIM>
560 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
561 createBoundaryFEPipeline<DIM>(feBoundaryLhs))
562 ->getRuleHook = rule;
564}
565
566template <>
570 switch (cOre.getInterface<Simple>()->getDim()) {
571 case 1:
572 return setBoundaryLhsIntegrationRule<1>(rule);
573 case 2:
574 return setBoundaryLhsIntegrationRule<2>(rule);
575 case 3:
576 return setBoundaryLhsIntegrationRule<3>(rule);
577 default:
578 THROW_MESSAGE("Not implemented");
579 }
581}
582
583template <int DIM>
587 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
588 createBoundaryFEPipeline<DIM>(feBoundaryRhs))
589 ->getRuleHook = rule;
591}
592
593template <>
597 switch (cOre.getInterface<Simple>()->getDim()) {
598 case 1:
599 return setBoundaryRhsIntegrationRule<1>(rule);
600 case 2:
601 return setBoundaryRhsIntegrationRule<2>(rule);
602 case 3:
603 return setBoundaryRhsIntegrationRule<3>(rule);
604 default:
605 THROW_MESSAGE("Not implemented");
606 }
608}
609
610template <int DIM>
614 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
615 createBoundaryFEPipeline<DIM>(feSkeletonLhs))
616 ->getRuleHook = rule;
618}
619
620template <>
624 switch (cOre.getInterface<Simple>()->getDim()) {
625 case 1:
626 return setSkeletonLhsIntegrationRule<1>(rule);
627 case 2:
628 return setSkeletonLhsIntegrationRule<2>(rule);
629 case 3:
630 return setSkeletonLhsIntegrationRule<3>(rule);
631 default:
632 THROW_MESSAGE("Not implemented");
633 }
635}
636
637template <int DIM>
641 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
642 createBoundaryFEPipeline<DIM>(feSkeletonRhs))
643 ->getRuleHook = rule;
645}
646
647template <>
651 switch (cOre.getInterface<Simple>()->getDim()) {
652 case 1:
653 return setSkeletonRhsIntegrationRule<1>(rule);
654 case 2:
655 return setSkeletonRhsIntegrationRule<2>(rule);
656 case 3:
657 return setSkeletonRhsIntegrationRule<3>(rule);
658 default:
659 THROW_MESSAGE("Not implemented");
660 }
662}
663
664template <int DIM>
668 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
669 createDomainFEPipeline<DIM>(feDomainExplicitRhs))
670 ->getRuleHook = rule;
672}
673
674template <>
678 switch (cOre.getInterface<Simple>()->getDim()) {
679 case 1:
680 return setDomainExplicitRhsIntegrationRule<1>(rule);
681 case 2:
682 return setDomainExplicitRhsIntegrationRule<2>(rule);
683 case 3:
684 return setDomainExplicitRhsIntegrationRule<3>(rule);
685 default:
686 THROW_MESSAGE("Not implemented");
687 }
689}
690
691template <int DIM>
695 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
696 createBoundaryFEPipeline<DIM>(feBoundaryExplicitRhs))
697 ->getRuleHook = rule;
699}
700
701template <>
706 switch (cOre.getInterface<Simple>()->getDim()) {
707 case 1:
708 return setBoundaryExplicitRhsIntegrationRule<1>(rule);
709 case 2:
710 return setBoundaryExplicitRhsIntegrationRule<2>(rule);
711 case 3:
712 return setBoundaryExplicitRhsIntegrationRule<3>(rule);
713 default:
714 THROW_MESSAGE("Not implemented");
715 }
717}
718
719template <int DIM>
723 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
724 createBoundaryFEPipeline<DIM>(feSkeletonExplicitRhs))
725 ->getRuleHook = rule;
727}
728
729template <>
734 switch (cOre.getInterface<Simple>()->getDim()) {
735 case 1:
736 return setSkeletonExplicitRhsIntegrationRule<1>(rule);
737 case 2:
738 return setSkeletonExplicitRhsIntegrationRule<2>(rule);
739 case 3:
740 return setSkeletonExplicitRhsIntegrationRule<3>(rule);
741 default:
742 THROW_MESSAGE("Not implemented");
743 }
745}
746
747template <int DIM>
748boost::ptr_deque<PipelineManager::UserDataOperator> &
750 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
751 createDomainFEPipeline<DIM>(feDomainLhs))
752 ->getOpPtrVector();
753}
754
755template <>
756inline boost::ptr_deque<PipelineManager::UserDataOperator> &
758 switch (cOre.getInterface<Simple>()->getDim()) {
759 case 1:
760 return getOpDomainLhsPipeline<1>();
761 case 2:
762 return getOpDomainLhsPipeline<2>();
763 case 3:
764 break;
765 default:
766 THROW_MESSAGE("Not implemented");
767 }
768 return getOpDomainLhsPipeline<3>();
769}
770
771template <int DIM>
772boost::ptr_deque<PipelineManager::UserDataOperator> &
774 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
775 createDomainFEPipeline<DIM>(feDomainRhs))
776 ->getOpPtrVector();
777}
778
779template <>
780inline boost::ptr_deque<PipelineManager::UserDataOperator> &
782 switch (cOre.getInterface<Simple>()->getDim()) {
783 case 1:
784 return getOpDomainRhsPipeline<1>();
785 case 2:
786 return getOpDomainRhsPipeline<2>();
787 case 3:
788 break;
789 default:
790 THROW_MESSAGE("Not implemented");
791 }
792 return getOpDomainRhsPipeline<3>();
793}
794
795template <int DIM>
796boost::ptr_deque<PipelineManager::UserDataOperator> &
798 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
799 createBoundaryFEPipeline<DIM>(feBoundaryLhs))
800 ->getOpPtrVector();
801}
802
803template <>
804inline boost::ptr_deque<PipelineManager::UserDataOperator> &
806 switch (cOre.getInterface<Simple>()->getDim()) {
807 case 1:
808 return getOpBoundaryLhsPipeline<1>();
809 case 2:
810 return getOpBoundaryLhsPipeline<2>();
811 case 3:
812 break;
813 default:
814 THROW_MESSAGE("Not implemented");
815 }
816 return getOpBoundaryLhsPipeline<3>();
817}
818
819template <int DIM>
820boost::ptr_deque<PipelineManager::UserDataOperator> &
822 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
823 createBoundaryFEPipeline<DIM>(feBoundaryRhs))
824 ->getOpPtrVector();
825}
826
827template <>
828inline boost::ptr_deque<PipelineManager::UserDataOperator> &
830 switch (cOre.getInterface<Simple>()->getDim()) {
831 case 1:
832 return getOpBoundaryRhsPipeline<1>();
833 case 2:
834 return getOpBoundaryRhsPipeline<2>();
835 case 3:
836 break;
837 default:
838 THROW_MESSAGE("Not implemented");
839 }
840 return getOpBoundaryRhsPipeline<3>();
841}
842
843template <int DIM>
844boost::ptr_deque<PipelineManager::UserDataOperator> &
846 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
847 createBoundaryFEPipeline<DIM>(feSkeletonLhs))
848 ->getOpPtrVector();
849}
850
851template <>
852inline boost::ptr_deque<PipelineManager::UserDataOperator> &
854 switch (cOre.getInterface<Simple>()->getDim()) {
855 case 1:
856 return getOpSkeletonLhsPipeline<1>();
857 case 2:
858 return getOpSkeletonLhsPipeline<2>();
859 case 3:
860 break;
861 default:
862 THROW_MESSAGE("Not implemented");
863 }
864 return getOpSkeletonLhsPipeline<3>();
865}
866
867template <int DIM>
868boost::ptr_deque<PipelineManager::UserDataOperator> &
870 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
871 createBoundaryFEPipeline<DIM>(feSkeletonRhs))
872 ->getOpPtrVector();
873}
874
875template <>
876inline boost::ptr_deque<PipelineManager::UserDataOperator> &
878 switch (cOre.getInterface<Simple>()->getDim()) {
879 case 1:
880 return getOpSkeletonRhsPipeline<1>();
881 case 2:
882 return getOpSkeletonRhsPipeline<2>();
883 case 3:
884 break;
885 default:
886 THROW_MESSAGE("Not implemented");
887 }
888 return getOpSkeletonRhsPipeline<3>();
889}
890
891template <int DIM>
892boost::ptr_deque<PipelineManager::UserDataOperator> &
894 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
895 createDomainFEPipeline<DIM>(feDomainExplicitRhs))
896 ->getOpPtrVector();
897}
898
899template <>
900inline boost::ptr_deque<PipelineManager::UserDataOperator> &
902 switch (cOre.getInterface<Simple>()->getDim()) {
903 case 1:
904 return getOpDomainExplicitRhsPipeline<1>();
905 case 2:
906 return getOpDomainExplicitRhsPipeline<2>();
907 case 3:
908 break;
909 default:
910 THROW_MESSAGE("Not implemented");
911 }
912 return getOpDomainExplicitRhsPipeline<3>();
913}
914
915template <int DIM>
916boost::ptr_deque<PipelineManager::UserDataOperator> &
918 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
919 createBoundaryFEPipeline<DIM>(feBoundaryExplicitRhs))
920 ->getOpPtrVector();
921}
922
923template <>
924inline boost::ptr_deque<PipelineManager::UserDataOperator> &
926 switch (cOre.getInterface<Simple>()->getDim()) {
927 case 1:
928 return getOpBoundaryExplicitRhsPipeline<1>();
929 case 2:
930 return getOpBoundaryExplicitRhsPipeline<2>();
931 case 3:
932 break;
933 default:
934 THROW_MESSAGE("Not implemented");
935 }
936 return getOpBoundaryExplicitRhsPipeline<3>();
937}
938
939template <int DIM>
940boost::ptr_deque<PipelineManager::UserDataOperator> &
942 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
943 createBoundaryFEPipeline<DIM>(feSkeletonExplicitRhs))
944 ->getOpPtrVector();
945}
946
947template <>
948inline boost::ptr_deque<PipelineManager::UserDataOperator> &
950 switch (cOre.getInterface<Simple>()->getDim()) {
951 case 1:
952 return getOpSkeletonExplicitRhsPipeline<1>();
953 case 2:
954 return getOpSkeletonExplicitRhsPipeline<2>();
955 case 3:
956 break;
957 default:
958 THROW_MESSAGE("Not implemented");
959 }
960 return getOpSkeletonExplicitRhsPipeline<3>();
961}
962
969};
970
975 // !!! Not yet implemented
976 // using DomianParentEle = VolumeElementForcesAndSourcesCoreOnChildParent;
978};
979
980} // namespace MoFEM
981
982#endif // __BASIC_HPP__
983
984/**
985 * \defgroup mofem_basic_interface PipelineManager interface
986 * \brief Implementation of basic interface for rapid problem implementation.
987 *
988 * \ingroup mofem
989 **/
MoFEM interface.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
#define DEPRECATED
Definition: definitions.h:17
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
Definition: definitions.h:561
boost::ptr_deque< UserDataOperator > & getOpBoundaryExplicitRhsPipeline()
Get the Op Bondary Rhs Pipeline object for implicit-explicit G term.
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.
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) explit solver.
boost::ptr_deque< UserDataOperator > & getOpDomainRhsPipeline()
Get the Op Domain Rhs Pipeline object.
const double T
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
Core (interface) class.
Definition: Core.hpp:82
Base face element used to integrate on skeleton.
structure to get information form mofem into EntitiesFieldData
boost::function< int(int order_row, int order_col, int order_data)> RuleHookFun
PipelineManager interface.
boost::shared_ptr< FEMethod > feBoundaryRhs
Element to assemble RHS side by integrating boundary.
boost::shared_ptr< FEMethod > & getDomainRhsFE()
MoFEMErrorCode setSkeletonLhsIntegrationRule(RuleHookFun rule)
MoFEM::VolumeElementForcesAndSourcesCore VolEle
boost::shared_ptr< FEMethod > feDomainExplicitRhs
Element to assemble explict Rhs for IMEX solver.
DEPRECATED auto createTS2(SmartPetscObj< DM > dm=nullptr)
boost::shared_ptr< FEMethod > & getDomainLhsFE()
MoFEM::ForcesAndSourcesCore::RuleHookFun RuleHookFun
boost::shared_ptr< FEMethod > feBoundaryLhs
Element to assemble LHS side by integrating boundary.
boost::shared_ptr< FEMethod > & getSkeletonRhsFE()
MoFEMErrorCode setBoundaryExplicitRhsIntegrationRule(RuleHookFun rule)
MoFEM::FaceElementForcesAndSourcesCore FaceEle
boost::shared_ptr< FEMethod > feSkeletonExplicitRhs
SmartPetscObj< TS > createTS(const TSType type, SmartPetscObj< DM > dm=nullptr)
create TS (time) solver
boost::shared_ptr< FEMethod > & getBoundaryLhsFE()
boost::shared_ptr< FEMethod > & getSkeletonLhsFE()
MoFEMErrorCode setDomainRhsIntegrationRule(RuleHookFun rule)
MoFEMErrorCode setBoundaryLhsIntegrationRule(RuleHookFun rule)
boost::shared_ptr< FEMethod > feSkeletonLhs
Element to assemble LHS side by integrating skeleton.
boost::shared_ptr< FEMethod > & createBoundaryFEPipeline(boost::shared_ptr< FEMethod > &fe)
MoFEMErrorCode setBoundaryRhsIntegrationRule(RuleHookFun rule)
MoFEMErrorCode setDomainExplicitRhsIntegrationRule(RuleHookFun rule)
boost::shared_ptr< FEMethod > feDomainLhs
Element to assemble LHS side by integrating domain.
boost::shared_ptr< FEMethod > feSkeletonRhs
Element to assemble RHS side by integrating skeleton.
MoFEM::EdgeElementForcesAndSourcesCore EdgeEle
boost::shared_ptr< FEMethod > & getDomainExplicitRhsFE()
boost::shared_ptr< FEMethod > & getBoundaryRhsFE()
boost::shared_ptr< FEMethod > feDomainRhs
Element to assemble RHS side by integrating domain.
boost::shared_ptr< FEMethod > & getSkeletonExplicitRhsFE()
MoFEMErrorCode setDomainLhsIntegrationRule(RuleHookFun rule)
DEPRECATED auto createTS(SmartPetscObj< DM > dm=nullptr)
boost::shared_ptr< FEMethod > & getBoundaryExplicitRhsFE()
MoFEMErrorCode setSkeletonRhsIntegrationRule(RuleHookFun rule)
boost::shared_ptr< FEMethod > feBoundaryExplicitRhs
boost::shared_ptr< FEMethod > & createDomainFEPipeline(boost::shared_ptr< FEMethod > &fe)
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
MoFEMErrorCode setSkeletonExplicitRhsIntegrationRule(RuleHookFun rule)
Simple interface for fast problem set-up.
Definition: Simple.hpp:27
int getDim() const
Get the problem dimension.
Definition: Simple.hpp:285
intrusive_ptr for managing petsc objects
base class for all interface classes
Base volume element used to integrate on skeleton.