Sandals  v0.0.0
A C++ library for ODEs/DAEs integration
Loading...
Searching...
No Matches
SSPRK104.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_SSPRK104_HH
14#define SANDALS_SSPRK104_HH
15
16#include <Sandals.hh>
17#include <Sandals/RungeKutta.hh>
18
19namespace Sandals
20{
44 template <typename Real>
45 class SSPRK104Tableau : public Tableau<Real, 10>
46 {
47 public:
48 using typename Tableau<Real, 10>::Type;
49 using typename Tableau<Real, 10>::Vector;
50 using typename Tableau<Real, 10>::Matrix;
51
56 this->name = "SSPRK104";
57 this->type = Type::ERK;
58 this->order = 4;
59 this->A << 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
60 1.0/6.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
61 1.0/6.0, 1.0/6.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
62 1.0/6.0, 1.0/6.0, 1.0/6.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
63 1.0/6.0, 1.0/6.0, 1.0/6.0, 1.0/6.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
64 1.0/15.0, 1.0/15.0, 1.0/15.0, 1.0/15.0, 1.0/15.0, 0.0, 0.0, 0.0, 0.0, 0.0,
65 1.0/15.0, 1.0/15.0, 1.0/15.0, 1.0/15.0, 1.0/15.0, 1.0/6.0, 0.0, 0.0, 0.0, 0.0,
66 1.0/15.0, 1.0/15.0, 1.0/15.0, 1.0/15.0, 1.0/15.0, 1.0/6.0, 1.0/6.0, 0.0, 0.0, 0.0,
67 1.0/15.0, 1.0/15.0, 1.0/15.0, 1.0/15.0, 1.0/15.0, 1.0/6.0, 1.0/6.0, 1.0/6.0, 0.0, 0.0,
68 1.0/15.0, 1.0/15.0, 1.0/15.0, 1.0/15.0, 1.0/15.0, 1.0/6.0, 1.0/6.0, 1.0/6.0, 1.0/6.0, 0.0;
69 this->b << 1.0/10.0, 1.0/10.0, 1.0/10.0, 1.0/10.0, 1.0/10.0, 1.0/10.0, 1.0/10.0, 1.0/10.0, 1.0/10.0, 1.0/10.0;
70 this->c << 0.0, 1.0/6.0, 1.0/3.0, 1.0/2.0, 2.0/3.0, 1.0/3.0, 1.0/2.0, 2.0/3.0, 5.0/6.0, 1.0;
71 }
72 }; // class SSPRK104Tableau
73
82 template <typename Real, Integer N, Integer M = 0>
83 class SSPRK104 : public RungeKutta<Real, 10, N, M>
84 {
85 public:
87
92 SSPRK104() : RungeKutta<Real, 10, N, M>(SSPRK104Tableau<Real>()) {}
93
99 SSPRK104(System t_system) : RungeKutta<Real, 10, N, M>(SSPRK104Tableau<Real>(), t_system) {}
100
101 }; // class SSPRK104
102
103} // namespace Sandals
104
105#endif // SANDALS_SSPRK104_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 SSPRK104.hh:86
SSPRK104(System t_system)
Definition SSPRK104.hh:99
SSPRK104()
Definition SSPRK104.hh:92
Butcher tableau for the 10-stage strong-stability preserving Runge-Kutta order 4 method.
Definition SSPRK104.hh:46
SSPRK104Tableau()
Definition SSPRK104.hh:55
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