Sandals  v0.0.0
A C++ library for ODEs/DAEs integration
Loading...
Searching...
No Matches
SSPRK33.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_SSPRK33_HH
14#define SANDALS_SSPRK33_HH
15
16#include <Sandals.hh>
17#include <Sandals/RungeKutta.hh>
18
19namespace Sandals
20{
37 template <typename Real>
38 class SSPRK33Tableau : public Tableau<Real, 3>
39 {
40 public:
41 using typename Tableau<Real, 3>::Type;
42 using typename Tableau<Real, 3>::Vector;
43 using typename Tableau<Real, 3>::Matrix;
44
49 this->name = "SSPRK33";
50 this->type = Type::ERK;
51 this->order = 3;
52 this->A << 0.0, 0.0, 0.0,
53 1.0, 0.0, 0.0,
54 1.0/4.0, 1.0/4.0, 0.0;
55 this->b << 1.0/6.0, 1.0/6.0, 2.0/3.0;
56 this->c << 0.0, 1.0, 1.0/2.0;
57 }
58 }; // class SSPRK33Tableau
59
68 template <typename Real, Integer N, Integer M = 0>
69 class SSPRK33 : public RungeKutta<Real, 3, N, M>
70 {
71 public:
73
78 SSPRK33() : RungeKutta<Real, 3, N, M>(SSPRK33Tableau<Real>()) {}
79
85 SSPRK33(System t_system) : RungeKutta<Real, 3, N, M>(SSPRK33Tableau<Real>(), t_system) {}
86
87 }; // class SSPRK33
88
89} // namespace Sandals
90
91#endif // SANDALS_SSPRK33_HH
std::shared_ptr< Implicit< Real, N, M > > Pointer
Definition Implicit.hh:47
RungeKutta(const RungeKutta &)=delete
typename Implicit< Real, N, M >::Pointer System
Definition SSPRK33.hh:72
SSPRK33()
Definition SSPRK33.hh:78
SSPRK33(System t_system)
Definition SSPRK33.hh:85
Butcher tableau for the 3-stage strong-stability preserving Runge-Kutta order 3 method.
Definition SSPRK33.hh:39
SSPRK33Tableau()
Definition SSPRK33.hh:48
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