DiFfRG
Loading...
Searching...
No Matches
DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ > Class Template Referenceabstract

The abstract base class for all timestepping algorithms. It provides a standard constructor which populates typical timestepping parameters from a given JSONValue object, such as the timestep sizes, tolerances, verbosity, etc. that are used in the timestepping algorithms. More...

#include <abstract_timestepper.hh>

Classes

struct  explicitParameters
 
struct  implicitParameters
 

Public Member Functions

 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.
 
virtual void run (AbstractFlowingVariables< NumberType > *initial_condition, const double t_start, const double t_stop)=0
 Any derived class must implement this method to run the timestepping algorithm.
 

Protected Types

using VectorType = VectorType_
 
using NumberType = typename get_type::NumberType<VectorType>
 
using SparseMatrixType = SparseMatrixType_
 
using InverseSparseMatrixType = typename get_type::InverseSparseMatrixType<SparseMatrixType>
 
using BlockVectorType = dealii::BlockVector<NumberType>
 

Protected Member Functions

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

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

static constexpr uint dim = dim_
 

Detailed Description

template<typename VectorType_, typename SparseMatrixType_, uint dim_>
class DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >

The abstract base class for all timestepping algorithms. It provides a standard constructor which populates typical timestepping parameters from a given JSONValue object, such as the timestep sizes, tolerances, verbosity, etc. that are used in the timestepping algorithms.

In the JSONValue object, a /timestepping/ section must be present with the following parameters:

  • /timestepping/output_dt: The output timestep size.
  • /timestepping/implicit/dt: The timestep size for an implicit timestepping algorithm.
  • /timestepping/implicit/minimal_dt: The minimal timestep size for an implicit timestepping algorithm.
  • /timestepping/implicit/maximal_dt: The maximal timestep size for an implicit timestepping algorithm.
  • /timestepping/implicit/abs_tol: The absolute tolerance for an implicit timestepping algorithm.
  • /timestepping/implicit/rel_tol: The relative tolerance for an implicit timestepping algorithm.
  • /timestepping/explicit/dt: The timestep size for an explicit timestepping algorithm.
  • /timestepping/explicit/minimal_dt: The minimal timestep size for an explicit timestepping algorithm.
  • /timestepping/explicit/maximal_dt: The maximal timestep size for an explicit timestepping algorithm.
  • /timestepping/explicit/abs_tol: The absolute tolerance for an explicit timestepping algorithm.
  • /timestepping/explicit/rel_tol: The relative tolerance for an explicit timestepping algorithm.

Additionally, the following parameters are being used:

  • /output/verbosity: The verbosity level of the output.
  • /physical/Lambda: The RG scale parameter Lambda. If not present, no RG scale is given when console_out is called.

The console_out method is used to print information about the current time, the calculation time and the current RG scale k to the console in a standardized way.

Template Parameters
VectorType_The type of the vector used in the timestepping algorithm.. Currently only Vector<double> is supported.
SparseMatrixType_The type of the sparse matrix used in the timestepping algorithm. This depends on the assembler used in the computation.
dim_The dimensionality of the spatial discretization.

Member Typedef Documentation

◆ BlockVectorType

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
using DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::BlockVectorType = dealii::BlockVector<NumberType>
protected

◆ InverseSparseMatrixType

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
using DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::InverseSparseMatrixType = typename get_type::InverseSparseMatrixType<SparseMatrixType>
protected

◆ NumberType

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
using DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::NumberType = typename get_type::NumberType<VectorType>
protected

◆ SparseMatrixType

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
using DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::SparseMatrixType = SparseMatrixType_
protected

◆ VectorType

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
using DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::VectorType = VectorType_
protected

Constructor & Destructor Documentation

◆ AbstractTimestepper()

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::AbstractTimestepper ( const JSONValue & json,
AbstractAssembler< VectorType, SparseMatrixType, dim > * assembler,
DataOutput< dim, VectorType > * data_out = nullptr,
AbstractAdaptor< VectorType > * adaptor = nullptr )
inline

Construct a new Abstract Timestepper object.

Parameters
jsonThe JSONValue object must contain a /timestepping/ section with all necessary parameters.
assembler
data_out
adaptor

Member Function Documentation

◆ console_out()

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
void DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::console_out ( const double t,
const std::string name,
const int verbosity_level,
const double calc_dt_ms = -1.0 ) const
inlineprotected

Pretty-print the status of the timestepping algorithm to the console.

Parameters
tCurrent time.
nameA tag prepended to the output.
verbosity_levelThe verbosity level of the output.
calc_dt_msIf >= 0, the time in milliseconds it took to calculate the current timestep.

◆ get_adaptor()

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
AbstractAdaptor< VectorType > * DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::get_adaptor ( )
inline

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.

Returns
AbstractAdaptor<VectorType>* A pointer to the Adaptor object.

◆ get_data_out()

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
DataOutput< dim, VectorType > * DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::get_data_out ( )
inline

Utility function to obtain a DataOutput object. If no DataOutput object is provided, a default one is created.

Returns
DataOutput<dim, VectorType>* A pointer to the DataOutput object.

◆ run()

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
virtual void DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::run ( AbstractFlowingVariables< NumberType > * initial_condition,
const double t_start,
const double t_stop )
pure virtual

Member Data Documentation

◆ adaptor

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
AbstractAdaptor<VectorType>* DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::adaptor
protected

◆ adaptor_default

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
std::shared_ptr<NoAdaptivity<VectorType> > DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::adaptor_default
protected

◆ assembler

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
AbstractAssembler<VectorType, SparseMatrixType, dim>* DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::assembler
protected

◆ data_out

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
DataOutput<dim, VectorType>* DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::data_out
protected

◆ data_out_default

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
std::shared_ptr<DataOutput<dim, VectorType> > DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::data_out_default
protected

◆ dim

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
uint DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::dim = dim_
staticconstexprprotected

◆ expl

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
struct DiFfRG::AbstractTimestepper::explicitParameters DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::expl
protected

◆ impl

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
struct DiFfRG::AbstractTimestepper::implicitParameters DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::impl
protected

◆ json

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
const JSONValue DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::json
protected

◆ Lambda

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
double DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::Lambda
protected

◆ output_dt

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
double DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::output_dt
protected

◆ start_time

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
const std::chrono::time_point<std::chrono::high_resolution_clock> DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::start_time
protected

◆ verbosity

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
int DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::verbosity
protected

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