This source file includes following definitions.
- solve
- brusselator_rhs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 #include <config.h>
25 #include <dune/fem/solver/cginverseoperator.hh>
26 #include "secOrd_op_solutionDriven.h"
27 #include "secOrd_op_solutionDriven_impl.h"
28 #include "io_parameter.h"
29 #include "grid.h"
30
31
32 using Esfem::SecOrd_op::Solution_driven;
33 using Esfem::Impl::MCF_op;
34
35 using FEfun = Esfem::Grid::Scal_FEfun::Dune_FEfun;
36
37 using Vec_FEfun = Esfem::Grid::Vec_FEfun::Dune_FEfun;
38
39 using Vec_cg_solver = Dune::Fem::CGInverseOperator<Vec_FEfun>;
40
41
42
43
44
45
46
47 struct Solution_driven::Data{
48 MCF_op mcf_op;
49 Vec_cg_solver cg_solver;
50
51
52 Data(const Io::Parameter&, const Grid::Grid_and_time&,
53 const Grid::Scal_FEfun& u_wrapper);
54 };
55
56 Solution_driven::Data::Data(const Io::Parameter& p, const Grid::Grid_and_time& g,
57 const Grid::Scal_FEfun& u_wrapper)
58 :mcf_op {p, g, u_wrapper},
59 cg_solver {mcf_op, p.eps(), p.eps()}
60
61
62 {}
63
64
65
66
67 Solution_driven::Solution_driven(const Io::Parameter& p,
68 const Grid::Grid_and_time& g,
69 const Grid::Scal_FEfun& u)
70 :d_ptr {std::make_unique<Data>(p, g, u)}
71 {}
72
73 Solution_driven::~Solution_driven() = default;
74
75 void Solution_driven::
76 solve(const Grid::Vec_FEfun& rhs, Grid::Vec_FEfun& lhs) const{
77 const Vec_FEfun& vfef1 = rhs;
78 Vec_FEfun& vfef2 = lhs;
79 d_ptr -> cg_solver(vfef1, vfef2);
80
81
82 }
83
84 void Solution_driven::brusselator_rhs(const Grid::Vec_FEfun& rhs,
85 Grid::Vec_FEfun& lhs) const{
86 d_ptr -> mcf_op.brusselator_rhs(rhs, lhs);
87 }
88
89 void Solution_driven::operator()(const Grid::Vec_FEfun& rhs,
90 Grid::Vec_FEfun& lhs) const{
91 d_ptr -> mcf_op(rhs, lhs);
92 }