AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ > Class Template Reference#

DiFfRG: DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ > Class Template Reference
DiFfRG
Discretization Framework for functional Renormalization Group flows
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 ConfigTree 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 ConfigTree &config, AbstractAssembler< VectorType, SparseMatrixType, dim > &assembler, OutputSession_impl< dim, VectorType > &data_out, const bool implicit_stepper, const bool explicit_stepper)
 Construct a new Abstract Timestepper object.
 
 AbstractTimestepper (const ConfigTree &config, AbstractAssembler< VectorType, SparseMatrixType, dim > &assembler, OutputSession_impl< dim, VectorType > &data_out, AbstractAdaptor< VectorType > &adaptor, const bool implicit_stepper, const bool explicit_stepper)
 

Protected Types

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

Protected Member Functions

void drain_output ()
 
template<typename EmitFinalFrame >
void finalize_output_after_failure (EmitFinalFrame &&emit_final_frame)
 Best-effort output cleanup while a timestepping failure is being reported.
 
virtual void run (AbstractFlowingVariables< NumberType, VectorType > &initial_condition, const double t_start, const double t_stop)=0
 Any derived class must implement this method to run the timestepping algorithm.
 
bool is_implicit () const
 
bool is_explicit () const
 

Protected Attributes

const ConfigTree config
 
NoAdaptivity< VectorType > adaptor_default
 
AbstractAssembler< VectorType, SparseMatrixType, dim > & assembler
 
OutputSession_impl< dim, VectorType > & data_out
 
AbstractAdaptor< VectorType > & adaptor
 
ReportPort log
 
const bool m_is_implicit
 
const bool m_is_explicit
 
double output_dt
 
struct DiFfRG::AbstractTimestepper::ImplicitParameters impl
 
struct DiFfRG::AbstractTimestepper::ExplicitParameters expl
 
std::size_t next_jacobian_build_id = 0
 
TimestepperJacobianDiagnosticsState jacobian_diagnostics_state
 

Static Protected Attributes

static constexpr uint dim = dim_
 

Private Member Functions

void read_parameters ()
 

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 ConfigTree object, such as the timestep sizes, tolerances, verbosity, etc. that are used in the timestepping algorithms.

In the ConfigTree 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/implicit/max_steps: The maximal number of internal SUNDIALS steps between outputs.
  • /timestepping/implicit/max_non_linear_iterations: The maximal number of nonlinear IDA iterations.
  • /timestepping/implicit/jacobian_diagnostics: Whether the Jacobian diagnostics tables are written (default false).
  • /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.
  • /timestepping/explicit/detect_stuck: Whether repeated-time callback detection is enabled.

Additionally, the following parameters are being used:

  • /output/verbosity: At 0 no progress is printed; 1 reports residual work; 2 adds Jacobian, linear-solver, and solver diagnostics; 3 adds factorization and output work. Levels 1–4 are aggregated by the run reporter. Level 5 prints every progress event and is intended only for debugging.

Output settings, including the optional RG scale, are obtained from the typed ReportPort owned by the OutputSession. Timesteppers submit ProgressEvents directly; they never write to a stream.

Template Parameters
VectorType_The type of the vector used in the timestepping algorithm. Must satisfy SupportedVectorType: dealii::Vector<double> and dealii::BlockVector<double>, plus the PETSc MPI vectors in an MPI build.
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 = typename get_type::BlockVectorType<VectorType>
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() [1/2]

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::AbstractTimestepper ( const ConfigTree & config,
AbstractAssembler< VectorType, SparseMatrixType, dim > & assembler,
OutputSession_impl< dim, VectorType > & data_out,
const bool implicit_stepper,
const bool explicit_stepper )
inline

Construct a new Abstract Timestepper object.

Parameters
configThe ConfigTree object must contain a /timestepping/ section with all necessary parameters.
assemblerThe assembler object is used to assemble the system matrices and vectors for the timestepping algorithm.
data_outThe data output object is used to write the output data to disk.
adaptorThe adaptor object is used to adapt the mesh and the solution vector to the new mesh. The overload without it uses NoAdaptivity, i.e. no mesh adaptation.
implicit_stepper,explicit_stepperwhich /timestepping/ sections this stepper reads.

◆ AbstractTimestepper() [2/2]

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::AbstractTimestepper ( const ConfigTree & config,
AbstractAssembler< VectorType, SparseMatrixType, dim > & assembler,
OutputSession_impl< dim, VectorType > & data_out,
AbstractAdaptor< VectorType > & adaptor,
const bool implicit_stepper,
const bool explicit_stepper )
inline

Member Function Documentation

◆ drain_output()

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
void DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::drain_output ( )
inlineprotected

◆ finalize_output_after_failure()

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
template<typename EmitFinalFrame >
void DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::finalize_output_after_failure ( EmitFinalFrame && emit_final_frame)
inlineprotected

Best-effort output cleanup while a timestepping failure is being reported.

Writes one final frame for the state that failed, then pushes everything pending to disk. Both steps are swallowed on error: a readout that cannot cope with a diverged solution must not replace the failure the caller is actually trying to report, and a drain error is latched anyway and resurfaces at finish().

Callers rethrow the original exception afterwards.

◆ is_explicit()

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
bool DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::is_explicit ( ) const
inlineprotected

◆ is_implicit()

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
bool DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::is_implicit ( ) const
inlineprotected

◆ read_parameters()

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
void DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::read_parameters ( )
inlineprivate

◆ run()

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
virtual void DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::run ( AbstractFlowingVariables< NumberType, VectorType > & initial_condition,
const double t_start,
const double t_stop )
protectedpure 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_>
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

◆ config

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
const ConfigTree DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::config
protected

◆ data_out

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
OutputSession_impl<dim, VectorType>& DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::data_out
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

◆ jacobian_diagnostics_state

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
TimestepperJacobianDiagnosticsState DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::jacobian_diagnostics_state
protected

◆ log

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
ReportPort DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::log
protected

◆ m_is_explicit

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
const bool DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::m_is_explicit
protected

◆ m_is_implicit

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
const bool DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::m_is_implicit
protected

◆ next_jacobian_build_id

template<typename VectorType_ , typename SparseMatrixType_ , uint dim_>
std::size_t DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >::next_jacobian_build_id = 0
protected

◆ output_dt

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

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