Sandals  v0.0.0
A C++ library for ODEs/DAEs integration
Loading...
Searching...
No Matches
SSPIRK33.hh
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_SSPIRK33_HH
14#define SANDALS_SSPIRK33_HH
15
16#include <Sandals.hh>
17#include <Sandals/RungeKutta.hh>
18
19namespace Sandals
20{
38 template <typename Real>
39 class SSPIRK33Tableau : public Tableau<Real, 3>
40 {
41 public:
42 using typename Tableau<Real, 3>::Type;
43 using typename Tableau<Real, 3>::Vector;
44 using typename Tableau<Real, 3>::Matrix;
45
51 this->name = "SSPIRK33";
52 this->type = Type::DIRK;
53 this->order = 3;
54 Real t_1{1.0/2.0};
55 Real t_2{std::sqrt(2.0)/4.0};
56 Real t_3{1.0/3.0};
57 Real t_4{t_1-t_2};
58 Real t_5{t_1+t_2};
59 this->A << t_4, 0.0, 0.0,
60 t_2, t_4, 0.0,
61 t_2, t_2, t_4;
62 this->b << t_3, t_3, t_3;
63 this->c << t_4, t_1, t_5;
64 }
65 }; // class SSPIRK33Tableau
66
75 template <typename Real, Integer N, Integer M = 0>
76 class SSPIRK33 : public RungeKutta<Real, 3, N, M>
77 {
78 public:
80
85 SSPIRK33() : RungeKutta<Real, 3, N, M>(SSPIRK33Tableau<Real>()) {}
86
92 SSPIRK33(System t_system) : RungeKutta<Real, 3, N, M>(SSPIRK33Tableau<Real>(), t_system) {}
93
94 }; // class SSPIRK33
95
96} // namespace Sandals
97
98#endif // SANDALS_SSPIRK33_HH
std::shared_ptr< Implicit< Real, N, M > > Pointer
Definition Implicit.hh:47
RungeKutta(const RungeKutta &)=delete
SSPIRK33()
Definition SSPIRK33.hh:85
typename Implicit< Real, N, M >::Pointer System
Definition SSPIRK33.hh:79
SSPIRK33(System t_system)
Definition SSPIRK33.hh:92
Butcher tableau for the 3-stage diagonally-implicit strong-stability preserving Runge-Kuttax order 3 ...
Definition SSPIRK33.hh:40
SSPIRK33Tableau()
Definition SSPIRK33.hh:50
The namespace for the Sandals library.
Definition Sandals.hh:89
Struct container for the Butcher tableau of a Runge-Kutta method.
Definition Tableau.hh:38
enum class type :Integer {ERK=0, IRK=1, DIRK=2} Type
Definition Tableau.hh:42
Type type
Definition Tableau.hh:47
Integer order
Definition Tableau.hh:48
std::string name
Definition Tableau.hh:46
Eigen::Matrix< Real, S, S > Matrix
Definition Tableau.hh:44
Matrix A
Definition Tableau.hh:50
Eigen::Vector< Real, S > Vector
Definition Tableau.hh:43
Vector c
Definition Tableau.hh:53
Vector b
Definition Tableau.hh:51