AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ > Class Template Reference#
|
DiFfRG
|
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
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
|
protected |
◆ InverseSparseMatrixType
|
protected |
◆ NumberType
|
protected |
◆ SparseMatrixType
|
protected |
◆ VectorType
|
protected |
Constructor & Destructor Documentation
◆ AbstractTimestepper()
|
inline |
Construct a new Abstract Timestepper object.
- Parameters
-
json The JSONValue object must contain a /timestepping/ section with all necessary parameters. assembler data_out adaptor
Member Function Documentation
◆ console_out()
|
inlineprotected |
Pretty-print the status of the timestepping algorithm to the console.
- Parameters
-
t Current time. name A tag prepended to the output. verbosity_level The verbosity level of the output. calc_dt_ms If >= 0, the time in milliseconds it took to calculate the current timestep.
◆ 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()
|
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()
|
pure virtual |
Any derived class must implement this method to run the timestepping algorithm.
- Parameters
-
initial_condition A pointer to a flowing variables object that contains the initial condition. t_start The start time of the simulation. t_stop The run method will evolve the system from t_start to t_stop.
Implemented in DiFfRG::TimeStepperBoostRK< VectorType, SparseMatrixType, dim, prec >, DiFfRG::TimeStepperImplicitEuler< VectorType, SparseMatrixType, dim, LinearSolver >, DiFfRG::TimeStepperSUNDIALS_IDA< VectorType, SparseMatrixType, dim, LinearSolver >, DiFfRG::TimeStepperSUNDIALS_IDA_BoostABM< VectorType, SparseMatrixType, dim, LinearSolver >, DiFfRG::TimeStepperSUNDIALS_IDA_BoostRK< VectorType, SparseMatrixType, dim, LinearSolver, prec >, and DiFfRG::TimeStepperTRBDF2< VectorType, SparseMatrixType, dim, LinearSolver >.
Member Data Documentation
◆ adaptor
|
protected |
◆ adaptor_default
|
protected |
◆ assembler
|
protected |
◆ data_out
|
protected |
◆ data_out_default
|
protected |
◆ dim
|
staticconstexprprotected |
◆ expl
|
protected |
◆ impl
|
protected |
◆ json
|
protected |
◆ Lambda
|
protected |
◆ output_dt
|
protected |
◆ start_time
|
protected |
◆ verbosity
|
protected |
The documentation for this class was generated from the following file:
- /home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/timestepping/abstract_timestepper.hh
Generated by