FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
factory_wrapper.hpp
1// FEAT3: Finite Element Analysis Toolbox, Version 3
2// Copyright (C) 2010 by Stefan Turek & the FEAT group
3// FEAT3 is released under the GNU General Public License version 3,
4// see the file 'copyright.txt' in the top level directory for details.
5
6#pragma once
7
8// includes, FEAT
9#include <kernel/cubature/scalar/driver_factory.hpp>
10#include <kernel/cubature/scalar/gauss_legendre_driver.hpp>
11#include <kernel/cubature/scalar/gauss_lobatto_driver.hpp>
12#include <kernel/cubature/scalar/maclaurin_driver.hpp>
13#include <kernel/cubature/scalar/midpoint_driver.hpp>
14#include <kernel/cubature/scalar/newton_cotes_closed_driver.hpp>
15#include <kernel/cubature/scalar/newton_cotes_open_driver.hpp>
16#include <kernel/cubature/scalar/trapezoidal_driver.hpp>
17
18namespace FEAT
19{
20 namespace Cubature
21 {
22 namespace Scalar
23 {
30 {
31 protected:
32 template<typename Functor_>
33 static void _driver_list(Functor_& functor)
34 {
35 // >>> CUBATURE DRIVER LIST >>>
36 // TODO: add you new scalar cubature driver at the end of the list below, e.g.
37 // functor.template driver<YourDriverName>();
38 functor.template driver<GaussLegendreDriver>();
39 functor.template driver<GaussLobattoDriver>();
40 functor.template driver<MaclaurinDriver>();
41 functor.template driver<MidpointDriver>();
42 functor.template driver<NewtonCotesClosedDriver>();
43 functor.template driver<NewtonCotesOpenDriver>();
44 functor.template driver<TrapezoidalDriver>();
45
46 // <<< END OF CUBATURE DRIVER LIST <<<
47 }
48
49 template<typename Functor_>
50 static void _factory_list(Functor_& /*functor*/)
51 {
52 // >>> CUBATURE FACTORY LIST >>>
53 // TODO: add you new scalar cubature factory at the end of the list below, e.g.
54 // functor.template factory<YourFactoryName>();
55
56 // <<< END OF CUBATURE FACTORY LIST <<<
57 }
58
59 public:
60 template<typename Functor_>
61 static void driver(Functor_& functor)
62 {
63 // call driver list
64 _driver_list(functor);
65 }
66
67 template<typename Functor_>
68 static void factory(Functor_& functor)
69 {
70 // call factory list
71 _factory_list(functor);
72
73 // call driver factory functor
74 DriverFactoryFunctor<Functor_> driver_functor(functor);
75 driver(driver_functor);
76 }
77
79 private:
80 template<typename Functor_>
81 class DriverFactoryFunctor
82 {
83 protected:
84 Functor_& _functor;
85
86 public:
87 explicit DriverFactoryFunctor(Functor_& functor) :
88 _functor(functor)
89 {
90 }
91
92 template<typename Driver_>
93 void driver()
94 {
95 _functor.template factory< DriverFactory<Driver_> >();
96 }
97 };
99 };
100 } // namespace Scalar
101 } // namespace Cubature
102} // namespace FEAT
Scalar Cubature Factory Wrapper class template.
FEAT namespace.
Definition: adjactor.hpp:12