Geomi
Factory.hpp
1 #ifndef DEF_VARIATIONAL_FACTORY
2 #define DEF_VARIATIONAL_FACTORY
3 
4 namespace Variational {
5 
6 template <typename T_M,
7  typename T_Q,
8  typename T_PROBLEM,
9  typename T_TQ = T_Q>
10 class Factory
11 {
12 public:
13  static Abstract::Integrator&
14  createIntegrator (Abstract::Problem<T_M,T_Q>& problem, std::string s)
15  {
16  Abstract::Integrator* integrator = NULL;
17 
18  /*
19  if (s=="Implicit Euler") {
20  ImplicitEulerStep<T_M,T_Q,T_TQ>* step
21  = new ImplicitEulerStep<T_M,T_Q,T_TQ>(problem);
22  integrator = new Integrator<T_M,T_Q,T_TQ>(problem, *step);
23  }
24  else if (s=="Midpoint") {
25  MidpointStep<T_M,T_Q,T_TQ>* step
26  = new MidpointStep<T_M,T_Q,T_TQ>(problem);
27  integrator = new Integrator<T_M,T_Q,T_TQ>(problem, *step);
28  }
29  // notation PsNrGau
30  // vient de PsNrQu:
31  // polynomials of degree s with s+1 control points, quadrature formula of order u with r quadrature points (with gauss u=2r)
32  else if (s=="Galerkin P2N2Gau") {
33  GalerkinStep<T_M,T_Q,T_TQ,2>* step
34  = new GalerkinStep<T_M,T_Q,T_TQ,2>(problem);
35  integrator = new Integrator<T_M,T_Q,T_TQ>(problem, *step);
36  }*/
37  //else {
38  EulerStep<T_M,T_Q>* step
39  = new EulerStep<T_M,T_Q>(problem);
41  //}
42  return *integrator;
43  }
44 };
45 
46 } // namespace Variational
47 
48 #endif
49 
Definition: Abstract_Problem.hpp:10
Definition: EulerStep.hpp:13
Definition: Integrator.hpp:39
Definition: Abstract_LieProblem.hpp:6
Definition: Integrator.hpp:20
Definition: Factory.hpp:10