DiFfRG
Loading...
Searching...
No Matches
DiFfRG::TimeStepperSUNDIALS_ARKode< VectorType, SparseMatrixType, dim, LinearSolver > Class Template Reference

This timestepping class utilizes the ARKode solver from SUNDIALS. It is specifically meant to be used for a spatial discretization which uses implicit timestepping and coupled to additional variables which are evolved explicitly. Therefore, this solver is an ImEx solver and requires the dynamics of the additional variables to be far slower than the dynamics of the spatial discretization. In the used Assembler, the two additional methods residual_variables and set_additional_data must be implemented, which are used to compute the explicit residual and to make the additional variables available to the implicit residual. More...

#include <sundials_arkode.hh>

Inheritance diagram for DiFfRG::TimeStepperSUNDIALS_ARKode< VectorType, SparseMatrixType, dim, LinearSolver >:
DiFfRG::AbstractTimestepper< VectorType, SparseMatrixType, dim >

Public Types

using NumberType = typename Base::NumberType
 
using InverseSparseMatrixType = typename Base::InverseSparseMatrixType
 
using BlockVectorType = typename Base::BlockVectorType
 

Public Member Functions

virtual void run (AbstractFlowingVariables< NumberType > *initial_condition, const double t_start, const double t_stop) override
 Any derived class must implement this method to run the timestepping algorithm.
 
void run_explicit (AbstractFlowingVariables< NumberType > *initial_condition, const double t_start, const double t_stop)
 Run the timestepping algorithm with the given initial condition. This method treats the entire system explicitly, e.g. if the spatial discretization is not yet stiff.
 
- Public Member Functions inherited from DiFfRG::AbstractTimestepper< VectorType, SparseMatrixType, dim >
 AbstractTimestepper (const JSONValue &json, AbstractAssembler< VectorType, SparseMatrixType, dim > *assembler, DataOutput< dim, VectorType > *data_out=nullptr, AbstractAdaptor< VectorType > *adaptor=nullptr)
 Construct a new Abstract Timestepper object.
 
DataOutput< dim, VectorType > * get_data_out ()
 Utility function to obtain a DataOutput object. If no DataOutput object is provided, a default one is created.
 
AbstractAdaptor< VectorType > * get_adaptor ()
 Utility function to obtain an Adaptor object. If no Adaptor object is provided, a default one is created, which is the NoAdaptivity object, i.e. no mesh adaptivity is used.
 

Private Types

using Base = AbstractTimestepper<VectorType, SparseMatrixType, dim>
 

Private Member Functions

void run (VectorType &initial_data, const double t_start, const double t_stop)
 
void run (BlockVectorType &initial_data, const double t_start, const double t_stop)
 
void run_explicit (VectorType &initial_data, const double t_start, const double t_stop)
 
void run_explicit (BlockVectorType &initial_data, const double t_start, const double t_stop)
 
void run_explicit_vars (VectorType &initial_data, const double t_start, const double t_stop)
 

Additional Inherited Members

- Protected Types inherited from DiFfRG::AbstractTimestepper< VectorType, SparseMatrixType, dim >
using VectorType
 
using NumberType
 
using SparseMatrixType
 
using InverseSparseMatrixType
 
using BlockVectorType
 
- Protected Member Functions inherited from DiFfRG::AbstractTimestepper< VectorType, SparseMatrixType, dim >
void console_out (const double t, const std::string name, const int verbosity_level, const double calc_dt_ms=-1.0) const
 Pretty-print the status of the timestepping algorithm to the console.
 
- Protected Attributes inherited from DiFfRG::AbstractTimestepper< VectorType, SparseMatrixType, dim >
const JSONValue json
 
AbstractAssembler< VectorType, SparseMatrixType, dim > * assembler
 
DataOutput< dim, VectorType > * data_out
 
AbstractAdaptor< VectorType > * adaptor
 
const std::chrono::time_point< std::chrono::high_resolution_clock > start_time
 
std::shared_ptr< NoAdaptivity< VectorType > > adaptor_default
 
std::shared_ptr< DataOutput< dim, VectorType > > data_out_default
 
double Lambda
 
int verbosity
 
double output_dt
 
struct DiFfRG::AbstractTimestepper::implicitParameters impl
 
struct DiFfRG::AbstractTimestepper::explicitParameters expl
 
- Static Protected Attributes inherited from DiFfRG::AbstractTimestepper< VectorType, SparseMatrixType, dim >
static constexpr uint dim
 

Detailed Description

template<typename VectorType, typename SparseMatrixType, uint dim, template< typename, typename > typename LinearSolver>
class DiFfRG::TimeStepperSUNDIALS_ARKode< VectorType, SparseMatrixType, dim, LinearSolver >

This timestepping class utilizes the ARKode solver from SUNDIALS. It is specifically meant to be used for a spatial discretization which uses implicit timestepping and coupled to additional variables which are evolved explicitly. Therefore, this solver is an ImEx solver and requires the dynamics of the additional variables to be far slower than the dynamics of the spatial discretization. In the used Assembler, the two additional methods residual_variables and set_additional_data must be implemented, which are used to compute the explicit residual and to make the additional variables available to the implicit residual.

Template Parameters
VectorTypeThis must be Vector<NumberType>. Other types are currently not supported, as we use a BlockVector internally to store the solution.
dimThe dimensionality of the spatial discretization

Member Typedef Documentation

◆ Base

template<typename VectorType , typename SparseMatrixType , uint dim, template< typename, typename > typename LinearSolver>
using DiFfRG::TimeStepperSUNDIALS_ARKode< VectorType, SparseMatrixType, dim, LinearSolver >::Base = AbstractTimestepper<VectorType, SparseMatrixType, dim>
private

◆ BlockVectorType

template<typename VectorType , typename SparseMatrixType , uint dim, template< typename, typename > typename LinearSolver>
using DiFfRG::TimeStepperSUNDIALS_ARKode< VectorType, SparseMatrixType, dim, LinearSolver >::BlockVectorType = typename Base::BlockVectorType

◆ InverseSparseMatrixType

template<typename VectorType , typename SparseMatrixType , uint dim, template< typename, typename > typename LinearSolver>
using DiFfRG::TimeStepperSUNDIALS_ARKode< VectorType, SparseMatrixType, dim, LinearSolver >::InverseSparseMatrixType = typename Base::InverseSparseMatrixType

◆ NumberType

template<typename VectorType , typename SparseMatrixType , uint dim, template< typename, typename > typename LinearSolver>
using DiFfRG::TimeStepperSUNDIALS_ARKode< VectorType, SparseMatrixType, dim, LinearSolver >::NumberType = typename Base::NumberType

Member Function Documentation

◆ run() [1/3]

template<typename VectorType , typename SparseMatrixType , uint dim, template< typename, typename > typename LinearSolver>
virtual void DiFfRG::TimeStepperSUNDIALS_ARKode< VectorType, SparseMatrixType, dim, LinearSolver >::run ( AbstractFlowingVariables< NumberType > * initial_condition,
const double t_start,
const double t_stop )
overridevirtual

Any derived class must implement this method to run the timestepping algorithm.

Parameters
initial_conditionA pointer to a flowing variables object that contains the initial condition.
t_startThe start time of the simulation.
t_stopThe run method will evolve the system from t_start to t_stop.

Implements DiFfRG::AbstractTimestepper< VectorType, SparseMatrixType, dim >.

◆ run() [2/3]

template<typename VectorType , typename SparseMatrixType , uint dim, template< typename, typename > typename LinearSolver>
void DiFfRG::TimeStepperSUNDIALS_ARKode< VectorType, SparseMatrixType, dim, LinearSolver >::run ( BlockVectorType & initial_data,
const double t_start,
const double t_stop )
private

◆ run() [3/3]

template<typename VectorType , typename SparseMatrixType , uint dim, template< typename, typename > typename LinearSolver>
void DiFfRG::TimeStepperSUNDIALS_ARKode< VectorType, SparseMatrixType, dim, LinearSolver >::run ( VectorType & initial_data,
const double t_start,
const double t_stop )
private

◆ run_explicit() [1/3]

template<typename VectorType , typename SparseMatrixType , uint dim, template< typename, typename > typename LinearSolver>
void DiFfRG::TimeStepperSUNDIALS_ARKode< VectorType, SparseMatrixType, dim, LinearSolver >::run_explicit ( AbstractFlowingVariables< NumberType > * initial_condition,
const double t_start,
const double t_stop )

Run the timestepping algorithm with the given initial condition. This method treats the entire system explicitly, e.g. if the spatial discretization is not yet stiff.

◆ run_explicit() [2/3]

template<typename VectorType , typename SparseMatrixType , uint dim, template< typename, typename > typename LinearSolver>
void DiFfRG::TimeStepperSUNDIALS_ARKode< VectorType, SparseMatrixType, dim, LinearSolver >::run_explicit ( BlockVectorType & initial_data,
const double t_start,
const double t_stop )
private

◆ run_explicit() [3/3]

template<typename VectorType , typename SparseMatrixType , uint dim, template< typename, typename > typename LinearSolver>
void DiFfRG::TimeStepperSUNDIALS_ARKode< VectorType, SparseMatrixType, dim, LinearSolver >::run_explicit ( VectorType & initial_data,
const double t_start,
const double t_stop )
private

◆ run_explicit_vars()

template<typename VectorType , typename SparseMatrixType , uint dim, template< typename, typename > typename LinearSolver>
void DiFfRG::TimeStepperSUNDIALS_ARKode< VectorType, SparseMatrixType, dim, LinearSolver >::run_explicit_vars ( VectorType & initial_data,
const double t_start,
const double t_stop )
private

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