Sandals  v0.0.0
A C++ library for ODEs/DAEs integration
Loading...
Searching...
No Matches
GaussLegendre6.hxx
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_HXX
14#define SANDALS_GAUSSLEGENDRE6_HXX
15
16namespace Sandals
17{
18 /*
19 Symplectic Runge-Kutta Methods of High Order Based on W-Transformation, Kaifeng Xia, Yuhao Cong
20 and Geng Sun. Journal of Applied Analysis ans Computation, Volume 7, Number 3, 2017(8), 1185-1199
21 http://www.jaac-online.com/data/article/jaac/preview/pdf/20170325.pdf
22 */
23
43 {
44 public:
45 using Tableau<3>::Type;
46 using Tableau<3>::Vector;
47 using Tableau<3>::Matrix;
48
53 this->name = "GaussLegendre6";
54 this->type = Type::IRK;
55 this->order = 6;
56 Real t_1{std::sqrt(15.0)/10.0};
57 Real t_2{std::sqrt(15.0)/15.0};
58 Real t_3{std::sqrt(15.0)/24.0};
59 Real t_4{std::sqrt(15.0)/30.0};
60 Real w{5.0/36.0};
61 Real z{2.0/9.0};
62 this->A << w, z-t_2, w-t_4,
63 w+t_3, z, w-t_3,
64 w+t_4, z+t_2, w;
65 this->b << 5.0/18.0, 4.0/9.0, 5.0/18.0;
66 this->c << 1.0/2.0-t_1, 1.0/2.0, 1.0/2.0+t_1;
67 }
68 }; // class GaussLegendre6Tableau
69
77 template <Integer N, Integer M = 0>
78 class GaussLegendre6 : public RungeKutta<3, N, M>
79 {
80 public:
82
87
92 GaussLegendre6(System t_system) : RungeKutta<3, N, M>(GaussLegendre6Tableau(), t_system) {}
93
94 }; // class GaussLegendre6
95
96} // namespace Sandals
97
98#endif // SANDALS_GAUSSLEGENDRE6_HXX
GaussLegendre6(System t_system)
Definition GaussLegendre6.hxx:92
typename Implicit< N, M >::Pointer System
Definition GaussLegendre6.hxx:81
GaussLegendre6()
Definition GaussLegendre6.hxx:86
Butcher tableau for the Gauss-Legendre order 6 method.
Definition GaussLegendre6.hxx:43
GaussLegendre6Tableau()
Definition GaussLegendre6.hxx:52
std::shared_ptr< Implicit< N, M > > Pointer
Definition Implicit.hxx:42
RungeKutta(const RungeKutta &)=delete
The namespace for the Sandals library.
Definition Sandals.hh:73
double Real
Definition Sandals.hh:84
Struct container for the Butcher tableau of a Runge-Kutta method.
Definition Tableau.hxx:36
enum class type :Integer {ERK=0, IRK=1, DIRK=2} Type
Definition Tableau.hxx:37
Eigen::Matrix< Real, S, S > Matrix
Definition Tableau.hxx:39
Integer order
Definition Tableau.hxx:43
Type type
Definition Tableau.hxx:42
Eigen::Vector< Real, S > Vector
Definition Tableau.hxx:38
Matrix A
Definition Tableau.hxx:45
std::string name
Definition Tableau.hxx:41
Vector b
Definition Tableau.hxx:46
Vector c
Definition Tableau.hxx:48