v0.15.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 inline boost::shared_ptr<FEMethod> &getMeshsetRhsFE();
59
60 inline boost::shared_ptr<FEMethod> &getMeshsetLhsFE();
61
62 inline boost::shared_ptr<FEMethod> &getMeshsetExplicitRhsFE();
63
64 template <typename T = ForcesAndSourcesCore, int DIM = -1>
65 inline auto getCastDomainLhsFE();
66
67 template <typename T = ForcesAndSourcesCore, int DIM = -1>
68 inline auto getCastDomainRhsFE();
69
70 template <typename T = ForcesAndSourcesCore, int DIM = -1>
71 inline auto getCastBoundaryLhsFE();
72
73 template <typename T = ForcesAndSourcesCore, int DIM = -1>
74 inline auto getCastBoundaryRhsFE();
75
76 template <typename T = ForcesAndSourcesCore, int DIM = -1>
77 inline auto getCastSkeletonLhsFE();
78
79 template <typename T = ForcesAndSourcesCore, int DIM = -1>
80 inline auto getCastSkeletonRhsFE();
81
82 template <typename T = ForcesAndSourcesCore, int DIM = -1>
83 inline auto getCastDomainExplicitRhsFE();
84
85 template <typename T = ForcesAndSourcesCore, int DIM = -1>
86 inline auto getCastBoundaryExplicitRhsFE();
87
88 template <typename T = ForcesAndSourcesCore, int DIM = -1>
89 inline auto getCastSkeletonExplicitRhsFE();
90
91 template <typename T = ForcesAndSourcesCore>
92 inline auto getCastMeshsetRhsFE();
93
94 template <typename T = ForcesAndSourcesCore>
95 inline auto getCastMeshsetLhsFE();
96
97 template <typename T = ForcesAndSourcesCore>
98 inline auto getCastMeshsetExplicitRhsFE();
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 template <int DIM = -1>
114
115 template <int DIM = -1>
117
118 template <int DIM = -1>
120
121 template <int DIM = -1>
123
124 template <int DIM = -1>
126
127 /**
128 * @brief Get the Op Domain Lhs Pipeline object
129 * @ingroup mofem_basic_interface
130 *
131 * @tparam -1
132 * @return boost::ptr_deque<UserDataOperator>&
133 */
134 template <int DIM = -1>
135 inline boost::ptr_deque<UserDataOperator> &getOpDomainLhsPipeline();
136
137 /**
138 * @brief Get the Op Domain Rhs Pipeline object
139 * @ingroup mofem_basic_interface
140 *
141 * @tparam -1
142 * @return boost::ptr_deque<UserDataOperator>&
143 */
144 template <int DIM = -1>
145 inline boost::ptr_deque<UserDataOperator> &getOpDomainRhsPipeline();
146
147 /**
148 * @brief Get the Op Boundary Lhs Pipeline object
149 * @ingroup mofem_basic_interface
150 *
151 * @tparam -1
152 * @return boost::ptr_deque<UserDataOperator>&
153 */
154 template <int DIM = -1>
155 inline boost::ptr_deque<UserDataOperator> &getOpBoundaryLhsPipeline();
156
157 /**
158 * @brief Get the Op Boundary Rhs Pipeline object
159 * @ingroup mofem_basic_interface
160 *
161 * @tparam -1
162 * @return boost::ptr_deque<UserDataOperator>&
163 */
164 template <int DIM = -1>
165 inline boost::ptr_deque<UserDataOperator> &getOpBoundaryRhsPipeline();
166
167 /**
168 * @brief Get the Op Skeleton Lhs Pipeline object
169 * @ingroup mofem_basic_interface
170 *
171 * @return boost::ptr_deque<UserDataOperator>&
172 */
173 template <int DIM = -1>
174 inline boost::ptr_deque<UserDataOperator> &getOpSkeletonLhsPipeline();
175
176 /**
177 * @brief Get the Op Skeleton Rhs Pipeline object
178 * @ingroup mofem_basic_interface
179 *
180 * @tparam -1
181 * @return boost::ptr_deque<UserDataOperator>&
182 */
183 template <int DIM = -1>
184 inline boost::ptr_deque<UserDataOperator> &getOpSkeletonRhsPipeline();
185
186 /**
187 * @brief Get the Op Domain Rhs Pipeline object for implicit-explicit G term
188 * @ingroup mofem_basic_interface
189 *
190 * @tparam -1
191 * @return boost::ptr_deque<UserDataOperator>&
192 */
193 template <int DIM = -1>
194 inline boost::ptr_deque<UserDataOperator> &getOpDomainExplicitRhsPipeline();
195
196 /**
197 * @brief Get the Op Bondary Rhs Pipeline object for implicit-explicit G term
198 * @ingroup mofem_basic_interface
199 *
200 * @tparam -1
201 * @return boost::ptr_deque<UserDataOperator>&
202 */
203 template <int DIM = -1>
204 inline boost::ptr_deque<UserDataOperator> &getOpBoundaryExplicitRhsPipeline();
205
206 /**
207 * @brief Get the Op Skeleton Rhs Pipeline object for implicit-explicit G term
208 * @ingroup mofem_basic_interface
209 *
210 * @tparam -1
211 * @return boost::ptr_deque<UserDataOperator>&
212 */
213 template <int DIM = -1>
214 inline boost::ptr_deque<UserDataOperator> &getOpSkeletonExplicitRhsPipeline();
215
216 /**
217 * @brief Get the Op Meshset Rhs Pipeline object
218 *
219 * @return boost::ptr_deque<UserDataOperator>&
220 */
221 boost::ptr_deque<UserDataOperator> &getOpMeshsetRhsPipeline();
222
223 /**
224 * @brief Get the Op Meshset Lhs Pipeline object
225 *
226 * @return boost::ptr_deque<UserDataOperator>&
227 */
228 boost::ptr_deque<UserDataOperator> &getOpMeshsetLhsPipeline();
229
230 /**
231 * @brief Get the Op Meshset Explicit Rhs Pipeline object
232 *
233 * @return boost::ptr_deque<UserDataOperator>&
234 */
235 boost::ptr_deque<UserDataOperator> &getOpMeshsetExplicitRhsPipeline();
236
237 /**
238 * @brief Iterate finite elements
239 * @ingroup mofem_basic_interface
240 *
241 * @return MoFEMErrorCode
242 */
244
245 /**
246 * @brief Create KSP (linear) solver
247 * @ingroup mofem_basic_interface
248 *
249 * @param dm
250 * @return SmartPetscObj<KSP>
251 */
253
254 /**
255 * @brief Create SNES (nonlinear) solver
256 * @ingroup mofem_basic_interface
257 *
258 * @param dm
259 * @return SmartPetscObj<SNES>
260 */
262
263 enum TSType { EX, IM, IM2, IMEX };
264
265 /**
266 * @brief create TS (time) solver
267 *
268 * @param type Type of time solver PipelineManager:EX/IM/IM2/IMEX
269 * @param dm
270 * @return SmartPetscObj<TS>
271 */
272 SmartPetscObj<TS> createTS(const TSType type, SmartPetscObj<DM> dm = nullptr);
273
274 /**
275 * @brief Create TS (time) explit solver
276 * @ingroup mofem_basic_interface
277 *
278 * @param dm
279 * @return SmartPetscObj<TS>
280 */
282
283 /**
284 * @brief Create TS (time) implicit solver
285 * @ingroup mofem_basic_interface
286 *
287 * @param dm
288 * @return SmartPetscObj<TS>
289 */
291
292 /**
293 * @deprecated Use version with explicit TS solver type
294 */
296 return createTSIM(dm);
297 }
298
299 /**
300 * @brief Create TS (time) solver for second order equation in time
301 * @ingroup mofem_basic_interface
302 *
303 * @param dm
304 * @return SmartPetscObj<TS>
305 */
307
308 /**
309 * @deprecated Change name. Use createTSIM2 instead.
310 */
311 inline DEPRECATED auto createTS2(SmartPetscObj<DM> dm = nullptr) {
312 return createTSIM2(dm);
313 }
314
315 /**
316 * @brief Create TS (time) implicit-explicit solver
317 * @ingroup mofem_basic_interface
318 *
319 * @param dm
320 * @return SmartPetscObj<TS>
321 */
323
324private:
326
327 boost::shared_ptr<FEMethod>
328 feDomainRhs; ///< Element to assemble RHS side by integrating domain
329 boost::shared_ptr<FEMethod>
330 feDomainLhs; ///< Element to assemble LHS side by integrating domain
331 boost::shared_ptr<FEMethod>
332 feBoundaryRhs; ///< Element to assemble RHS side by integrating boundary
333 boost::shared_ptr<FEMethod>
334 feBoundaryLhs; ///< Element to assemble LHS side by integrating boundary
335 boost::shared_ptr<FEMethod>
336 feSkeletonRhs; ///< Element to assemble RHS side by integrating skeleton
337 boost::shared_ptr<FEMethod>
338 feSkeletonLhs; ///< Element to assemble LHS side by integrating skeleton
339
340 boost::shared_ptr<FEMethod>
341 feDomainExplicitRhs; ///< Element to assemble explict Rhs for IMEX solver
342 boost::shared_ptr<FEMethod>
343 feBoundaryExplicitRhs; ///< Element to assemble explict Rhs for IMEX
344 ///< solver
345 boost::shared_ptr<FEMethod>
346 feSkeletonExplicitRhs; ///< Element to assemble explict Rhs for IMEX
347 ///< solver
348
349 boost::shared_ptr<FEMethod> feMeshsetRhs; ///< Element to assemble RHS side by
350 ///< integrating meshset
351 boost::shared_ptr<FEMethod> feMeshsetLhs; ///< Element to assemble LHS side by
352 ///< integrating meshset
353 boost::shared_ptr<FEMethod> feMeshsetExplicitRhs; ///< Element to assemble
354 ///< explicit RHS side by
355 ///< integrating meshset
356
357 template <int DIM>
358 inline boost::shared_ptr<FEMethod> &
359 createDomainFEPipeline(boost::shared_ptr<FEMethod> &fe);
360
361 template <int DIM>
362 inline boost::shared_ptr<FEMethod> &
363 createBoundaryFEPipeline(boost::shared_ptr<FEMethod> &fe);
364
365 inline boost::shared_ptr<FEMethod> &
366 createMeshsetFEPipeline(boost::shared_ptr<FEMethod> &fe);
367
368private:
369 struct MeshsetFE;
370};
371
372template <int DIM>
373boost::shared_ptr<FEMethod> &
374PipelineManager::createDomainFEPipeline(boost::shared_ptr<FEMethod> &fe) {
375 static_assert(DIM == 1 || DIM == 2 || DIM == 3, "not implemented");
376 fe = boost::make_shared<FEMethod>();
377 return fe;
378}
379
380template <>
381inline boost::shared_ptr<FEMethod> &
382PipelineManager::createDomainFEPipeline<3>(boost::shared_ptr<FEMethod> &fe) {
383 if (!fe)
384 fe = boost::make_shared<VolEle>(cOre);
385 return fe;
386}
387
388template <>
389inline boost::shared_ptr<FEMethod> &
390PipelineManager::createDomainFEPipeline<2>(boost::shared_ptr<FEMethod> &fe) {
391 if (!fe)
392 fe = boost::make_shared<FaceEle>(cOre);
393 return fe;
394}
395
396template <>
397inline boost::shared_ptr<FEMethod> &
398PipelineManager::createDomainFEPipeline<1>(boost::shared_ptr<FEMethod> &fe) {
399 if (!fe)
400 fe = boost::make_shared<EdgeEle>(cOre);
401 return fe;
402}
403
404template <>
405inline boost::shared_ptr<FEMethod> &
406PipelineManager::createDomainFEPipeline<-1>(boost::shared_ptr<FEMethod> &fe) {
407 switch (cOre.getInterface<Simple>()->getDim()) {
408 case 1:
409 return createDomainFEPipeline<1>(fe);
410 case 2:
411 return createDomainFEPipeline<2>(fe);
412 case 3:
413 return createDomainFEPipeline<3>(fe);
414 default:
415 THROW_MESSAGE("Not implemented");
416 }
417}
418
419template <int DIM>
420boost::shared_ptr<FEMethod> &
421PipelineManager::createBoundaryFEPipeline(boost::shared_ptr<FEMethod> &fe) {
422 static_assert(DIM == 1 || DIM == 2 || DIM == 3, "not implemented");
423 fe = boost::make_shared<FEMethod>();
424 return fe;
425}
426
427template <>
428inline boost::shared_ptr<FEMethod> &
429PipelineManager::createBoundaryFEPipeline<3>(boost::shared_ptr<FEMethod> &fe) {
430 if (!fe)
431 fe = boost::make_shared<FaceElementForcesAndSourcesCore>(cOre);
432 return fe;
433}
434
435template <>
436inline boost::shared_ptr<FEMethod> &
437PipelineManager::createBoundaryFEPipeline<2>(boost::shared_ptr<FEMethod> &fe) {
438 if (!fe)
439 fe = boost::make_shared<EdgeEle>(cOre);
440 return fe;
441}
442
443template <>
444inline boost::shared_ptr<FEMethod> &
445PipelineManager::createBoundaryFEPipeline<1>(boost::shared_ptr<FEMethod> &fe) {
446 if (!fe)
447 fe = boost::make_shared<VertexElementForcesAndSourcesCore>(cOre);
448 return fe;
449}
450
451boost::shared_ptr<FEMethod> &PipelineManager::getDomainLhsFE() {
452 return feDomainLhs;
453}
454
455boost::shared_ptr<FEMethod> &PipelineManager::getDomainRhsFE() {
456 return feDomainRhs;
457}
458
459boost::shared_ptr<FEMethod> &PipelineManager::getBoundaryLhsFE() {
460 return feBoundaryLhs;
461}
462
463boost::shared_ptr<FEMethod> &PipelineManager::getBoundaryRhsFE() {
464 return feBoundaryRhs;
465}
466
467boost::shared_ptr<FEMethod> &PipelineManager::getSkeletonLhsFE() {
468 return feSkeletonLhs;
469}
470
471boost::shared_ptr<FEMethod> &PipelineManager::getSkeletonRhsFE() {
472 return feSkeletonRhs;
473}
474
475boost::shared_ptr<FEMethod> &PipelineManager::getDomainExplicitRhsFE() {
476 return feDomainExplicitRhs;
477}
478
479boost::shared_ptr<FEMethod> &PipelineManager::getBoundaryExplicitRhsFE() {
481}
482
483boost::shared_ptr<FEMethod> &PipelineManager::getSkeletonExplicitRhsFE() {
485}
486
487boost::shared_ptr<FEMethod> &PipelineManager::getMeshsetRhsFE() {
488 return feMeshsetRhs;
489}
490
491boost::shared_ptr<FEMethod> &PipelineManager::getMeshsetLhsFE() {
492 return feMeshsetLhs;
493}
494
495boost::shared_ptr<FEMethod> &PipelineManager::getMeshsetExplicitRhsFE() {
497}
498
499template <>
500inline boost::shared_ptr<FEMethod> &
501PipelineManager::createBoundaryFEPipeline<-1>(boost::shared_ptr<FEMethod> &fe) {
502 switch (cOre.getInterface<Simple>()->getDim()) {
503 case 1:
504 return createBoundaryFEPipeline<1>(fe);
505 case 2:
506 return createBoundaryFEPipeline<2>(fe);
507 case 3:
508 return createBoundaryFEPipeline<3>(fe);
509 default:
510 THROW_MESSAGE("Not implemented");
511 }
512}
513
514template <typename T, int DIM> auto PipelineManager::getCastDomainLhsFE() {
515 return boost::dynamic_pointer_cast<T>(
517}
518
519template <typename T, int DIM> auto PipelineManager::getCastDomainRhsFE() {
520 return boost::dynamic_pointer_cast<T>(
522}
523
524template <typename T, int DIM> auto PipelineManager::getCastBoundaryLhsFE() {
525 return boost::dynamic_pointer_cast<T>(
527}
528
529template <typename T, int DIM>
531 return boost::dynamic_pointer_cast<T>(
533}
534
535template <typename T, int DIM>
537 return boost::dynamic_pointer_cast<T>(
539}
540
541template <typename T, int DIM> auto PipelineManager::getCastSkeletonRhsFE() {
542 return boost::dynamic_pointer_cast<T>(
544}
545
546template <typename T, int DIM>
548 return boost::dynamic_pointer_cast<T>(
550}
551
552template <typename T, int DIM>
554 return boost::dynamic_pointer_cast<T>(
556}
557
558template <typename T, int DIM>
560 return boost::dynamic_pointer_cast<T>(
562}
563
564template <typename T> auto PipelineManager::getCastMeshsetRhsFE() {
565 return boost::dynamic_pointer_cast<T>(createMeshsetFEPipeline(feMeshsetRhs));
566}
567
568template <typename T> auto PipelineManager::getCastMeshsetLhsFE() {
569 return boost::dynamic_pointer_cast<T>(createMeshsetFEPipeline(feMeshsetLhs));
570}
571
573 return boost::dynamic_pointer_cast<T>(
575}
576
577template <int DIM>
581 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
583 ->getRuleHook = rule;
585}
586
587template <>
591 switch (cOre.getInterface<Simple>()->getDim()) {
592 case 1:
593 MoFEMFunctionReturnHot(setDomainLhsIntegrationRule<1>(rule));
594 case 2:
595 MoFEMFunctionReturnHot(setDomainLhsIntegrationRule<2>(rule));
596 case 3:
597 MoFEMFunctionReturnHot(setDomainLhsIntegrationRule<3>(rule));
598 default:
599 THROW_MESSAGE("Not implemented");
600 }
602}
603
604template <int DIM>
608 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
610 ->getRuleHook = rule;
612}
613
614template <>
618 switch (cOre.getInterface<Simple>()->getDim()) {
619 case 1:
620 MoFEMFunctionReturnHot(setDomainRhsIntegrationRule<1>(rule));
621 case 2:
622 MoFEMFunctionReturnHot(setDomainRhsIntegrationRule<2>(rule));
623 case 3:
624 MoFEMFunctionReturnHot(setDomainRhsIntegrationRule<3>(rule));
625 default:
626 THROW_MESSAGE("Not implemented");
627 }
629}
630
631template <int DIM>
635 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
637 ->getRuleHook = rule;
639}
640
641template <>
645 switch (cOre.getInterface<Simple>()->getDim()) {
646 case 1:
647 MoFEMFunctionReturnHot(setBoundaryLhsIntegrationRule<1>(rule));
648 case 2:
649 MoFEMFunctionReturnHot(setBoundaryLhsIntegrationRule<2>(rule));
650 case 3:
651 MoFEMFunctionReturnHot(setBoundaryLhsIntegrationRule<3>(rule));
652 default:
653 THROW_MESSAGE("Not implemented");
654 }
656}
657
658template <int DIM>
662 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
664 ->getRuleHook = rule;
666}
667
668template <>
672 switch (cOre.getInterface<Simple>()->getDim()) {
673 case 1:
674 MoFEMFunctionReturnHot(setBoundaryRhsIntegrationRule<1>(rule));
675 case 2:
676 MoFEMFunctionReturnHot(setBoundaryRhsIntegrationRule<2>(rule));
677 case 3:
678 MoFEMFunctionReturnHot(setBoundaryRhsIntegrationRule<3>(rule));
679 default:
680 THROW_MESSAGE("Not implemented");
681 }
683}
684
685template <int DIM>
689 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
691 ->getRuleHook = rule;
693}
694
695template <>
699 switch (cOre.getInterface<Simple>()->getDim()) {
700 case 1:
701 MoFEMFunctionReturnHot(setSkeletonLhsIntegrationRule<1>(rule));
702 case 2:
703 MoFEMFunctionReturnHot(setSkeletonLhsIntegrationRule<2>(rule));
704 case 3:
705 MoFEMFunctionReturnHot(setSkeletonLhsIntegrationRule<3>(rule));
706 default:
707 THROW_MESSAGE("Not implemented");
708 }
710}
711
712template <int DIM>
716 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
718 ->getRuleHook = rule;
720}
721
722template <>
726 switch (cOre.getInterface<Simple>()->getDim()) {
727 case 1:
728 MoFEMFunctionReturnHot(setSkeletonRhsIntegrationRule<1>(rule));
729 case 2:
730 MoFEMFunctionReturnHot(setSkeletonRhsIntegrationRule<2>(rule));
731 case 3:
732 MoFEMFunctionReturnHot(setSkeletonRhsIntegrationRule<3>(rule));
733 default:
734 THROW_MESSAGE("Not implemented");
735 }
737}
738
739template <int DIM>
743 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
745 ->getRuleHook = rule;
747}
748
749template <>
753 switch (cOre.getInterface<Simple>()->getDim()) {
754 case 1:
755 MoFEMFunctionReturnHot(setDomainExplicitRhsIntegrationRule<1>(rule));
756 case 2:
757 MoFEMFunctionReturnHot(setDomainExplicitRhsIntegrationRule<2>(rule));
758 case 3:
759 MoFEMFunctionReturnHot(setDomainExplicitRhsIntegrationRule<3>(rule));
760 default:
761 THROW_MESSAGE("Not implemented");
762 }
764}
765
766template <int DIM>
770 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
772 ->getRuleHook = rule;
774}
775
776template <>
781 switch (cOre.getInterface<Simple>()->getDim()) {
782 case 1:
783 MoFEMFunctionReturnHot(setBoundaryExplicitRhsIntegrationRule<1>(rule));
784 case 2:
785 MoFEMFunctionReturnHot(setBoundaryExplicitRhsIntegrationRule<2>(rule));
786 case 3:
787 MoFEMFunctionReturnHot(setBoundaryExplicitRhsIntegrationRule<3>(rule));
788 default:
789 THROW_MESSAGE("Not implemented");
790 }
792}
793
794template <int DIM>
798 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
800 ->getRuleHook = rule;
802}
803
804template <>
809 switch (cOre.getInterface<Simple>()->getDim()) {
810 case 1:
811 MoFEMFunctionReturnHot(setSkeletonExplicitRhsIntegrationRule<1>(rule));
812 case 2:
813 MoFEMFunctionReturnHot(setSkeletonExplicitRhsIntegrationRule<2>(rule));
814 case 3:
815 MoFEMFunctionReturnHot(setSkeletonExplicitRhsIntegrationRule<3>(rule));
816 default:
817 THROW_MESSAGE("Not implemented");
818 }
820}
821
822template <int DIM>
823boost::ptr_deque<PipelineManager::UserDataOperator> &
825 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
827 ->getOpPtrVector();
828}
829
830template <>
831inline boost::ptr_deque<PipelineManager::UserDataOperator> &
833 switch (cOre.getInterface<Simple>()->getDim()) {
834 case 1:
835 return getOpDomainLhsPipeline<1>();
836 case 2:
837 return getOpDomainLhsPipeline<2>();
838 case 3:
839 break;
840 default:
841 THROW_MESSAGE("Not implemented");
842 }
843 return getOpDomainLhsPipeline<3>();
844}
845
846template <int DIM>
847boost::ptr_deque<PipelineManager::UserDataOperator> &
849 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
851 ->getOpPtrVector();
852}
853
854template <>
855inline boost::ptr_deque<PipelineManager::UserDataOperator> &
857 switch (cOre.getInterface<Simple>()->getDim()) {
858 case 1:
859 return getOpDomainRhsPipeline<1>();
860 case 2:
861 return getOpDomainRhsPipeline<2>();
862 case 3:
863 break;
864 default:
865 THROW_MESSAGE("Not implemented");
866 }
867 return getOpDomainRhsPipeline<3>();
868}
869
870template <int DIM>
871boost::ptr_deque<PipelineManager::UserDataOperator> &
873 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
875 ->getOpPtrVector();
876}
877
878template <>
879inline boost::ptr_deque<PipelineManager::UserDataOperator> &
881 switch (cOre.getInterface<Simple>()->getDim()) {
882 case 1:
883 return getOpBoundaryLhsPipeline<1>();
884 case 2:
885 return getOpBoundaryLhsPipeline<2>();
886 case 3:
887 break;
888 default:
889 THROW_MESSAGE("Not implemented");
890 }
891 return getOpBoundaryLhsPipeline<3>();
892}
893
894template <int DIM>
895boost::ptr_deque<PipelineManager::UserDataOperator> &
897 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
899 ->getOpPtrVector();
900}
901
902template <>
903inline boost::ptr_deque<PipelineManager::UserDataOperator> &
905 switch (cOre.getInterface<Simple>()->getDim()) {
906 case 1:
907 return getOpBoundaryRhsPipeline<1>();
908 case 2:
909 return getOpBoundaryRhsPipeline<2>();
910 case 3:
911 break;
912 default:
913 THROW_MESSAGE("Not implemented");
914 }
915 return getOpBoundaryRhsPipeline<3>();
916}
917
918template <int DIM>
919boost::ptr_deque<PipelineManager::UserDataOperator> &
921 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
923 ->getOpPtrVector();
924}
925
926template <>
927inline boost::ptr_deque<PipelineManager::UserDataOperator> &
929 switch (cOre.getInterface<Simple>()->getDim()) {
930 case 1:
931 return getOpSkeletonLhsPipeline<1>();
932 case 2:
933 return getOpSkeletonLhsPipeline<2>();
934 case 3:
935 break;
936 default:
937 THROW_MESSAGE("Not implemented");
938 }
939 return getOpSkeletonLhsPipeline<3>();
940}
941
942template <int DIM>
943boost::ptr_deque<PipelineManager::UserDataOperator> &
945 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
947 ->getOpPtrVector();
948}
949
950template <>
951inline boost::ptr_deque<PipelineManager::UserDataOperator> &
953 switch (cOre.getInterface<Simple>()->getDim()) {
954 case 1:
955 return getOpSkeletonRhsPipeline<1>();
956 case 2:
957 return getOpSkeletonRhsPipeline<2>();
958 case 3:
959 break;
960 default:
961 THROW_MESSAGE("Not implemented");
962 }
963 return getOpSkeletonRhsPipeline<3>();
964}
965
966template <int DIM>
967boost::ptr_deque<PipelineManager::UserDataOperator> &
969 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
971 ->getOpPtrVector();
972}
973
974template <>
975inline boost::ptr_deque<PipelineManager::UserDataOperator> &
977 switch (cOre.getInterface<Simple>()->getDim()) {
978 case 1:
979 return getOpDomainExplicitRhsPipeline<1>();
980 case 2:
981 return getOpDomainExplicitRhsPipeline<2>();
982 case 3:
983 break;
984 default:
985 THROW_MESSAGE("Not implemented");
986 }
987 return getOpDomainExplicitRhsPipeline<3>();
988}
989
990template <int DIM>
991boost::ptr_deque<PipelineManager::UserDataOperator> &
993 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
995 ->getOpPtrVector();
996}
997
998template <>
999inline boost::ptr_deque<PipelineManager::UserDataOperator> &
1001 switch (cOre.getInterface<Simple>()->getDim()) {
1002 case 1:
1003 return getOpBoundaryExplicitRhsPipeline<1>();
1004 case 2:
1005 return getOpBoundaryExplicitRhsPipeline<2>();
1006 case 3:
1007 break;
1008 default:
1009 THROW_MESSAGE("Not implemented");
1010 }
1011 return getOpBoundaryExplicitRhsPipeline<3>();
1012}
1013
1014template <int DIM>
1015boost::ptr_deque<PipelineManager::UserDataOperator> &
1017 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
1019 ->getOpPtrVector();
1020}
1021
1022template <>
1023inline boost::ptr_deque<PipelineManager::UserDataOperator> &
1025 switch (cOre.getInterface<Simple>()->getDim()) {
1026 case 1:
1027 return getOpSkeletonExplicitRhsPipeline<1>();
1028 case 2:
1029 return getOpSkeletonExplicitRhsPipeline<2>();
1030 case 3:
1031 break;
1032 default:
1033 THROW_MESSAGE("Not implemented");
1034 }
1035 return getOpSkeletonExplicitRhsPipeline<3>();
1036}
1037
1045
1050 // !!! Not yet implemented
1051 // using DomianParentEle = VolumeElementForcesAndSourcesCoreOnChildParent;
1053};
1054
1055} // namespace MoFEM
1056
1057#endif // __BASIC_HPP__
1058
1059/**
1060 * \defgroup mofem_basic_interface PipelineManager interface
1061 * \brief Implementation of basic interface for rapid problem implementation.
1062 *
1063 * \ingroup mofem
1064 **/
MoFEM interface.
#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.
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.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
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()
boost::ptr_deque< UserDataOperator > & getOpMeshsetRhsPipeline()
Get the Op Meshset Rhs Pipeline object.
MoFEMErrorCode setSkeletonLhsIntegrationRule(RuleHookFun rule)
MoFEM::VolumeElementForcesAndSourcesCore VolEle
boost::shared_ptr< FEMethod > feDomainExplicitRhs
Element to assemble explict Rhs for IMEX solver.
boost::shared_ptr< FEMethod > feMeshsetLhs
DEPRECATED auto createTS2(SmartPetscObj< DM > dm=nullptr)
boost::shared_ptr< FEMethod > & getDomainLhsFE()
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()
MoFEMErrorCode setBoundaryExplicitRhsIntegrationRule(RuleHookFun rule)
MoFEM::FaceElementForcesAndSourcesCore FaceEle
boost::shared_ptr< FEMethod > & getMeshsetLhsFE()
boost::shared_ptr< FEMethod > feSkeletonExplicitRhs
boost::shared_ptr< FEMethod > feMeshsetExplicitRhs
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 > feMeshsetRhs
boost::shared_ptr< FEMethod > & getMeshsetRhsFE()
boost::shared_ptr< FEMethod > & getDomainExplicitRhsFE()
boost::shared_ptr< FEMethod > & getBoundaryRhsFE()
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)
boost::shared_ptr< FEMethod > & getSkeletonExplicitRhsFE()
MoFEMErrorCode setDomainLhsIntegrationRule(RuleHookFun rule)
DEPRECATED auto createTS(SmartPetscObj< DM > dm=nullptr)
boost::shared_ptr< FEMethod > & getBoundaryExplicitRhsFE()
boost::shared_ptr< FEMethod > & getMeshsetExplicitRhsFE()
MoFEMErrorCode setSkeletonRhsIntegrationRule(RuleHookFun rule)
boost::shared_ptr< FEMethod > feBoundaryExplicitRhs
boost::shared_ptr< FEMethod > & createDomainFEPipeline(boost::shared_ptr< FEMethod > &fe)
PipelineManager(const MoFEM::Core &core)
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:333
intrusive_ptr for managing petsc objects
base class for all interface classes