Alsvinn  0.5.3
The fast FVM simulator with UQ support
Public Member Functions | List of all members
alsfvm::integrator::RungeKutta2 Class Reference

#include <alsfvm/integrator/RungeKutta2.hpp>

Inheritance diagram for alsfvm::integrator::RungeKutta2:
alsfvm::integrator::Integrator

Public Member Functions

 RungeKutta2 (alsfvm::shared_ptr< System > system)
 
virtual size_t getNumberOfSubsteps () const
 
virtual real performSubstep (std::vector< alsfvm::shared_ptr< volume::Volume > > &inputConserved, rvec3 spatialCellSizes, real dt, real cfl, volume::Volume &output, size_t substep, const simulator::TimestepInformation &timestepInformation)
 
- Public Member Functions inherited from alsfvm::integrator::Integrator
virtual ~Integrator ()
 
real computeTimestep (const rvec3 &waveSpeeds, const rvec3 &cellLengths, real cfl, const simulator::TimestepInformation &timestepInformation) const
 
void addTimestepAdjuster (alsfvm::shared_ptr< TimestepAdjuster > &adjuster)
 addTimestepAdjuster adds a timestep adjuster More...
 
void addWaveSpeedAdjuster (WaveSpeedAdjusterPtr adjuster)
 

Additional Inherited Members

- Protected Member Functions inherited from alsfvm::integrator::Integrator
real adjustTimestep (real dt, const simulator::TimestepInformation &timestepInformation) const
 adjustTimestep adjusts the timesteps according to the timestepsadjusters More...
 

Detailed Description

Does 2nd order RungeKutta-integrator. In other words, this solves the system

\[U_t=F(U)\]

by setting

\[U_0 = U(0)\]

and then for each $n>0$, we set

\[U^*_n:=U+\Delta t F(U^n)\]

\[U^{**}_n:=U^*+\Delta t F(U_n^*)\]

and finally set

\[U^{n+1}:= \frac{1}{2}(U^*_n+U^{**}_n)\]

Constructor & Destructor Documentation

◆ RungeKutta2()

alsfvm::integrator::RungeKutta2::RungeKutta2 ( alsfvm::shared_ptr< System system)

Returns the number of substeps this integrator uses. Since this is second order RK, we need two subtimesteps

Returns
2

Member Function Documentation

◆ getNumberOfSubsteps()

size_t alsfvm::integrator::RungeKutta2::getNumberOfSubsteps ( ) const
virtual

Returns the number of substeps this integrator uses. For ForwardEuler this is 1, for RK4 this is 4, etc.

Returns
2

Implements alsfvm::integrator::Integrator.

◆ performSubstep()

real alsfvm::integrator::RungeKutta2::performSubstep ( std::vector< alsfvm::shared_ptr< volume::Volume > > &  inputConserved,
rvec3  spatialCellSizes,
real  dt,
real  cfl,
volume::Volume output,
size_t  substep,
const simulator::TimestepInformation timestepInformation 
)
virtual

Performs one substep and stores the result to output.

Parameters
inputConservedshould have the output from the previous invocations in this substep, if this is the first invocation, then this will have one element, second timestep 2 elements, etc.
spatialCellSizesshould be the cell size in each direction
dtis the timestep
substepis the currently computed substep, starting at 0.
outputwhere to write the output
cflthe cfl number to use.
timestepInformationthe current timestepInformation (needed for current time)
Note
the next invocation to performSubstep will get as input the previuosly calculated outputs
Returns
the newly computed timestep (each integrator may choose to change the timestep)

Implements alsfvm::integrator::Integrator.


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