v0.13.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 /* MoFEM is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16  * License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>
20  */
21 
22 #ifndef __BASIC_HPP__
23 #define __BASIC_HPP__
24 
25 #include "UnknownInterface.hpp"
26 
27 namespace MoFEM {
28 
29 /**
30  * \brief PipelineManager interface
31  * \ingroup mofem_basic_interface
32  */
34 
35  MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
36  UnknownInterface **iface) const;
37 
38  PipelineManager(const MoFEM::Core &core);
39 
42 
46 
47  inline boost::shared_ptr<FEMethod> &getDomainLhsFE();
48 
49  inline boost::shared_ptr<FEMethod> &getDomainRhsFE();
50 
51  inline boost::shared_ptr<FEMethod> &getBoundaryLhsFE();
52 
53  inline boost::shared_ptr<FEMethod> &getBoundaryRhsFE();
54 
55  inline boost::shared_ptr<FEMethod> &getSkeletonLhsFE();
56 
57  inline boost::shared_ptr<FEMethod> &getSkeletonRhsFE();
58 
59  inline boost::shared_ptr<FEMethod> &getDomainExplicitRhsFE();
60 
61  inline boost::shared_ptr<FEMethod> &getBoundaryExplicitRhsFE();
62 
63  inline boost::shared_ptr<FEMethod> &getSkeletonExplicitRhsFE();
64 
65  template <int DIM = -1>
67 
68  template <int DIM = -1>
70 
71  template <int DIM = -1>
73 
74  template <int DIM = -1>
76 
77  template <int DIM = -1>
79 
80  template <int DIM = -1>
82 
83  template <int DIM = -1>
85 
86  template <int DIM = -1>
88 
89  template <int DIM = -1>
91 
92  /**
93  * @brief Get the Op Domain Lhs Pipeline object
94  * @ingroup mofem_basic_interface
95  *
96  * @tparam -1
97  * @return boost::ptr_vector<UserDataOperator>&
98  */
99  template <int DIM = -1>
100  inline boost::ptr_vector<UserDataOperator> &getOpDomainLhsPipeline();
101 
102  /**
103  * @brief Get the Op Domain Rhs Pipeline object
104  * @ingroup mofem_basic_interface
105  *
106  * @tparam -1
107  * @return boost::ptr_vector<UserDataOperator>&
108  */
109  template <int DIM = -1>
110  inline boost::ptr_vector<UserDataOperator> &getOpDomainRhsPipeline();
111 
112  /**
113  * @brief Get the Op Boundary Lhs Pipeline object
114  * @ingroup mofem_basic_interface
115  *
116  * @tparam -1
117  * @return boost::ptr_vector<UserDataOperator>&
118  */
119  template <int DIM = -1>
120  inline boost::ptr_vector<UserDataOperator> &getOpBoundaryLhsPipeline();
121 
122  /**
123  * @brief Get the Op Boundary Rhs Pipeline object
124  * @ingroup mofem_basic_interface
125  *
126  * @tparam -1
127  * @return boost::ptr_vector<UserDataOperator>&
128  */
129  template <int DIM = -1>
130  inline boost::ptr_vector<UserDataOperator> &getOpBoundaryRhsPipeline();
131 
132  /**
133  * @brief Get the Op Skeleton Lhs Pipeline object
134  * @ingroup mofem_basic_interface
135  *
136  * @return boost::ptr_vector<UserDataOperator>&
137  */
138  template <int DIM = -1>
139  inline boost::ptr_vector<UserDataOperator> &getOpSkeletonLhsPipeline();
140 
141  /**
142  * @brief Get the Op Skeleton Rhs Pipeline object
143  * @ingroup mofem_basic_interface
144  *
145  * @tparam -1
146  * @return boost::ptr_vector<UserDataOperator>&
147  */
148  template <int DIM = -1>
149  inline boost::ptr_vector<UserDataOperator> &getOpSkeletonRhsPipeline();
150 
151  /**
152  * @brief Get the Op Domain Rhs Pipeline object for implicit-explicit G term
153  * @ingroup mofem_basic_interface
154  *
155  * @tparam -1
156  * @return boost::ptr_vector<UserDataOperator>&
157  */
158  template <int DIM = -1>
159  inline boost::ptr_vector<UserDataOperator> &getOpDomainExplicitRhsPipeline();
160 
161  /**
162  * @brief Get the Op Bondary Rhs Pipeline object for implicit-explicit G term
163  * @ingroup mofem_basic_interface
164  *
165  * @tparam -1
166  * @return boost::ptr_vector<UserDataOperator>&
167  */
168  template <int DIM = -1>
169  inline boost::ptr_vector<UserDataOperator> &
171 
172  /**
173  * @brief Get the Op Skeleton Rhs Pipeline object for implicit-explicit G term
174  * @ingroup mofem_basic_interface
175  *
176  * @tparam -1
177  * @return boost::ptr_vector<UserDataOperator>&
178  */
179  template <int DIM = -1>
180  inline boost::ptr_vector<UserDataOperator> &
182 
183  /**
184  * @brief Iterate finite elements
185  * @ingroup mofem_basic_interface
186  *
187  * @return MoFEMErrorCode
188  */
190 
191  /**
192  * @brief Create KSP (linear) solver
193  * @ingroup mofem_basic_interface
194  *
195  * @param dm
196  * @return SmartPetscObj<KSP>
197  */
199 
200  /**
201  * @brief Create SNES (nonlinear) solver
202  * @ingroup mofem_basic_interface
203  *
204  * @param dm
205  * @return SmartPetscObj<SNES>
206  */
208 
209  enum TSType { EX, IM, IM2, IMEX };
210 
211  /**
212  * @brief create TS (time) solver
213  *
214  * @param type Type of time solver PipelineManager:EX/IM/IM2/IMEX
215  * @param dm
216  * @return SmartPetscObj<TS>
217  */
219 
220  /**
221  * @brief Create TS (time) explit solver
222  * @ingroup mofem_basic_interface
223  *
224  * @param dm
225  * @return SmartPetscObj<TS>
226  */
228 
229  /**
230  * @brief Create TS (time) implicit solver
231  * @ingroup mofem_basic_interface
232  *
233  * @param dm
234  * @return SmartPetscObj<TS>
235  */
237 
238  /**
239  * @deprecated Use version with explicit TS solver type
240  */
241  DEPRECATED auto createTS(SmartPetscObj<DM> dm = nullptr) {
242  return createTSIM(dm);
243  }
244 
245  /**
246  * @brief Create TS (time) solver for second order equation in time
247  * @ingroup mofem_basic_interface
248  *
249  * @param dm
250  * @return SmartPetscObj<TS>
251  */
253 
254  /**
255  * @deprecated Change name. Use createTSIM2 instead.
256  */
257  inline DEPRECATED auto createTS2(SmartPetscObj<DM> dm = nullptr) {
258  return createTSIM2(dm);
259  }
260 
261  /**
262  * @brief Create TS (time) implicit-explicit solver
263  * @ingroup mofem_basic_interface
264  *
265  * @param dm
266  * @return SmartPetscObj<TS>
267  */
269 
270 private:
272 
273  boost::shared_ptr<FEMethod>
274  feDomainRhs; ///< Element to assemble RHS side by integrating domain
275  boost::shared_ptr<FEMethod>
276  feDomainLhs; ///< Element to assemble LHS side by integrating domain
277  boost::shared_ptr<FEMethod>
278  feBoundaryRhs; ///< Element to assemble RHS side by integrating boundary
279  boost::shared_ptr<FEMethod>
280  feBoundaryLhs; ///< Element to assemble LHS side by integrating boundary
281  boost::shared_ptr<FEMethod>
282  feSkeletonRhs; ///< Element to assemble RHS side by integrating skeleton
283  boost::shared_ptr<FEMethod>
284  feSkeletonLhs; ///< Element to assemble LHS side by integrating skeleton
285 
286  boost::shared_ptr<FEMethod>
287  feDomainExplicitRhs; ///< Element to assemble explict Rhs for IMEX solver
288  boost::shared_ptr<FEMethod>
289  feBoundaryExplicitRhs; ///< Element to assemble explict Rhs for IMEX
290  ///< solver
291  boost::shared_ptr<FEMethod>
292  feSkeletonExplicitRhs; ///< Element to assemble explict Rhs for IMEX
293  ///< solver
294 
295  template <int DIM>
296  inline boost::shared_ptr<FEMethod> &
297  createDomainFEPipeline(boost::shared_ptr<FEMethod> &fe);
298 
299  template <int DIM>
300  inline boost::shared_ptr<FEMethod> &
301  createBoundaryFEPipeline(boost::shared_ptr<FEMethod> &fe);
302 };
303 
304 template <int DIM>
305 boost::shared_ptr<FEMethod> &
306 PipelineManager::createDomainFEPipeline(boost::shared_ptr<FEMethod> &fe) {
307  static_assert(DIM == 1 || DIM == 2 || DIM == 3, "not implemented");
308  fe = boost::make_shared<FEMethod>();
309  return fe;
310 }
311 
312 template <>
313 inline boost::shared_ptr<FEMethod> &
314 PipelineManager::createDomainFEPipeline<3>(boost::shared_ptr<FEMethod> &fe) {
315  if (!fe)
316  fe = boost::make_shared<VolEle>(cOre);
317  return fe;
318 }
319 
320 template <>
321 inline boost::shared_ptr<FEMethod> &
322 PipelineManager::createDomainFEPipeline<2>(boost::shared_ptr<FEMethod> &fe) {
323  if (!fe)
324  fe = boost::make_shared<FaceEle>(cOre);
325  return fe;
326 }
327 
328 template <>
329 inline boost::shared_ptr<FEMethod> &
330 PipelineManager::createDomainFEPipeline<1>(boost::shared_ptr<FEMethod> &fe) {
331  if (!fe)
332  fe = boost::make_shared<EdgeEle>(cOre);
333  return fe;
334 }
335 
336 template <int DIM>
337 boost::shared_ptr<FEMethod> &
338 PipelineManager::createBoundaryFEPipeline(boost::shared_ptr<FEMethod> &fe) {
339  static_assert(DIM == 1 || DIM == 2 || DIM == 3, "not implemented");
340  fe = boost::make_shared<FEMethod>();
341  return fe;
342 }
343 
344 template <>
345 inline boost::shared_ptr<FEMethod> &
346 PipelineManager::createBoundaryFEPipeline<3>(boost::shared_ptr<FEMethod> &fe) {
347  if (!fe)
348  fe = boost::make_shared<FaceElementForcesAndSourcesCore>(cOre);
349  return fe;
350 }
351 
352 template <>
353 inline boost::shared_ptr<FEMethod> &
354 PipelineManager::createBoundaryFEPipeline<2>(boost::shared_ptr<FEMethod> &fe) {
355  if (!fe)
356  fe = boost::make_shared<EdgeEle>(cOre);
357  return fe;
358 }
359 
360 template <>
361 inline boost::shared_ptr<FEMethod> &
362 PipelineManager::createBoundaryFEPipeline<1>(boost::shared_ptr<FEMethod> &fe) {
363  if (!fe)
364  fe = boost::make_shared<VertexElementForcesAndSourcesCore>(cOre);
365  return fe;
366 }
367 
368 boost::shared_ptr<FEMethod> &PipelineManager::getDomainLhsFE() {
369  return feDomainLhs;
370 }
371 
372 boost::shared_ptr<FEMethod> &PipelineManager::getDomainRhsFE() {
373  return feDomainRhs;
374 }
375 
376 boost::shared_ptr<FEMethod> &PipelineManager::getBoundaryLhsFE() {
377  return feBoundaryLhs;
378 }
379 
380 boost::shared_ptr<FEMethod> &PipelineManager::getBoundaryRhsFE() {
381  return feBoundaryRhs;
382 }
383 
384 boost::shared_ptr<FEMethod> &PipelineManager::getSkeletonLhsFE() {
385  return feSkeletonLhs;
386 }
387 
388 boost::shared_ptr<FEMethod> &PipelineManager::getSkeletonRhsFE() {
389  return feSkeletonRhs;
390 }
391 
392 boost::shared_ptr<FEMethod> &PipelineManager::getDomainExplicitRhsFE() {
393  return feDomainExplicitRhs;
394 }
395 
396 boost::shared_ptr<FEMethod> &PipelineManager::getBoundaryExplicitRhsFE() {
397  return feBoundaryExplicitRhs;
398 }
399 
400 boost::shared_ptr<FEMethod> &PipelineManager::getSkeletonExplicitRhsFE() {
401  return feSkeletonExplicitRhs;
402 }
403 
404 template <int DIM>
408  boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
409  createDomainFEPipeline<DIM>(feDomainLhs))
410  ->getRuleHook = rule;
412 }
413 
414 template <>
418  switch (cOre.getInterface<Simple>()->getDim()) {
419  case 1:
420  return setDomainLhsIntegrationRule<1>(rule);
421  case 2:
422  return setDomainLhsIntegrationRule<2>(rule);
423  case 3:
424  return setDomainLhsIntegrationRule<3>(rule);
425  default:
426  THROW_MESSAGE("Not implemented");
427  }
429 }
430 
431 template <int DIM>
435  boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
436  createDomainFEPipeline<DIM>(feDomainRhs))
437  ->getRuleHook = rule;
439 }
440 
441 template <>
445  switch (cOre.getInterface<Simple>()->getDim()) {
446  case 1:
447  return setDomainRhsIntegrationRule<1>(rule);
448  case 2:
449  return setDomainRhsIntegrationRule<2>(rule);
450  case 3:
451  return setDomainRhsIntegrationRule<3>(rule);
452  default:
453  THROW_MESSAGE("Not implemented");
454  }
456 }
457 
458 template <int DIM>
462  boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
463  createBoundaryFEPipeline<DIM>(feBoundaryLhs))
464  ->getRuleHook = rule;
466 }
467 
468 template <>
472  switch (cOre.getInterface<Simple>()->getDim()) {
473  case 1:
474  return setBoundaryLhsIntegrationRule<1>(rule);
475  case 2:
476  return setBoundaryLhsIntegrationRule<2>(rule);
477  case 3:
478  return setBoundaryLhsIntegrationRule<3>(rule);
479  default:
480  THROW_MESSAGE("Not implemented");
481  }
483 }
484 
485 template <int DIM>
489  boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
490  createBoundaryFEPipeline<DIM>(feBoundaryRhs))
491  ->getRuleHook = rule;
493 }
494 
495 template <>
499  switch (cOre.getInterface<Simple>()->getDim()) {
500  case 1:
501  return setBoundaryRhsIntegrationRule<1>(rule);
502  case 2:
503  return setBoundaryRhsIntegrationRule<2>(rule);
504  case 3:
505  return setBoundaryRhsIntegrationRule<3>(rule);
506  default:
507  THROW_MESSAGE("Not implemented");
508  }
510 }
511 
512 template <int DIM>
516  boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
517  createBoundaryFEPipeline<DIM>(feSkeletonLhs))
518  ->getRuleHook = rule;
520 }
521 
522 template <>
526  switch (cOre.getInterface<Simple>()->getDim()) {
527  case 1:
528  return setSkeletonLhsIntegrationRule<1>(rule);
529  case 2:
530  return setSkeletonLhsIntegrationRule<2>(rule);
531  case 3:
532  return setSkeletonLhsIntegrationRule<3>(rule);
533  default:
534  THROW_MESSAGE("Not implemented");
535  }
537 }
538 
539 template <int DIM>
543  boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
544  createBoundaryFEPipeline<DIM>(feSkeletonRhs))
545  ->getRuleHook = rule;
547 }
548 
549 template <>
553  switch (cOre.getInterface<Simple>()->getDim()) {
554  case 1:
555  return setSkeletonRhsIntegrationRule<1>(rule);
556  case 2:
557  return setSkeletonRhsIntegrationRule<2>(rule);
558  case 3:
559  return setSkeletonRhsIntegrationRule<3>(rule);
560  default:
561  THROW_MESSAGE("Not implemented");
562  }
564 }
565 
566 template <int DIM>
570  boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
571  createDomainFEPipeline<DIM>(feDomainExplicitRhs))
572  ->getRuleHook = rule;
574 }
575 
576 template <>
580  switch (cOre.getInterface<Simple>()->getDim()) {
581  case 1:
582  return setDomainExplicitRhsIntegrationRule<1>(rule);
583  case 2:
584  return setDomainExplicitRhsIntegrationRule<2>(rule);
585  case 3:
586  return setDomainExplicitRhsIntegrationRule<3>(rule);
587  default:
588  THROW_MESSAGE("Not implemented");
589  }
591 }
592 
593 template <int DIM>
597  boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
598  createBoundaryFEPipeline<DIM>(feBoundaryExplicitRhs))
599  ->getRuleHook = rule;
601 }
602 
603 template <>
608  switch (cOre.getInterface<Simple>()->getDim()) {
609  case 1:
610  return setBoundaryExplicitRhsIntegrationRule<1>(rule);
611  case 2:
612  return setBoundaryExplicitRhsIntegrationRule<2>(rule);
613  case 3:
614  return setBoundaryExplicitRhsIntegrationRule<3>(rule);
615  default:
616  THROW_MESSAGE("Not implemented");
617  }
619 }
620 
621 template <int DIM>
625  boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
626  createBoundaryFEPipeline<DIM>(feSkeletonExplicitRhs))
627  ->getRuleHook = rule;
629 }
630 
631 template <>
636  switch (cOre.getInterface<Simple>()->getDim()) {
637  case 1:
638  return setSkeletonExplicitRhsIntegrationRule<1>(rule);
639  case 2:
640  return setSkeletonExplicitRhsIntegrationRule<2>(rule);
641  case 3:
642  return setSkeletonExplicitRhsIntegrationRule<3>(rule);
643  default:
644  THROW_MESSAGE("Not implemented");
645  }
647 }
648 
649 template <int DIM>
650 boost::ptr_vector<PipelineManager::UserDataOperator> &
652  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
653  createDomainFEPipeline<DIM>(feDomainLhs))
654  ->getOpPtrVector();
655 }
656 
657 template <>
658 inline boost::ptr_vector<PipelineManager::UserDataOperator> &
660  switch (cOre.getInterface<Simple>()->getDim()) {
661  case 1:
662  return getOpDomainLhsPipeline<1>();
663  case 2:
664  return getOpDomainLhsPipeline<2>();
665  case 3:
666  break;
667  default:
668  THROW_MESSAGE("Not implemented");
669  }
670  return getOpDomainLhsPipeline<3>();
671 }
672 
673 template <int DIM>
674 boost::ptr_vector<PipelineManager::UserDataOperator> &
676  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
677  createDomainFEPipeline<DIM>(feDomainRhs))
678  ->getOpPtrVector();
679 }
680 
681 template <>
682 inline boost::ptr_vector<PipelineManager::UserDataOperator> &
684  switch (cOre.getInterface<Simple>()->getDim()) {
685  case 1:
686  return getOpDomainRhsPipeline<1>();
687  case 2:
688  return getOpDomainRhsPipeline<2>();
689  case 3:
690  break;
691  default:
692  THROW_MESSAGE("Not implemented");
693  }
694  return getOpDomainRhsPipeline<3>();
695 }
696 
697 template <int DIM>
698 boost::ptr_vector<PipelineManager::UserDataOperator> &
700  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
701  createBoundaryFEPipeline<DIM>(feBoundaryLhs))
702  ->getOpPtrVector();
703 }
704 
705 template <>
706 inline boost::ptr_vector<PipelineManager::UserDataOperator> &
708  switch (cOre.getInterface<Simple>()->getDim()) {
709  case 1:
710  return getOpBoundaryLhsPipeline<1>();
711  case 2:
712  return getOpBoundaryLhsPipeline<2>();
713  case 3:
714  break;
715  default:
716  THROW_MESSAGE("Not implemented");
717  }
718  return getOpBoundaryLhsPipeline<3>();
719 }
720 
721 template <int DIM>
722 boost::ptr_vector<PipelineManager::UserDataOperator> &
724  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
725  createBoundaryFEPipeline<DIM>(feBoundaryRhs))
726  ->getOpPtrVector();
727 }
728 
729 template <>
730 inline boost::ptr_vector<PipelineManager::UserDataOperator> &
732  switch (cOre.getInterface<Simple>()->getDim()) {
733  case 1:
734  return getOpBoundaryRhsPipeline<1>();
735  case 2:
736  return getOpBoundaryRhsPipeline<2>();
737  case 3:
738  break;
739  default:
740  THROW_MESSAGE("Not implemented");
741  }
742  return getOpBoundaryRhsPipeline<3>();
743 }
744 
745 template <int DIM>
746 boost::ptr_vector<PipelineManager::UserDataOperator> &
748  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
749  createBoundaryFEPipeline<DIM>(feSkeletonLhs))
750  ->getOpPtrVector();
751 }
752 
753 template <>
754 inline boost::ptr_vector<PipelineManager::UserDataOperator> &
756  switch (cOre.getInterface<Simple>()->getDim()) {
757  case 1:
758  return getOpSkeletonLhsPipeline<1>();
759  case 2:
760  return getOpSkeletonLhsPipeline<2>();
761  case 3:
762  break;
763  default:
764  THROW_MESSAGE("Not implemented");
765  }
766  return getOpSkeletonLhsPipeline<3>();
767 }
768 
769 template <int DIM>
770 boost::ptr_vector<PipelineManager::UserDataOperator> &
772  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
773  createBoundaryFEPipeline<DIM>(feSkeletonRhs))
774  ->getOpPtrVector();
775 }
776 
777 template <>
778 inline boost::ptr_vector<PipelineManager::UserDataOperator> &
780  switch (cOre.getInterface<Simple>()->getDim()) {
781  case 1:
782  return getOpSkeletonRhsPipeline<1>();
783  case 2:
784  return getOpSkeletonRhsPipeline<2>();
785  case 3:
786  break;
787  default:
788  THROW_MESSAGE("Not implemented");
789  }
790  return getOpSkeletonRhsPipeline<3>();
791 }
792 
793 template <int DIM>
794 boost::ptr_vector<PipelineManager::UserDataOperator> &
796  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
797  createDomainFEPipeline<DIM>(feDomainExplicitRhs))
798  ->getOpPtrVector();
799 }
800 
801 template <>
802 inline boost::ptr_vector<PipelineManager::UserDataOperator> &
804  switch (cOre.getInterface<Simple>()->getDim()) {
805  case 1:
806  return getOpDomainExplicitRhsPipeline<1>();
807  case 2:
808  return getOpDomainExplicitRhsPipeline<2>();
809  case 3:
810  break;
811  default:
812  THROW_MESSAGE("Not implemented");
813  }
814  return getOpDomainExplicitRhsPipeline<3>();
815 }
816 
817 template <int DIM>
818 boost::ptr_vector<PipelineManager::UserDataOperator> &
820  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
821  createBoundaryFEPipeline<DIM>(feSkeletonExplicitRhs))
822  ->getOpPtrVector();
823 }
824 
825 template <>
826 inline boost::ptr_vector<PipelineManager::UserDataOperator> &
828  switch (cOre.getInterface<Simple>()->getDim()) {
829  case 1:
830  return getOpBoundaryExplicitRhsPipeline<1>();
831  case 2:
832  return getOpBoundaryExplicitRhsPipeline<2>();
833  case 3:
834  break;
835  default:
836  THROW_MESSAGE("Not implemented");
837  }
838  return getOpBoundaryExplicitRhsPipeline<3>();
839 }
840 
841 template <int DIM>
842 boost::ptr_vector<PipelineManager::UserDataOperator> &
844  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
845  createBoundaryFEPipeline<DIM>(feSkeletonExplicitRhs))
846  ->getOpPtrVector();
847 }
848 
849 template <>
850 inline boost::ptr_vector<PipelineManager::UserDataOperator> &
852  switch (cOre.getInterface<Simple>()->getDim()) {
853  case 1:
854  return getOpSkeletonExplicitRhsPipeline<1>();
855  case 2:
856  return getOpSkeletonExplicitRhsPipeline<2>();
857  case 3:
858  break;
859  default:
860  THROW_MESSAGE("Not implemented");
861  }
862  return getOpSkeletonExplicitRhsPipeline<3>();
863 }
864 
865 } // namespace MoFEM
866 
867 #endif // __BASIC_HPP__
868 
869 /**
870  * \defgroup mofem_basic_interface PipelineManager interface
871  * \brief Implementation of basic interface for rapid problem implementation.
872  *
873  * \ingroup mofem
874  **/
MoFEM interface.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
#define DEPRECATED
Definition: definitions.h:30
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
Definition: definitions.h:574
boost::ptr_vector< UserDataOperator > & getOpSkeletonExplicitRhsPipeline()
Get the Op Skeleton Rhs Pipeline object for implicit-explicit G term.
MoFEMErrorCode loopFiniteElements(SmartPetscObj< DM > dm=nullptr)
Iterate finite elements.
SmartPetscObj< SNES > createSNES(SmartPetscObj< DM > dm=nullptr)
Create SNES (nonlinear) solver.
boost::ptr_vector< UserDataOperator > & getOpDomainExplicitRhsPipeline()
Get the Op Domain Rhs Pipeline object for implicit-explicit G term.
boost::ptr_vector< UserDataOperator > & getOpDomainLhsPipeline()
Get the Op Domain Lhs Pipeline object.
boost::ptr_vector< UserDataOperator > & getOpBoundaryExplicitRhsPipeline()
Get the Op Bondary Rhs Pipeline object for implicit-explicit G term.
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_vector< UserDataOperator > & getOpBoundaryLhsPipeline()
Get the Op Boundary Lhs Pipeline object.
SmartPetscObj< KSP > createKSP(SmartPetscObj< DM > dm=nullptr)
Create KSP (linear) solver.
boost::ptr_vector< UserDataOperator > & getOpSkeletonRhsPipeline()
Get the Op Skeleton Rhs Pipeline object.
boost::ptr_vector< UserDataOperator > & getOpBoundaryRhsPipeline()
Get the Op Boundary Rhs Pipeline object.
SmartPetscObj< TS > createTSIMEX(SmartPetscObj< DM > dm=nullptr)
Create TS (time) implicit-explicit solver.
SmartPetscObj< TS > createTSEX(SmartPetscObj< DM > dm=nullptr)
Create TS (time) explit solver.
boost::ptr_vector< UserDataOperator > & getOpDomainRhsPipeline()
Get the Op Domain Rhs Pipeline object.
boost::ptr_vector< UserDataOperator > & getOpSkeletonLhsPipeline()
Get the Op Skeleton Lhs Pipeline object.
EdgeElementForcesAndSourcesCoreSwitch< 0 > EdgeElementForcesAndSourcesCore
Edge finite element default.
FaceElementForcesAndSourcesCoreSwitch< 0 > FaceElementForcesAndSourcesCore
Face finite element default.
VolumeElementForcesAndSourcesCoreSwitch< 0 > VolumeElementForcesAndSourcesCore
Volume finite element default.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:67
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:21
Core (interface) class.
Definition: Core.hpp:92
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)
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.
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)
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:33
int getDim() const
Get the problem dimension.
Definition: Simple.hpp:270
base class for all interface classes