Alsvinn
0.5.3
The fast FVM simulator with UQ support
|
#include <alsfvm/integrator/Integrator.hpp>
Public Member Functions | |
virtual | ~Integrator () |
virtual size_t | getNumberOfSubsteps () const =0 |
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 ×tepInformation)=0 |
real | computeTimestep (const rvec3 &waveSpeeds, const rvec3 &cellLengths, real cfl, const simulator::TimestepInformation ×tepInformation) const |
void | addTimestepAdjuster (alsfvm::shared_ptr< TimestepAdjuster > &adjuster) |
addTimestepAdjuster adds a timestep adjuster More... | |
void | addWaveSpeedAdjuster (WaveSpeedAdjusterPtr adjuster) |
Protected Member Functions | |
real | adjustTimestep (real dt, const simulator::TimestepInformation ×tepInformation) const |
adjustTimestep adjusts the timesteps according to the timestepsadjusters More... | |
Base interface for all integrators. An integrator will solve the system
where the function is supplied (usually a numerical flux).
We assume the time integrator is divided into a number of subtimesteps, so that it can be run in the following manner
|
inlinevirtual |
void alsfvm::integrator::Integrator::addTimestepAdjuster | ( | alsfvm::shared_ptr< TimestepAdjuster > & | adjuster | ) |
addTimestepAdjuster adds a timestep adjuster
adjuster | the adjuster to add |
void alsfvm::integrator::Integrator::addWaveSpeedAdjuster | ( | WaveSpeedAdjusterPtr | adjuster | ) |
|
protected |
adjustTimestep adjusts the timesteps according to the timestepsadjusters
dt | the current timestep |
timestepInformation | the current timestep information |
real alsfvm::integrator::Integrator::computeTimestep | ( | const rvec3 & | waveSpeeds, |
const rvec3 & | cellLengths, | ||
real | cfl, | ||
const simulator::TimestepInformation & | timestepInformation | ||
) | const |
Computes the timestep (dt).
[in] | waveSpeeds | the wave speeds in each direction |
[in] | cellLengths | the cell lengths in each direction |
[in] | cfl | the CFL number |
[in] | timestepInformation | the timestep information. |
|
pure virtual |
Returns the number of substeps this integrator uses. For ForwardEuler this is 1, for RK4 this is 4, etc.
Implemented in alsfvm::integrator::RungeKutta2, alsfvm::integrator::ForwardEuler, alsfvm::integrator::RungeKutta3, and alsfvm::integrator::RungeKutta4.
|
pure virtual |
Performs one substep and stores the result to output.
inputConserved | should 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. |
spatialCellSizes | should be the cell size in each direction |
dt | is the timestep |
substep | is the currently computed substep, starting at 0. |
output | where to write the output |
cfl | the cfl number to use. |
timestepInformation | the current timestepInformation (needed for current time) |
Implemented in alsfvm::integrator::RungeKutta2, alsfvm::integrator::ForwardEuler, alsfvm::integrator::RungeKutta3, and alsfvm::integrator::RungeKutta4.