v0.14.0
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 
18 namespace 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  */
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  */
259  DEPRECATED auto createTS(SmartPetscObj<DM> dm = nullptr) {
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 
288 private:
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 
322 template <int DIM>
323 boost::shared_ptr<FEMethod> &
324 PipelineManager::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 
330 template <>
331 inline boost::shared_ptr<FEMethod> &
332 PipelineManager::createDomainFEPipeline<3>(boost::shared_ptr<FEMethod> &fe) {
333  if (!fe)
334  fe = boost::make_shared<VolEle>(cOre);
335  return fe;
336 }
337 
338 template <>
339 inline boost::shared_ptr<FEMethod> &
340 PipelineManager::createDomainFEPipeline<2>(boost::shared_ptr<FEMethod> &fe) {
341  if (!fe)
342  fe = boost::make_shared<FaceEle>(cOre);
343  return fe;
344 }
345 
346 template <>
347 inline boost::shared_ptr<FEMethod> &
348 PipelineManager::createDomainFEPipeline<1>(boost::shared_ptr<FEMethod> &fe) {
349  if (!fe)
350  fe = boost::make_shared<EdgeEle>(cOre);
351  return fe;
352 }
353 
354 template <>
355 inline boost::shared_ptr<FEMethod> &
356 PipelineManager::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 
369 template <int DIM>
370 boost::shared_ptr<FEMethod> &
371 PipelineManager::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 
377 template <>
378 inline boost::shared_ptr<FEMethod> &
379 PipelineManager::createBoundaryFEPipeline<3>(boost::shared_ptr<FEMethod> &fe) {
380  if (!fe)
381  fe = boost::make_shared<FaceElementForcesAndSourcesCore>(cOre);
382  return fe;
383 }
384 
385 template <>
386 inline boost::shared_ptr<FEMethod> &
387 PipelineManager::createBoundaryFEPipeline<2>(boost::shared_ptr<FEMethod> &fe) {
388  if (!fe)
389  fe = boost::make_shared<EdgeEle>(cOre);
390  return fe;
391 }
392 
393 template <>
394 inline boost::shared_ptr<FEMethod> &
395 PipelineManager::createBoundaryFEPipeline<1>(boost::shared_ptr<FEMethod> &fe) {
396  if (!fe)
397  fe = boost::make_shared<VertexElementForcesAndSourcesCore>(cOre);
398  return fe;
399 }
400 
401 boost::shared_ptr<FEMethod> &PipelineManager::getDomainLhsFE() {
402  return feDomainLhs;
403 }
404 
405 boost::shared_ptr<FEMethod> &PipelineManager::getDomainRhsFE() {
406  return feDomainRhs;
407 }
408 
409 boost::shared_ptr<FEMethod> &PipelineManager::getBoundaryLhsFE() {
410  return feBoundaryLhs;
411 }
412 
413 boost::shared_ptr<FEMethod> &PipelineManager::getBoundaryRhsFE() {
414  return feBoundaryRhs;
415 }
416 
417 boost::shared_ptr<FEMethod> &PipelineManager::getSkeletonLhsFE() {
418  return feSkeletonLhs;
419 }
420 
421 boost::shared_ptr<FEMethod> &PipelineManager::getSkeletonRhsFE() {
422  return feSkeletonRhs;
423 }
424 
425 boost::shared_ptr<FEMethod> &PipelineManager::getDomainExplicitRhsFE() {
426  return feDomainExplicitRhs;
427 }
428 
429 boost::shared_ptr<FEMethod> &PipelineManager::getBoundaryExplicitRhsFE() {
430  return feBoundaryExplicitRhs;
431 }
432 
433 boost::shared_ptr<FEMethod> &PipelineManager::getSkeletonExplicitRhsFE() {
434  return feSkeletonExplicitRhs;
435 }
436 
437 template <>
438 inline boost::shared_ptr<FEMethod> &
439 PipelineManager::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 
452 template <typename T, int DIM> auto PipelineManager::getCastDomainLhsFE() {
453  return boost::dynamic_pointer_cast<T>(
454  createDomainFEPipeline<DIM>(feDomainLhs));
455 }
456 
457 template <typename T, int DIM> auto PipelineManager::getCastDomainRhsFE() {
458  return boost::dynamic_pointer_cast<T>(
459  createDomainFEPipeline<DIM>(feDomainRhs));
460 }
461 
462 template <typename T, int DIM> auto PipelineManager::getCastBoundaryLhsFE() {
463  return boost::dynamic_pointer_cast<T>(
464  createBoundaryFEPipeline<DIM>(feBoundaryLhs));
465 }
466 
467 template <typename T, int DIM>
469  return boost::dynamic_pointer_cast<T>(
470  createBoundaryFEPipeline<DIM>(feBoundaryRhs));
471 }
472 
473 template <typename T, int DIM>
475  return boost::dynamic_pointer_cast<T>(
476  createBoundaryFEPipeline<DIM>(feSkeletonLhs));
477 }
478 
479 template <typename T, int DIM> auto PipelineManager::getCastSkeletonRhsFE() {
480  return boost::dynamic_pointer_cast<T>(
481  createBoundaryFEPipeline<DIM>(feSkeletonRhs));
482 }
483 
484 template <typename T, int DIM>
486  return boost::dynamic_pointer_cast<T>(
487  createDomainFEPipeline<DIM>(feDomainExplicitRhs));
488 }
489 
490 template <typename T, int DIM>
492  return boost::dynamic_pointer_cast<T>(
493  createBoundaryFEPipeline<DIM>(feBoundaryExplicitRhs));
494 }
495 
496 template <typename T, int DIM>
498  return boost::dynamic_pointer_cast<T>(
499  createBoundaryFEPipeline<DIM>(feSkeletonExplicitRhs));
500 }
501 
502 template <int DIM>
506  boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
507  createDomainFEPipeline<DIM>(feDomainLhs))
508  ->getRuleHook = rule;
510 }
511 
512 template <>
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 
529 template <int DIM>
533  boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
534  createDomainFEPipeline<DIM>(feDomainRhs))
535  ->getRuleHook = rule;
537 }
538 
539 template <>
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 
556 template <int DIM>
560  boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
561  createBoundaryFEPipeline<DIM>(feBoundaryLhs))
562  ->getRuleHook = rule;
564 }
565 
566 template <>
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 
583 template <int DIM>
587  boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
588  createBoundaryFEPipeline<DIM>(feBoundaryRhs))
589  ->getRuleHook = rule;
591 }
592 
593 template <>
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 
610 template <int DIM>
614  boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
615  createBoundaryFEPipeline<DIM>(feSkeletonLhs))
616  ->getRuleHook = rule;
618 }
619 
620 template <>
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 
637 template <int DIM>
641  boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
642  createBoundaryFEPipeline<DIM>(feSkeletonRhs))
643  ->getRuleHook = rule;
645 }
646 
647 template <>
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 
664 template <int DIM>
668  boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
669  createDomainFEPipeline<DIM>(feDomainExplicitRhs))
670  ->getRuleHook = rule;
672 }
673 
674 template <>
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 
691 template <int DIM>
695  boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
696  createBoundaryFEPipeline<DIM>(feBoundaryExplicitRhs))
697  ->getRuleHook = rule;
699 }
700 
701 template <>
702 inline MoFEMErrorCode
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 
719 template <int DIM>
723  boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
724  createBoundaryFEPipeline<DIM>(feSkeletonExplicitRhs))
725  ->getRuleHook = rule;
727 }
728 
729 template <>
730 inline MoFEMErrorCode
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 
747 template <int DIM>
748 boost::ptr_deque<PipelineManager::UserDataOperator> &
750  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
751  createDomainFEPipeline<DIM>(feDomainLhs))
752  ->getOpPtrVector();
753 }
754 
755 template <>
756 inline 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 
771 template <int DIM>
772 boost::ptr_deque<PipelineManager::UserDataOperator> &
774  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
775  createDomainFEPipeline<DIM>(feDomainRhs))
776  ->getOpPtrVector();
777 }
778 
779 template <>
780 inline 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 
795 template <int DIM>
796 boost::ptr_deque<PipelineManager::UserDataOperator> &
798  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
799  createBoundaryFEPipeline<DIM>(feBoundaryLhs))
800  ->getOpPtrVector();
801 }
802 
803 template <>
804 inline 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 
819 template <int DIM>
820 boost::ptr_deque<PipelineManager::UserDataOperator> &
822  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
823  createBoundaryFEPipeline<DIM>(feBoundaryRhs))
824  ->getOpPtrVector();
825 }
826 
827 template <>
828 inline 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 
843 template <int DIM>
844 boost::ptr_deque<PipelineManager::UserDataOperator> &
846  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
847  createBoundaryFEPipeline<DIM>(feSkeletonLhs))
848  ->getOpPtrVector();
849 }
850 
851 template <>
852 inline 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 
867 template <int DIM>
868 boost::ptr_deque<PipelineManager::UserDataOperator> &
870  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
871  createBoundaryFEPipeline<DIM>(feSkeletonRhs))
872  ->getOpPtrVector();
873 }
874 
875 template <>
876 inline 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 
891 template <int DIM>
892 boost::ptr_deque<PipelineManager::UserDataOperator> &
894  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
895  createDomainFEPipeline<DIM>(feDomainExplicitRhs))
896  ->getOpPtrVector();
897 }
898 
899 template <>
900 inline 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 
915 template <int DIM>
916 boost::ptr_deque<PipelineManager::UserDataOperator> &
918  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
919  createBoundaryFEPipeline<DIM>(feBoundaryExplicitRhs))
920  ->getOpPtrVector();
921 }
922 
923 template <>
924 inline 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 
939 template <int DIM>
940 boost::ptr_deque<PipelineManager::UserDataOperator> &
942  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
943  createBoundaryFEPipeline<DIM>(feSkeletonExplicitRhs))
944  ->getOpPtrVector();
945 }
946 
947 template <>
948 inline 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::EdgeElementForcesAndSourcesCore
Edge finite element.
Definition: EdgeElementForcesAndSourcesCore.hpp:30
MoFEM::PipelineManager::getCastDomainRhsFE
auto getCastDomainRhsFE()
Definition: PipelineManager.hpp:457
MoFEM::PipelineManager::getCastDomainLhsFE
auto getCastDomainLhsFE()
Definition: PipelineManager.hpp:452
MoFEM::PipelineManager::getSkeletonExplicitRhsFE
boost::shared_ptr< FEMethod > & getSkeletonExplicitRhsFE()
Definition: PipelineManager.hpp:433
MoFEM::PipelineManager::EX
@ EX
Definition: PipelineManager.hpp:227
MoFEM::PipelineManager::getDomainRhsFE
boost::shared_ptr< FEMethod > & getDomainRhsFE()
Definition: PipelineManager.hpp:405
MoFEM::CoreTmp< 0 >
Core (interface) class.
Definition: Core.hpp:82
DEPRECATED
#define DEPRECATED
Definition: definitions.h:17
MoFEM::PipelineManager::createSNES
SmartPetscObj< SNES > createSNES(SmartPetscObj< DM > dm=nullptr)
Create SNES (nonlinear) solver.
Definition: PipelineManager.cpp:109
MoFEM::PipelineManager::getCastBoundaryExplicitRhsFE
auto getCastBoundaryExplicitRhsFE()
Definition: PipelineManager.hpp:491
MoFEM::PipelineManager::getOpSkeletonRhsPipeline
boost::ptr_deque< UserDataOperator > & getOpSkeletonRhsPipeline()
Get the Op Skeleton Rhs Pipeline object.
Definition: PipelineManager.hpp:869
MoFEM::PipelineManager::ElementsAndOpsByDim
Definition: PipelineManager.hpp:38
MoFEM::PipelineManager::loopFiniteElements
MoFEMErrorCode loopFiniteElements(SmartPetscObj< DM > dm=nullptr)
Iterate finite elements.
Definition: PipelineManager.cpp:19
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
MoFEM::PipelineManager::getBoundaryExplicitRhsFE
boost::shared_ptr< FEMethod > & getBoundaryExplicitRhsFE()
Definition: PipelineManager.hpp:429
MoFEM::PipelineManager::getBoundaryLhsFE
boost::shared_ptr< FEMethod > & getBoundaryLhsFE()
Definition: PipelineManager.hpp:409
MoFEM::PipelineManager::getOpDomainRhsPipeline
boost::ptr_deque< UserDataOperator > & getOpDomainRhsPipeline()
Get the Op Domain Rhs Pipeline object.
Definition: PipelineManager.hpp:773
MoFEM::PipelineManager::feBoundaryRhs
boost::shared_ptr< FEMethod > feBoundaryRhs
Element to assemble RHS side by integrating boundary.
Definition: PipelineManager.hpp:296
MoFEM::PipelineManager::feDomainLhs
boost::shared_ptr< FEMethod > feDomainLhs
Element to assemble LHS side by integrating domain.
Definition: PipelineManager.hpp:294
MoFEM::PipelineManager
PipelineManager interface.
Definition: PipelineManager.hpp:24
MoFEM::PipelineManager::createBoundaryFEPipeline
boost::shared_ptr< FEMethod > & createBoundaryFEPipeline(boost::shared_ptr< FEMethod > &fe)
Definition: PipelineManager.hpp:371
MoFEM::PipelineManager::createTS2
DEPRECATED auto createTS2(SmartPetscObj< DM > dm=nullptr)
Definition: PipelineManager.hpp:275
MoFEM::PipelineManager::getBoundaryRhsFE
boost::shared_ptr< FEMethod > & getBoundaryRhsFE()
Definition: PipelineManager.hpp:413
MoFEM::PipelineManager::createTSIM
SmartPetscObj< TS > createTSIM(SmartPetscObj< DM > dm=nullptr)
Create TS (time) implicit solver.
Definition: PipelineManager.cpp:244
MoFEM::Simple
Simple interface for fast problem set-up.
Definition: Simple.hpp:27
THROW_MESSAGE
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
Definition: definitions.h:574
MoFEM::PipelineManager::TSType
TSType
Definition: PipelineManager.hpp:227
MoFEM::PipelineManager::getDomainExplicitRhsFE
boost::shared_ptr< FEMethod > & getDomainExplicitRhsFE()
Definition: PipelineManager.hpp:425
MoFEM::PipelineManager::getCastSkeletonRhsFE
auto getCastSkeletonRhsFE()
Definition: PipelineManager.hpp:479
MoFEM::PipelineManager::getOpBoundaryLhsPipeline
boost::ptr_deque< UserDataOperator > & getOpBoundaryLhsPipeline()
Get the Op Boundary Lhs Pipeline object.
Definition: PipelineManager.hpp:797
MoFEM::PipelineManager::EdgeEle
MoFEM::EdgeElementForcesAndSourcesCore EdgeEle
Definition: PipelineManager.hpp:36
MoFEM::PipelineManager::getCastDomainExplicitRhsFE
auto getCastDomainExplicitRhsFE()
Definition: PipelineManager.hpp:485
MoFEM::PipelineManager::feBoundaryLhs
boost::shared_ptr< FEMethod > feBoundaryLhs
Element to assemble LHS side by integrating boundary.
Definition: PipelineManager.hpp:298
MoFEM::PipelineManager::getCastBoundaryLhsFE
auto getCastBoundaryLhsFE()
Definition: PipelineManager.hpp:462
MoFEM::PipelineManager::getSkeletonRhsFE
boost::shared_ptr< FEMethod > & getSkeletonRhsFE()
Definition: PipelineManager.hpp:421
MoFEM::PipelineManager::RuleHookFun
MoFEM::ForcesAndSourcesCore::RuleHookFun RuleHookFun
Definition: PipelineManager.hpp:32
MoFEM::PipelineManager::setSkeletonLhsIntegrationRule
MoFEMErrorCode setSkeletonLhsIntegrationRule(RuleHookFun rule)
Definition: PipelineManager.hpp:611
MoFEM
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
MoFEM::PipelineManager::feDomainRhs
boost::shared_ptr< FEMethod > feDomainRhs
Element to assemble RHS side by integrating domain.
Definition: PipelineManager.hpp:292
MoFEM::PipelineManager::cOre
MoFEM::Core & cOre
Definition: PipelineManager.hpp:289
MoFEM::ForcesAndSourcesCore::UserDataOperator
Definition: ForcesAndSourcesCore.hpp:549
MoFEM::PipelineManager::IM
@ IM
Definition: PipelineManager.hpp:227
convert.type
type
Definition: convert.py:64
MoFEM::PipelineManager::FaceEle
MoFEM::FaceElementForcesAndSourcesCore FaceEle
Definition: PipelineManager.hpp:35
MoFEM::PipelineManager::createKSP
SmartPetscObj< KSP > createKSP(SmartPetscObj< DM > dm=nullptr)
Create KSP (linear) solver.
Definition: PipelineManager.cpp:49
MoFEM::FaceElementForcesAndSourcesCoreOnChildParent
Base face element used to integrate on skeleton.
Definition: FaceElementForcesAndSourcesCoreOnParent.hpp:19
UnknownInterface.hpp
MoFEM interface.
MoFEM::FaceElementForcesAndSourcesCore
Face finite element.
Definition: FaceElementForcesAndSourcesCore.hpp:23
MoFEM::PipelineManager::getOpBoundaryExplicitRhsPipeline
boost::ptr_deque< UserDataOperator > & getOpBoundaryExplicitRhsPipeline()
Get the Op Bondary Rhs Pipeline object for implicit-explicit G term.
Definition: PipelineManager.hpp:917
MoFEM::PipelineManager::feBoundaryExplicitRhs
boost::shared_ptr< FEMethod > feBoundaryExplicitRhs
Definition: PipelineManager.hpp:307
MoFEM::PipelineManager::getCastSkeletonLhsFE
auto getCastSkeletonLhsFE()
Definition: PipelineManager.hpp:474
MoFEM::PipelineManager::PipelineManager
PipelineManager(const MoFEM::Core &core)
Definition: PipelineManager.cpp:16
MoFEM::PipelineManager::setBoundaryLhsIntegrationRule
MoFEMErrorCode setBoundaryLhsIntegrationRule(RuleHookFun rule)
Definition: PipelineManager.hpp:557
MoFEM::PipelineManager::setDomainRhsIntegrationRule
MoFEMErrorCode setDomainRhsIntegrationRule(RuleHookFun rule)
Definition: PipelineManager.hpp:530
MoFEM::PipelineManager::getCastBoundaryRhsFE
auto getCastBoundaryRhsFE()
Definition: PipelineManager.hpp:468
MoFEM::PipelineManager::getOpDomainLhsPipeline
boost::ptr_deque< UserDataOperator > & getOpDomainLhsPipeline()
Get the Op Domain Lhs Pipeline object.
Definition: PipelineManager.hpp:749
MoFEM::ForcesAndSourcesCore::UserDataOperator
friend class UserDataOperator
Definition: ForcesAndSourcesCore.hpp:482
MoFEM::VolumeElementForcesAndSourcesCore
Volume finite element base.
Definition: VolumeElementForcesAndSourcesCore.hpp:26
MoFEM::PipelineManager::feSkeletonLhs
boost::shared_ptr< FEMethod > feSkeletonLhs
Element to assemble LHS side by integrating skeleton.
Definition: PipelineManager.hpp:302
MoFEM::PipelineManager::setSkeletonExplicitRhsIntegrationRule
MoFEMErrorCode setSkeletonExplicitRhsIntegrationRule(RuleHookFun rule)
Definition: PipelineManager.hpp:720
MoFEM::PipelineManager::setDomainLhsIntegrationRule
MoFEMErrorCode setDomainLhsIntegrationRule(RuleHookFun rule)
Definition: PipelineManager.hpp:503
MoFEM::PipelineManager::getOpSkeletonLhsPipeline
boost::ptr_deque< UserDataOperator > & getOpSkeletonLhsPipeline()
Get the Op Skeleton Lhs Pipeline object.
Definition: PipelineManager.hpp:845
MoFEM::PipelineManager::query_interface
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Definition: PipelineManager.cpp:10
MoFEM::UnknownInterface
base class for all interface classes
Definition: UnknownInterface.hpp:34
MoFEM::PipelineManager::createTSEX
SmartPetscObj< TS > createTSEX(SmartPetscObj< DM > dm=nullptr)
Create TS (time) explit solver.
Definition: PipelineManager.cpp:192
MoFEM::ForcesAndSourcesCore
structure to get information form mofem into EntitiesFieldData
Definition: ForcesAndSourcesCore.hpp:22
MoFEM::PipelineManager::VolEle
MoFEM::VolumeElementForcesAndSourcesCore VolEle
Definition: PipelineManager.hpp:34
MoFEM::PipelineManager::getDomainLhsFE
boost::shared_ptr< FEMethod > & getDomainLhsFE()
Definition: PipelineManager.hpp:401
MoFEM::PipelineManager::getOpDomainExplicitRhsPipeline
boost::ptr_deque< UserDataOperator > & getOpDomainExplicitRhsPipeline()
Get the Op Domain Rhs Pipeline object for implicit-explicit G term.
Definition: PipelineManager.hpp:893
MoFEM::EdgeElementForcesAndSourcesCoreOnChildParent
Base face element used to integrate on skeleton.
Definition: EdgeElementForcesAndSourcesCoreOnParent.hpp:19
MoFEM::PipelineManager::getCastSkeletonExplicitRhsFE
auto getCastSkeletonExplicitRhsFE()
Definition: PipelineManager.hpp:497
MoFEM::PipelineManager::setDomainExplicitRhsIntegrationRule
MoFEMErrorCode setDomainExplicitRhsIntegrationRule(RuleHookFun rule)
Definition: PipelineManager.hpp:665
MoFEM::PipelineManager::createTSIMEX
SmartPetscObj< TS > createTSIMEX(SmartPetscObj< DM > dm=nullptr)
Create TS (time) implicit-explicit solver.
Definition: PipelineManager.cpp:366
MoFEM::PipelineManager::createTS
DEPRECATED auto createTS(SmartPetscObj< DM > dm=nullptr)
Definition: PipelineManager.hpp:259
MoFEM::PipelineManager::getOpSkeletonExplicitRhsPipeline
boost::ptr_deque< UserDataOperator > & getOpSkeletonExplicitRhsPipeline()
Get the Op Skeleton Rhs Pipeline object for implicit-explicit G term.
Definition: PipelineManager.hpp:941
MoFEM::Simple::getDim
int getDim() const
Get the problem dimension.
Definition: Simple.hpp:312
MoFEM::PipelineManager::feDomainExplicitRhs
boost::shared_ptr< FEMethod > feDomainExplicitRhs
Element to assemble explict Rhs for IMEX solver.
Definition: PipelineManager.hpp:305
MoFEM::PipelineManager::getOpBoundaryRhsPipeline
boost::ptr_deque< UserDataOperator > & getOpBoundaryRhsPipeline()
Get the Op Boundary Rhs Pipeline object.
Definition: PipelineManager.hpp:821
MoFEM::PipelineManager::getSkeletonLhsFE
boost::shared_ptr< FEMethod > & getSkeletonLhsFE()
Definition: PipelineManager.hpp:417
MoFEM::PipelineManager::setBoundaryRhsIntegrationRule
MoFEMErrorCode setBoundaryRhsIntegrationRule(RuleHookFun rule)
Definition: PipelineManager.hpp:584
MoFEM::PipelineManager::IM2
@ IM2
Definition: PipelineManager.hpp:227
MoFEM::VolumeElementForcesAndSourcesCoreOnSide
Base volume element used to integrate on skeleton.
Definition: VolumeElementForcesAndSourcesCoreOnSide.hpp:22
MoFEM::PipelineManager::createTS
SmartPetscObj< TS > createTS(const TSType type, SmartPetscObj< DM > dm=nullptr)
create TS (time) solver
Definition: PipelineManager.cpp:169
MoFEM::SmartPetscObj< DM >
MoFEM::PipelineManager::feSkeletonRhs
boost::shared_ptr< FEMethod > feSkeletonRhs
Element to assemble RHS side by integrating skeleton.
Definition: PipelineManager.hpp:300
MoFEM::PipelineManager::createTSIM2
SmartPetscObj< TS > createTSIM2(SmartPetscObj< DM > dm=nullptr)
Create TS (time) solver for second order equation in time.
Definition: PipelineManager.cpp:305
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEM::PipelineManager::setSkeletonRhsIntegrationRule
MoFEMErrorCode setSkeletonRhsIntegrationRule(RuleHookFun rule)
Definition: PipelineManager.hpp:638
MoFEM::PipelineManager::setBoundaryExplicitRhsIntegrationRule
MoFEMErrorCode setBoundaryExplicitRhsIntegrationRule(RuleHookFun rule)
Definition: PipelineManager.hpp:692
MoFEM::ForcesAndSourcesCore::RuleHookFun
boost::function< int(int order_row, int order_col, int order_data)> RuleHookFun
Definition: ForcesAndSourcesCore.hpp:28
MoFEM::FaceElementForcesAndSourcesCoreOnSide
Base face element used to integrate on skeleton.
Definition: FaceElementForcesAndSourcesCoreOnSide.hpp:19
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
MoFEM::PipelineManager::IMEX
@ IMEX
Definition: PipelineManager.hpp:227
MoFEM::PipelineManager::feSkeletonExplicitRhs
boost::shared_ptr< FEMethod > feSkeletonExplicitRhs
Definition: PipelineManager.hpp:310
MoFEM::PipelineManager::createDomainFEPipeline
boost::shared_ptr< FEMethod > & createDomainFEPipeline(boost::shared_ptr< FEMethod > &fe)
Definition: PipelineManager.hpp:324