|
METHOD
|
#include <RK2.h>


Public Member Functions | |
| RK2 (Data *data, Model *model, Bcs *bcs, FluxMethod *fluxMethod, ModelExtension *modelExtension=NULL) | |
| virtual | ~RK2 () |
| void | predictorStep (double *cons, double *prims, double *aux, double dt) |
| void | correctorStep (double *cons, double *prims, double *aux, double dt) |
| void | step (double *cons, double *prims, double *aux, double dt=0) |
Public Member Functions inherited from TimeIntegrator | |
| TimeIntegrator (Data *data, Model *model, Bcs *bcs, FluxMethod *fluxMethod, ModelExtension *modelExtension=NULL) | |
| virtual | ~TimeIntegrator () |
| void | finalise (double *cons, double *prims, double *aux) |
Public Member Functions inherited from TimeIntegratorBase | |
| TimeIntegratorBase (Data *data, Model *model, Bcs *bcs, FluxMethod *fluxMethod, ModelExtension *modelExtension=NULL) | |
| virtual | ~TimeIntegratorBase () |
Public Attributes | |
| double * | p1cons |
| double * | p1prims |
| double * | p1aux |
| double * | args1 |
| double * | args2 |
Public Attributes inherited from TimeIntegratorBase | |
| Data * | data |
| Model * | model |
| Bcs * | bcs |
| FluxMethod * | fluxMethod |
| ModelExtension * | modelExtension |
TVD Runge-Kutta 2nd order time integrator
\begin{align} U^{n+1} = \frac{1}{2} U^n + \frac{1}{2} U^{(1)} + \frac{1}{2} \Delta t \mathcal{F}(U^{(1)}) \end{align}
where the first stage result is\begin{align} U^{(1)} = U^n + \Delta t \mathcal{F}(U^n). \end{align}
| RK2::RK2 | ( | Data * | data, |
| Model * | model, | ||
| Bcs * | bcs, | ||
| FluxMethod * | fluxMethod, | ||
| ModelExtension * | modelExtension = NULL |
||
| ) |
Constructor.
Constructor requires simulation data and the flux and source functions from the model class. Stores the necessary pointer.
| [in] | *data | Pointer to Data class containing global simulation data |
| [in] | *model | pointer to Model object |
| [in] | *bcs | pointer to Bcs object |
| [in] | *fluxMethod | pointer to FluxMethod object |
| [in] | *modelExtension | pointer to the ModelExtension object |
|
virtual |
| void RK2::correctorStep | ( | double * | cons, |
| double * | prims, | ||
| double * | aux, | ||
| double | dt | ||
| ) |
\begin{align} U^{n+1} = \frac{1}{2} U^n + \frac{1}{2} U^{(1)} + \frac{1}{2} \Delta t \mathcal{F}(U^{(1)}) \end{align}
| [in] | *cons | pointer to conserved vector work array. Size is \(N_{cons} \times N_x \times N_y \times N_z\) |
| [in] | *prims | pointer to primitive vector work array. Size is \(N_{prims} \times N_x \times N_y \times N_z\) |
| [in] | *aux | pointer to auxiliary vector work array. Size is \(N_{aux} \times N_x \times N_y \times N_z\) |
| dt | the step size desired to move by. Defaults to the value in the Data class |
| void RK2::predictorStep | ( | double * | cons, |
| double * | prims, | ||
| double * | aux, | ||
| double | dt | ||
| ) |
Predictor.
\begin{align} U^{(1)} = U^n + \Delta t \mathcal{F}(U^n). \end{align}
| [in] | *cons | pointer to conserved vector work array. Size is \(N_{cons} \times N_x \times N_y \times N_z\) |
| [in] | *prims | pointer to primitive vector work array. Size is \(N_{prims} \times N_x \times N_y \times N_z\) |
| [in] | *aux | pointer to auxiliary vector work array. Size is \(N_{aux} \times N_x \times N_y \times N_z\) |
| dt | the step size desired to move by. Defaults to the value in the Data class |
|
virtual |
Performs a single time step.
The timestep will use the current values of the conserved, primitive and auxiliary variables at t=t0 and compute the values of all of them at time \(t=t_0 + dt\). I.e. the conserved vector is evolved forward, and the corresponding prims and aux vars are found.
| [in] | *cons | pointer to conserved vector work array. Size is \(N_{cons} \times N_x \times N_y \times N_z\) |
| [in] | *prims | pointer to primitive vector work array. Size is \(N_{prims} \times N_x \times N_y \times N_z\) |
| [in] | *aux | pointer to auxiliary vector work array. Size is \(N_{aux} \times N_x \times N_y \times N_z\) |
| dt | the step size desired to move by. Defaults to the value in the Data class |
Implements TimeIntegratorBase.
Reimplemented in RKSplit2.