55 void copySolnData(TSoln& dest, const TSoln& src)
59 template <
class TSoln,
class TFR,
class TOp>
65 const TSoln& a_oldCrseSoln,
69 const TSoln& a_newCrseSoln,
83 const bool a_initializeNewSoln =
true)
90 a_op.defineRHSData(RHSTmp,a_oldSoln);
91 a_op.defineSolnData(solnTmp,a_oldSoln);
92 a_op.copySolnData(solnTmp,a_oldSoln);
95 if (a_initializeNewSoln)
97 a_op.copySolnData(a_newSoln, a_oldSoln);
103 a_op.evalRHS(RHSTmp,a_oldSoln,
104 a_fineFRPtr,a_crseFRPtr,
105 a_oldCrseSoln, a_oldCrseTime,
106 a_newCrseSoln, a_newCrseTime,
112 a_op.updateODE(a_newSoln,RHSTmp,a_dt/6);
116 a_op.updateODE(solnTmp, RHSTmp,a_dt/2);
120 a_op.evalRHS(RHSTmp,solnTmp,
121 a_fineFRPtr,a_crseFRPtr,
122 a_oldCrseSoln, a_oldCrseTime,
123 a_newCrseSoln, a_newCrseTime,
124 a_time+a_dt/2,a_dt/3);
129 a_op.updateODE(a_newSoln,RHSTmp,a_dt/3);
132 a_op.copySolnData(solnTmp,a_oldSoln);
133 a_op.updateODE(solnTmp,RHSTmp,a_dt/2);
137 a_op.evalRHS(RHSTmp,solnTmp,
138 a_fineFRPtr,a_crseFRPtr,
139 a_oldCrseSoln, a_oldCrseTime,
140 a_newCrseSoln, a_newCrseTime,
141 a_time+a_dt/2,a_dt/3);
146 a_op.updateODE(a_newSoln,RHSTmp,a_dt/3);
149 a_op.copySolnData(solnTmp,a_oldSoln);
150 a_op.updateODE(solnTmp,RHSTmp,a_dt);
154 a_op.evalRHS(RHSTmp,solnTmp,
155 a_fineFRPtr,a_crseFRPtr,
156 a_oldCrseSoln, a_oldCrseTime,
157 a_newCrseSoln, a_newCrseTime,
162 a_op.updateODE(a_newSoln,RHSTmp,a_dt/6);
220 void copySolnData(TSoln& dest, const TSoln& src)
224 template <
class TSoln,
class TInterp,
class TFR,
class TOp>
230 TInterp& a_interpPtr,
232 const TSoln& a_oldCrseSoln,
236 const TSoln& a_newCrseSoln,
250 const bool a_initializeNewSoln =
true)
260 a_op.defineRHSData(RHSTmp,a_oldSoln);
261 a_op.defineSolnData(solnTmp,a_oldSoln);
262 a_op.copySolnData(solnTmp,a_oldSoln);
265 if (a_initializeNewSoln)
267 a_op.copySolnData(a_newSoln, a_oldSoln);
269 a_interpPtr.setDt(a_dt);
270 a_interpPtr.saveInitialSoln(a_oldSoln);
275 a_op.evalRHS(RHSTmp,a_oldSoln,
276 a_fineFRPtr,a_crseFRPtr,
277 a_oldCrseSoln, a_oldCrseTime,
278 a_newCrseSoln, a_newCrseTime,
280 a_interpPtr.saveRHS(RHSTmp);
285 a_op.updateODE(a_newSoln,RHSTmp,a_dt/6);
289 a_op.updateODE(solnTmp, RHSTmp,a_dt/2);
293 a_op.evalRHS(RHSTmp,solnTmp,
294 a_fineFRPtr,a_crseFRPtr,
295 a_oldCrseSoln, a_oldCrseTime,
296 a_newCrseSoln, a_newCrseTime,
297 a_time+a_dt/2,a_dt/3);
298 a_interpPtr.saveRHS(RHSTmp);
302 a_op.updateODE(a_newSoln,RHSTmp,a_dt/3);
305 a_op.copySolnData(solnTmp,a_oldSoln);
306 a_op.updateODE(solnTmp,RHSTmp,a_dt/2);
310 a_op.evalRHS(RHSTmp,solnTmp,
311 a_fineFRPtr,a_crseFRPtr,
312 a_oldCrseSoln, a_oldCrseTime,
313 a_newCrseSoln, a_newCrseTime,
314 a_time+a_dt/2,a_dt/3);
315 a_interpPtr.saveRHS(RHSTmp);
320 a_op.updateODE(a_newSoln,RHSTmp,a_dt/3);
323 a_op.copySolnData(solnTmp,a_oldSoln);
324 a_op.updateODE(solnTmp,RHSTmp,a_dt);
328 a_op.evalRHS(RHSTmp,solnTmp,
329 a_fineFRPtr,a_crseFRPtr,
330 a_oldCrseSoln, a_oldCrseTime,
331 a_newCrseSoln, a_newCrseTime,
333 a_interpPtr.saveRHS(RHSTmp);
337 a_op.updateODE(a_newSoln,RHSTmp,a_dt/6);
340 #endif // end multiple-include preventer double Real
Definition: REAL.H:33
void RK4LevelAdvance(TSoln &a_newSoln, TSoln &a_oldSoln, const TSoln &a_oldCrseSoln, Real a_oldCrseTime, const TSoln &a_newCrseSoln, Real a_newCrseTime, TFR &a_crseFRPtr, TFR &a_fineFRPtr, Real a_time, Real a_dt, TOp &a_op, const bool a_initializeNewSoln=true)
Basic templated implementation of RK4 advance for a single AMRLevel.
Definition: LevelRK4.H:60