Sandals  v0.0.0
A C++ library for ODEs/DAEs integration
Loading...
Searching...
No Matches
SSPRK22.hxx
Go to the documentation of this file.
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 * Copyright (c) 2025, Davide Stocco and Enrico Bertolazzi. *
3 * *
4 * The Sandals project is distributed under the BSD 2-Clause License. *
5 * *
6 * Davide Stocco Enrico Bertolazzi *
7 * University of Trento University of Trento *
8 * e-mail: davide.stocco@unitn.it e-mail: enrico.bertolazzi@unitn.it *
9\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
10
11#pragma once
12
13#ifndef SANDALS_SSPRK22_HXX
14#define SANDALS_SSPRK22_HXX
15
16namespace Sandals
17{
32 class SSPRK22Tableau : public Tableau<2>
33 {
34 public:
35 using Tableau<2>::Type;
36 using Tableau<2>::Vector;
37 using Tableau<2>::Matrix;
38
43 this->name = "SSPRK22";
44 this->type = Type::ERK;
45 this->order = 2;
46 this->A << 0.0, 0.0,
47 1.0, 0.0;
48 this->b << 1.0/2.0, 1.0/2.0;
49 this->c << 0.0, 1.0;
50 }
51 }; // class SSPRK22Tableau
52
60 template <Integer N, Integer M = 0>
61 class SSPRK22 : public RungeKutta<2, N, M>
62 {
63 public:
65
71
77 SSPRK22(System t_system) : RungeKutta<2, N, M>(SSPRK22Tableau(), t_system) {}
78
79 }; // class SSPRK22
80
81} // namespace Sandals
82
83#endif // SANDALS_SSPRK22_HXX
std::shared_ptr< Implicit< N, M > > Pointer
Definition Implicit.hxx:42
RungeKutta(const RungeKutta &)=delete
SSPRK22(System t_system)
Definition SSPRK22.hxx:77
SSPRK22()
Definition SSPRK22.hxx:70
typename Implicit< N, M >::Pointer System
Definition SSPRK22.hxx:64
Butcher tableau for the 2-stage strong-stability preserving Runge-Kutta (or Heun) order 2 method.
Definition SSPRK22.hxx:33
SSPRK22Tableau()
Definition SSPRK22.hxx:42
The namespace for the Sandals library.
Definition Sandals.hh:73
Struct container for the Butcher tableau of a Runge-Kutta method.
Definition Tableau.hxx:36
enum class type :Integer {ERK=0, IRK=1, DIRK=2} Type
Definition Tableau.hxx:37
Eigen::Matrix< Real, S, S > Matrix
Definition Tableau.hxx:39
Integer order
Definition Tableau.hxx:43
Type type
Definition Tableau.hxx:42
Eigen::Vector< Real, S > Vector
Definition Tableau.hxx:38
Matrix A
Definition Tableau.hxx:45
std::string name
Definition Tableau.hxx:41
Vector b
Definition Tableau.hxx:46
Vector c
Definition Tableau.hxx:48