/home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/timestepping/trbdf2.hh Source File#

DiFfRG: /home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/timestepping/trbdf2.hh Source File
DiFfRG
Discretization Framework for functional Renormalization Group flows
trbdf2.hh
Go to the documentation of this file.
1#pragma once
2
3// DiFfRG
15
16namespace DiFfRG
17{
18 template <typename VectorType, typename SparseMatrixType, uint dim,
19 template <typename...> typename LinearSolver>
20 class TimeStepperTRBDF2_impl : public AbstractTimestepper<VectorType, SparseMatrixType, dim>
21 {
23
24 public:
25 using NumberType = typename Base::NumberType;
27
43
44 virtual void run(AbstractFlowingVariables<NumberType, VectorType> &initial_condition, const double t_start,
45 const double t_stop) override;
46
48 double get_error();
49 void set_ignore_nonconv(bool x);
50
51 private:
52 std::shared_ptr<Newton<VectorType>> ptr_newton_TR;
53 std::shared_ptr<Newton<VectorType>> ptr_newton_BDF2;
54 };
55
56 // ##############################################################################
57 // Application-facing spelling
58 // ##############################################################################
59 //
60 // The class above takes the linear algebra spelled out because it is compiled out of line: the
61 // set of valid arguments is closed by the explicit instantiations in src/, and keying it on the
62 // assembler would explode that set into one instantiation per model. Applications name the
63 // assembler instead and let these aliases project it onto that fixed parameter list.
64 //
65 // The argument is anything exposing VectorType, SparseMatrixType and dim -- an Assembler, or a
66 // Discretization where the assembler type is not a single type (e.g. a test that runs one
67 // discretization against several models).
68 //
69 // The solver defaults to DefaultLinearSolver, which follows the linear algebra: UMFPack when it
70 // is serial, a distributed direct solve when it is not. Note that <Assembler> and
71 // <Assembler, UMFPack> are *different types* even in a serial build -- see the comment on
72 // DefaultLinearSolver -- so both need their own explicit instantiation.
73 template <typename Assembler, template <typename...> typename LinearSolver = DefaultLinearSolver>
74 using TimeStepperTRBDF2 = TimeStepperTRBDF2_impl<typename Assembler::VectorType, typename Assembler::SparseMatrixType,
75 Assembler::dim, LinearSolver>;
76} // namespace DiFfRG
Implement a simple interface to do all adaptivity tasks, i.e. solution transfer, reinit of dofHandler...
Definition abstract_adaptor.hh:11
This is the general assembler interface for any kind of discretization. An assembler is responsible f...
Definition abstract_assembler.hh:54
A class to set up initial data for whatever discretization we have chosen. Also used to switch/manage...
Definition abstract_data.hh:21
The abstract base class for all timestepping algorithms. It provides a standard constructor which pop...
Definition abstract_timestepper.hh:155
struct DiFfRG::AbstractTimestepper::ExplicitParameters expl
typename get_type::BlockVectorType< VectorType > BlockVectorType
Definition abstract_timestepper.hh:169
AbstractAssembler< VectorType, SparseMatrixType, dim > & assembler
Definition abstract_timestepper.hh:309
OutputSession_impl< dim, VectorType > & data_out
Definition abstract_timestepper.hh:310
AbstractAdaptor< VectorType > & adaptor
Definition abstract_timestepper.hh:311
typename get_type::NumberType< VectorType > NumberType
Definition abstract_timestepper.hh:159
const ConfigTree config
Definition abstract_timestepper.hh:307
struct DiFfRG::AbstractTimestepper::ImplicitParameters impl
double output_dt
Definition abstract_timestepper.hh:318
A hierarchical configuration tree, readable from JSON and TOML files.
Definition config_tree.hh:32
Definition output_session.hh:176
Definition trbdf2.hh:21
typename Base::BlockVectorType BlockVectorType
Definition trbdf2.hh:26
TimeStepperTRBDF2_impl(const ConfigTree &config, AbstractAssembler< VectorType, SparseMatrixType, dim > &assembler, OutputSession_impl< dim, VectorType > &data_out)
Definition trbdf2.hh:32
virtual void run(AbstractFlowingVariables< NumberType, VectorType > &initial_condition, const double t_start, const double t_stop) override
Any derived class must implement this method to run the timestepping algorithm.
std::shared_ptr< Newton< VectorType > > ptr_newton_TR
Definition trbdf2.hh:52
TimeStepperTRBDF2_impl(const ConfigTree &config, AbstractAssembler< VectorType, SparseMatrixType, dim > &assembler, OutputSession_impl< dim, VectorType > &data_out, AbstractAdaptor< VectorType > &adaptor)
Definition trbdf2.hh:37
typename Base::NumberType NumberType
Definition trbdf2.hh:25
std::shared_ptr< Newton< VectorType > > ptr_newton_BDF2
Definition trbdf2.hh:53
The linear solver a timestepper uses when the application does not name one.
Definition complex_math.hh:10
typename internal::_default_solver< SparseMatrixType, VectorType >::type DefaultLinearSolver
The build-configuration-dependent default linear solver.
Definition default_linear_solver.hh:66
unsigned int uint
Definition utils.hh:24