METHOD
RK3 Class Reference

#include <RKPlus.h>

Inheritance diagram for RK3:
Collaboration diagram for RK3:

Public Member Functions

 RK3 (Data *data, Model *model, Bcs *bcs, FluxMethod *fluxMethod, ModelExtension *modelExtension=NULL)
 
virtual ~RK3 ()
 
void stage1 (double *cons, double *prims, double *aux, double dt)
 
void stage2 (double *cons, double *prims, double *aux, double dt)
 
void stage3 (double *cons, double *prims, double *aux, double dt)
 
void step (double *cons, double *prims, double *aux, double dt=0)
 
- Public Member Functions inherited from RKPlus
 RKPlus (Data *data, Model *model, Bcs *bcs, FluxMethod *fluxMethod, ModelExtension *modelExtension=NULL)
 
virtual ~RKPlus ()
 
virtual void rhs (double *cons, double *prims, double *aux, double *rhsVec)
 
- 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 * u1cons
 
double * u1prims
 
double * u1aux
 
double * u2cons
 
double * u2prims
 
double * u2aux
 
double * rhs1
 
double * rhs2
 
double * rhs3
 
- Public Attributes inherited from RKPlus
double * fluxCont
 
- Public Attributes inherited from TimeIntegratorBase
Datadata
 
Modelmodel
 
Bcsbcs
 
FluxMethodfluxMethod
 
ModelExtensionmodelExtension
 

Detailed Description

Third order RK.

SSPRK(3,3) from Gottlieb 2009. This can run the AdvectionSingleFluid test with cfl=1.7

The step function performs the following stages. Stage 1:

\begin{align} U^{(1)} = U^n + \Delta t \mathcal{L}(U^n). \end{align}

Stage 2:

\begin{align} U^{(2)} = \frac{3}{4} U^n + \frac{1}{4} U^{(1)} + \frac{1}{4} \Delta t \mathcal{L}(U^{(1)}) \end{align}

Stage 3:

\begin{align} U^{n+1} = \frac{1}{3} U^n + \frac{2}{3} U^{(2)} + \frac{2}{3} \Delta t \mathcal{L}(U^{(2)}) \end{align}

Definition at line 189 of file RKPlus.h.

Constructor & Destructor Documentation

◆ RK3()

RK3::RK3 ( 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.

Parameters
[in]*conspointer to conserved vector work array. Size is \(N_{cons} \times N_x \times N_y \times N_z\)
[in]*primspointer to primitive vector work array. Size is \(N_{prims} \times N_x \times N_y \times N_z\)
[in]*auxpointer to auxiliary vector work array. Size is \(N_{aux} \times N_x \times N_y \times N_z\)
dtthe step size desired to move by. Defaults to the value in the Data class
See also
TimeIntegrator::TimeIntegrator
RKPlus::RKPlus

◆ ~RK3()

virtual RK3::~RK3 ( )
virtual

Member Function Documentation

◆ stage1()

void RK3::stage1 ( double *  cons,
double *  prims,
double *  aux,
double  dt 
)

Stage 1 result.

Compute and store stage 1 result.

Parameters
[in]*conspointer to conserved vector work array. Size is \(N_{cons} \times N_x \times N_y \times N_z\)
[in]*primspointer to primitive vector work array. Size is \(N_{prims} \times N_x \times N_y \times N_z\)
[in]*auxpointer to auxiliary vector work array. Size is \(N_{aux} \times N_x \times N_y \times N_z\)
dtthe step size desired to move by. Defaults to the value in the Data class
See also
RK3::RK3

◆ stage2()

void RK3::stage2 ( double *  cons,
double *  prims,
double *  aux,
double  dt 
)

Stage 2 result.

Compute and store stage 2 result.

Parameters
[in]*conspointer to conserved vector work array. Size is \(N_{cons} \times N_x \times N_y \times N_z\)
[in]*primspointer to primitive vector work array. Size is \(N_{prims} \times N_x \times N_y \times N_z\)
[in]*auxpointer to auxiliary vector work array. Size is \(N_{aux} \times N_x \times N_y \times N_z\)
dtthe step size desired to move by. Defaults to the value in the Data class
See also
RK3::RK3

◆ stage3()

void RK3::stage3 ( double *  cons,
double *  prims,
double *  aux,
double  dt 
)

Stage 3 result.

Compute and store stage 3 result.

Parameters
[in]*conspointer to conserved vector work array. Size is \(N_{cons} \times N_x \times N_y \times N_z\)
[in]*primspointer to primitive vector work array. Size is \(N_{prims} \times N_x \times N_y \times N_z\)
[in]*auxpointer to auxiliary vector work array. Size is \(N_{aux} \times N_x \times N_y \times N_z\)
dtthe step size desired to move by. Defaults to the value in the Data class
See also
RK3::RK3

◆ step()

void RK3::step ( double *  cons,
double *  prims,
double *  aux,
double  dt = 0 
)
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.

Parameters
[in]*conspointer to conserved vector work array. Size is \(N_{cons} \times N_x \times N_y \times N_z\)
[in]*primspointer to primitive vector work array. Size is \(N_{prims} \times N_x \times N_y \times N_z\)
[in]*auxpointer to auxiliary vector work array. Size is \(N_{aux} \times N_x \times N_y \times N_z\)
dtthe step size desired to move by. Defaults to the value in the Data class
See also
TimeIntegrator::step

Implements TimeIntegratorBase.

Member Data Documentation

◆ rhs1

double * RK3::rhs1

Work arrays for interstage results.

Definition at line 195 of file RKPlus.h.

◆ rhs2

double * RK3::rhs2

Work arrays for interstage results.

Definition at line 195 of file RKPlus.h.

◆ rhs3

double * RK3::rhs3

Work arrays for interstage results.

Definition at line 195 of file RKPlus.h.

◆ u1aux

double * RK3::u1aux

Work arrays for interstage results.

Definition at line 195 of file RKPlus.h.

◆ u1cons

double* RK3::u1cons

Work arrays for interstage results.

Definition at line 195 of file RKPlus.h.

◆ u1prims

double * RK3::u1prims

Work arrays for interstage results.

Definition at line 195 of file RKPlus.h.

◆ u2aux

double * RK3::u2aux

Work arrays for interstage results.

Definition at line 195 of file RKPlus.h.

◆ u2cons

double * RK3::u2cons

Work arrays for interstage results.

Definition at line 195 of file RKPlus.h.

◆ u2prims

double * RK3::u2prims

Work arrays for interstage results.

Definition at line 195 of file RKPlus.h.


The documentation for this class was generated from the following file: