Sandals  v0.0.0
A C++ library for ODEs/DAEs integration
Loading...
Searching...
No Matches
SSPRK93.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_SSPRK93_HH
14#define SANDALS_SSPRK93_HH
15
16#include <Sandals.hh>
17#include <Sandals/RungeKutta.hh>
18
19namespace Sandals
20{
43 template <typename Real>
44 class SSPRK93Tableau : public Tableau<Real, 9>
45 {
46 public:
47 using typename Tableau<Real, 9>::Type;
48 using typename Tableau<Real, 9>::Vector;
49 using typename Tableau<Real, 9>::Matrix;
50
55 this->name = "SSPRK93";
56 this->type = Type::ERK;
57 this->order = 3;
58 this->A << 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
59 1.0/6.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
60 1.0/6.0, 1.0/6.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
61 1.0/6.0, 1.0/6.0, 1.0/6.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, 1.0/6.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, 1.0/6.0, 0.0, 0.0, 0.0, 0.0,
64 1.0/6.0, 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,
65 1.0/6.0, 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,
66 1.0/6.0, 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;
67 this->b << 1.0/6.0, 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;
68 this->c << 0.0, 1.0/6.0, 1.0/3.0, 1.0/2.0, 2.0/3.0, 5.0/6.0, 1.0/2.0, 2.0/3.0, 5.0/6.0;
69 }
70 }; // class SSPRK93Tableau
71
80 template <typename Real, Integer N, Integer M = 0>
81 class SSPRK93 : public RungeKutta<Real, 9, N, M>
82 {
83 public:
85
90 SSPRK93() : RungeKutta<Real, 9, N, M>(SSPRK93Tableau<Real>()) {}
91
97 SSPRK93(System t_system) : RungeKutta<Real, 9, N, M>(SSPRK93Tableau<Real>(), t_system) {}
98
99 }; // class SSPRK93
100
101} // namespace Sandals
102
103#endif // SANDALS_SSPRK93_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 SSPRK93.hh:84
SSPRK93(System t_system)
Definition SSPRK93.hh:97
SSPRK93()
Definition SSPRK93.hh:90
Butcher tableau for the 9-stage strong-stability preserving Runge-Kutta order 3 method.
Definition SSPRK93.hh:45
SSPRK93Tableau()
Definition SSPRK93.hh:54
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