@@ -126,44 +126,58 @@ class TimeIntegratorTransformer
126
126
127
127
public:
128
128
template <typename Layout, typename Field, typename VecField, typename ... Fluxes>
129
- void euler (Layout const & layouts, Field& rho, VecField& rhoV, VecField& B, Field& Etot,
129
+ void euler (Layout const & layouts, Field const & rho, VecField const & rhoV, VecField const & B,
130
+ Field const & Etot, Field& rhonew, VecField& rhoVnew, VecField& Bnew, Field& Etotnew,
130
131
VecField& E, double const dt, Fluxes&... fluxes)
131
132
{
132
- assert_equal_sizes (rho, rhoV, B, Etot, E, fluxes...);
133
+ assert_equal_sizes (rho, rhoV, B, Etot, rhonew, rhoVnew, Bnew, Etotnew, E, fluxes...);
133
134
for (std::size_t i = 0 ; i < layouts.size (); ++i)
134
135
{
135
136
auto _ = core::SetLayout (layouts[i], time_integrator_);
136
- time_integrator_.euler (*rho[i], *rhoV[i], *B[i], *Etot[i], *E[i], dt, *fluxes[i]...);
137
+ time_integrator_.euler_step_ (*rho[i], *rhoV[i], *B[i], *Etot[i], *rhonew[i],
138
+ *rhoVnew[i], *Bnew[i], *Etotnew[i], *E[i], dt,
139
+ *fluxes[i]...);
137
140
}
138
141
}
139
142
140
- template <typename Layout, typename Field, typename VecField, typename ... Fluxes>
141
- void tvdrk2 (Layout const & layouts, Field& rho, VecField& rhoV, VecField& B, Field& Etot,
142
- Field& rho1, VecField& rhoV1, VecField& B1, Field& Etot1, VecField& E,
143
- double const dt, Fluxes&... fluxes)
143
+ template <typename Layout, typename Field, typename VecField>
144
+ void tvdrk2_step2 (Layout const & layouts, Field& rho, VecField& rhoV, VecField& B, Field& Etot,
145
+ Field& rho1, VecField& rhoV1, VecField& B1, Field& Etot1)
144
146
{
145
- assert_equal_sizes (rho, rhoV, B, Etot, E, fluxes... );
147
+ assert_equal_sizes (rho, rhoV, B, Etot, rho1, rhoV1, B1, Etot1 );
146
148
for (std::size_t i = 0 ; i < layouts.size (); ++i)
147
149
{
148
150
auto _ = core::SetLayout (layouts[i], time_integrator_);
149
- time_integrator_.tvdrk2 (*rho[i], *rhoV[i], *B[i], *Etot[i], *rho1[i], *rhoV1[i], *B1 [i],
150
- *Etot1[i], *E [i], dt, *fluxes [i]... );
151
+ time_integrator_.tvdrk2_step2 (*rho[i], *rhoV[i], *B[i], *Etot[i], *rho1[i], *rhoV1[i],
152
+ *B1 [i], *Etot1 [i]);
151
153
}
152
154
}
153
155
154
- template <typename Layout, typename Field, typename VecField, typename ... Fluxes>
155
- void tvdrk3 (Layout const & layouts, Field& rho, VecField& rhoV, VecField& B, Field& Etot,
156
- Field& rho1, VecField& rhoV1, VecField& B1, Field& Etot1, Field& rho2,
157
- VecField& rhoV2, VecField& B2, Field& Etot2, VecField& E, double const dt,
158
- Fluxes&... fluxes)
156
+ template <typename Layout, typename Field, typename VecField>
157
+ void tvdrk3_step2 (Layout const & layouts, Field& rho, VecField& rhoV, VecField& B, Field& Etot,
158
+ Field& rho1, VecField& rhoV1, VecField& B1, Field& Etot1, Field& rho2,
159
+ VecField& rhoV2, VecField& B2, Field& Etot2)
160
+ {
161
+ assert_equal_sizes (rho, rhoV, B, Etot, rho1, rhoV1, B1, Etot1, rho2, rhoV2, B2, Etot2);
162
+ for (std::size_t i = 0 ; i < layouts.size (); ++i)
163
+ {
164
+ auto _ = core::SetLayout (layouts[i], time_integrator_);
165
+ time_integrator_.tvdrk3_step2 (*rho[i], *rhoV[i], *B[i], *Etot[i], *rho1[i], *rhoV1[i],
166
+ *B1[i], *Etot1[i], *rho2[i], *rhoV2[i], *B2[i],
167
+ *Etot2[i]);
168
+ }
169
+ }
170
+
171
+ template <typename Layout, typename Field, typename VecField>
172
+ void tvdrk3_step3 (Layout const & layouts, Field& rho, VecField& rhoV, VecField& B, Field& Etot,
173
+ Field& rho2, VecField& rhoV2, VecField& B2, Field& Etot2)
159
174
{
160
- assert_equal_sizes (rho, rhoV, B, Etot, E, fluxes... );
175
+ assert_equal_sizes (rho, rhoV, B, Etot, rho2, rhoV2, B2, Etot2 );
161
176
for (std::size_t i = 0 ; i < layouts.size (); ++i)
162
177
{
163
178
auto _ = core::SetLayout (layouts[i], time_integrator_);
164
- time_integrator_.tvdrk3 (*rho[i], *rhoV[i], *B[i], *Etot[i], *rho1[i], *rhoV1[i], *B1[i],
165
- *Etot1[i], *rho2[i], *rhoV2[i], *B2[i], *Etot2[i], *E[i], dt,
166
- *fluxes[i]...);
179
+ time_integrator_.tvdrk3_step3 (*rho[i], *rhoV[i], *B[i], *Etot[i], *rho2[i], *rhoV2[i],
180
+ *B2[i], *Etot2[i]);
167
181
}
168
182
}
169
183
0 commit comments