Sandals  v0.0.0
A C++ library for ODEs/DAEs integration
Loading...
Searching...
No Matches
SSPRK22star.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_SSPRK22STAR_HH
14#define SANDALS_SSPRK22STAR_HH
15
16#include <Sandals.hh>
17#include <Sandals/RungeKutta.hh>
18
19namespace Sandals
20{
37 template <typename Real>
38 class SSPRK22starTableau : public Tableau<Real, 2>
39 {
40 public:
41 using typename Tableau<Real, 2>::Type;
42 using typename Tableau<Real, 2>::Vector;
43 using typename Tableau<Real, 2>::Matrix;
44
49 this->name = "SSPRK22star";
50 this->type = Type::ERK;
51 this->order = 2;
52 this->A << 0.0, 0.0,
53 0.822875655532364, 0.0;
54 this->b << 0.392374781489287, 0.607625218510713;
55 this->c << 0.0, 0.822875655532364;
56 }
57 }; // class SSPRK22starTableau
58
67 template <typename Real, Integer N, Integer M = 0>
68 class SSPRK22star : public RungeKutta<Real, 2, N, M>
69 {
70 public:
72
77 SSPRK22star() : RungeKutta<Real, 2, N, M>(SSPRK22starTableau<Real>()) {}
78
84 SSPRK22star(System t_system) : RungeKutta<Real, 2, N, M>(SSPRK22starTableau<Real>(), t_system) {}
85
86 }; // class SSPRK22star
87
88} // namespace Sandals
89
90#endif // SANDALS_SSPRK22STAR_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 SSPRK22star.hh:71
SSPRK22star()
Definition SSPRK22star.hh:77
SSPRK22star(System t_system)
Definition SSPRK22star.hh:84
Butcher tableau for the optimal 2-stage strong-stability preserving Runge-Kutta order 2 method.
Definition SSPRK22star.hh:39
SSPRK22starTableau()
Definition SSPRK22star.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