Sandals  v0.0.0
A C++ library for ODEs/DAEs integration
Loading...
Searching...
No Matches
SSPIRK33.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_SSPIRK33_HXX
14#define SANDALS_SSPIRK33_HXX
15
16namespace Sandals
17{
34 class SSPIRK33Tableau : public Tableau<3>
35 {
36 public:
37 using Tableau<3>::Type;
38 using Tableau<3>::Vector;
39 using Tableau<3>::Matrix;
40
46 this->name = "SSPIRK33";
47 this->type = Type::DIRK;
48 this->order = 3;
49 Real t_1{1.0/2.0};
50 Real t_2{std::sqrt(2.0)/4.0};
51 Real t_3{1.0/3.0};
52 Real t_4{t_1-t_2};
53 Real t_5{t_1+t_2};
54 this->A << t_4, 0.0, 0.0,
55 t_2, t_4, 0.0,
56 t_2, t_2, t_4;
57 this->b << t_3, t_3, t_3;
58 this->c << t_4, t_1, t_5;
59 }
60 }; // class SSPIRK33Tableau
61
69 template <Integer N, Integer M = 0>
70 class SSPIRK33 : public RungeKutta<3, N, M>
71 {
72 public:
74
80
86 SSPIRK33(System t_system) : RungeKutta<3, N, M>(SSPIRK33Tableau(), t_system) {}
87
88 }; // class SSPIRK33
89
90} // namespace Sandals
91
92#endif // SANDALS_SSPIRK33_HXX
std::shared_ptr< Implicit< N, M > > Pointer
Definition Implicit.hxx:42
RungeKutta(const RungeKutta &)=delete
SSPIRK33()
Definition SSPIRK33.hxx:79
SSPIRK33(System t_system)
Definition SSPIRK33.hxx:86
typename Implicit< N, M >::Pointer System
Definition SSPIRK33.hxx:73
Butcher tableau for the 3-stage diagonally-implicit strong-stability preserving Runge-Kuttax order 3 ...
Definition SSPIRK33.hxx:35
SSPIRK33Tableau()
Definition SSPIRK33.hxx:45
The namespace for the Sandals library.
Definition Sandals.hh:73
double Real
Definition Sandals.hh:84
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