5#ifndef CPPPROJCT_EULERSOLVER_H
6#define CPPPROJCT_EULERSOLVER_H
8#include "GeneralSolver.h"
10template <
typename Equation>
17 std::vector<double> &b,
18 std::vector<double> &c,
19 std::vector<double> &d,
22 std::vector<double> &RK1,
23 std::vector<double> &RK2,
24 std::vector<double> &RK3,
25 std::vector<double> &RK4,
31 std::vector<double> &b,
32 std::vector<double> &c,
33 std::vector<double> &d,
36 std::vector<double> &RK1,
41 std::vector<double> &b,
42 std::vector<double> &c,
43 std::vector<double> &d,
46 std::vector<double> &RK1,
47 std::vector<double> &RK2,
52 std::vector<double> &b,
53 std::vector<double> &c,
54 std::vector<double> &d,
57 std::vector<double> &RK1,
58 std::vector<double> &RK2,
59 std::vector<double> &RK3,
64 std::vector<double> &b,
65 std::vector<double> &c,
66 std::vector<double> &d,
69 std::vector<double> &RK1,
70 std::vector<double> &RK2,
71 std::vector<double> &RK3,
72 std::vector<double> &RK4,
78template <
typename Equation>
82 std::vector<double> &b,
83 std::vector<double> &c,
84 std::vector<double> &d,
87 std::vector<double> &RK1,
88 std::vector<double> &RK2,
89 std::vector<double> &RK3,
90 std::vector<double> &RK4,
96 answer = a + h * (RK1[0] +
100 }
else if ((*(P+2)) != 0) {
101 answer = a + h * (RK1[0] +
104 }
else if ((*(P+1)) != 0) {
105 answer = a + h * (RK1[0] +
108 answer = a + h * RK1[0];
113template <
typename Equation>
117 std::vector<double> &b,
118 std::vector<double> &c,
119 std::vector<double> &d,
122 std::vector<double> &RK1,
125 std::vector<double> T1={0},T2={1},T3={0},T4={1};
132 E.UpdateFlowSpecs(T1,T2,T3,T4,d.size());
134 PRINTF_DBG(
"EulerSolver reports: before computing the field, Specs.result was %f\n",Specs.result);
136 PRINTF_DBG(
"EulerSolver reports: after computing the field, Specs.result was %f\n",Specs.result);
137 RK1[0] = Specs.result;
138 PRINTF_DBG(
"EulerSolver reports: the written value to RK1[0] was %f\n",RK1[0]);
144template <
typename Equation>
148 std::vector<double> &b,
149 std::vector<double> &c,
150 std::vector<double> &d,
153 std::vector<double> &RK1,
154 std::vector<double> &RK2,
157 std::vector<double> T1={0},T2={1},T3={0},T4={1};
165 E.UpdateFlowSpecs(T1,T2,T3,T4,d.size());
168 E.d1Field(t,a,b,c,d);
169 RK2[0] = Specs.result;
170 PRINTF_DBG(
"a=%f,b=%f, b size is %d and the result was %f\n",a,b[0],b.size(), RK2[0]);std::cout<<std::flush;
173template <
typename Equation>
177 std::vector<double> &b,
178 std::vector<double> &c,
179 std::vector<double> &d,
182 std::vector<double> &RK1,
183 std::vector<double> &RK2,
184 std::vector<double> &RK3,
188 std::vector<double> T1={0},T2={1},T3={0},T4={1};
196 E.UpdateFlowSpecs(T1,T2,T3,T4,d.size());
199 E.d2Field(t,a,b,c,d);
200 RK3[0] = Specs.result;
204template <
typename Equation>
208 std::vector<double> &b,
209 std::vector<double> &c,
210 std::vector<double> &d,
213 std::vector<double> &RK1,
214 std::vector<double> &RK2,
215 std::vector<double> &RK3,
216 std::vector<double> &RK4,
220 std::vector<double> T1={0},T2={1},T3={0},T4={1};
228 E.UpdateFlowSpecs(T1,T2,T3,T4,d.size());
230 E.d3Field(t,a,b,c,d);
231 RK4[0] = Specs.result;
Definition: EulerSolver.h:11
Definition: GeneralDifferentialEquation.h:15