Sandals  v0.0.0
A C++ library for ODEs/DAEs integration
Loading...
Searching...
No Matches
GaussLegendre6.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_GAUSSLEGENDRE6_HH
14#define SANDALS_GAUSSLEGENDRE6_HH
15
16#include <Sandals.hh>
17#include <Sandals/RungeKutta.hh>
18
19namespace Sandals
20{
21 /*
22 Symplectic Runge-Kutta Methods of High Order Based on W-Transformation, Kaifeng Xia, Yuhao Cong
23 and Geng Sun. Journal of Applied Analysis ans Computation, Volume 7, Number 3, 2017(8), 1185-1199
24 http://www.jaac-online.com/data/article/jaac/preview/pdf/20170325.pdf
25 */
26
45 template <typename Real>
46 class GaussLegendre6Tableau : public Tableau<Real, 3>
47 {
48 public:
49 using typename Tableau<Real, 3>::Type;
50 using typename Tableau<Real, 3>::Vector;
51 using typename Tableau<Real, 3>::Matrix;
52
57 this->name = "GaussLegendre6";
58 this->type = Type::IRK;
59 this->order = 6;
60 Real t_1{std::sqrt(15.0)/10.0};
61 Real t_2{std::sqrt(15.0)/15.0};
62 Real t_3{std::sqrt(15.0)/24.0};
63 Real t_4{std::sqrt(15.0)/30.0};
64 Real w{5.0/36.0};
65 Real z{2.0/9.0};
66 this->A << w, z-t_2, w-t_4,
67 w+t_3, z, w-t_3,
68 w+t_4, z+t_2, w;
69 this->b << 5.0/18.0, 4.0/9.0, 5.0/18.0;
70 this->c << 1.0/2.0-t_1, 1.0/2.0, 1.0/2.0+t_1;
71 }
72 }; // class GaussLegendre6Tableau
73
82 template <typename Real, Integer N, Integer M = 0>
83 class GaussLegendre6 : public RungeKutta<Real, 3, N, M>
84 {
85 public:
87
91 GaussLegendre6() : RungeKutta<Real, 3, N, M>(GaussLegendre6Tableau<Real>()) {}
92
97 GaussLegendre6(System t_system) : RungeKutta<Real, 3, N, M>(GaussLegendre6Tableau<Real>(), t_system) {}
98
99 }; // class GaussLegendre6
100
101} // namespace Sandals
102
103#endif // SANDALS_GAUSSLEGENDRE6_HH
GaussLegendre6()
Definition GaussLegendre6.hh:91
GaussLegendre6(System t_system)
Definition GaussLegendre6.hh:97
typename Implicit< Real, N, M >::Pointer System
Definition GaussLegendre6.hh:86
Butcher tableau for the Gauss-Legendre order 6 method.
Definition GaussLegendre6.hh:47
GaussLegendre6Tableau()
Definition GaussLegendre6.hh:56
std::shared_ptr< Implicit< Real, N, M > > Pointer
Definition Implicit.hh:47
RungeKutta(const RungeKutta &)=delete
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