Sandals  v0.0.0
A C++ library for ODEs/DAEs integration
Loading...
Searching...
No Matches
GaussLegendre4.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_GAUSSLEGENDRE4_HXX
14#define SANDALS_GAUSSLEGENDRE4_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
41 {
42 public:
43 using Tableau<2>::Type;
44 using Tableau<2>::Vector;
45 using Tableau<2>::Matrix;
46
51 this->name = "GaussLegendre4";
52 this->type = Type::IRK;
53 this->order = 4;
54 Real t{std::sqrt(3.0)/6.0};
55 this->A << 1.0/4.0, 1.0/4.0-t,
56 1.0/4.0+t, 1.0/4.0;
57 this->b << 1.0/2.0, 1.0/2.0;
58 this->c << 1.0/2.0-t, 1.0/2.0+t;
59 }
60 }; // class GaussLegendre4Tableau
61
69 template <Integer N, Integer M = 0>
70 class GaussLegendre4 : public RungeKutta<2, N, M>
71 {
72 public:
74
79
84 GaussLegendre4(System t_system) : RungeKutta<2, N, M>(GaussLegendre4Tableau(), t_system) {}
85
86 }; // class GaussLegendre4
87
88} // namespace Sandals
89
90#endif // SANDALS_GAUSSLEGENDRE4_HXX
typename Implicit< N, M >::Pointer System
Definition GaussLegendre4.hxx:73
GaussLegendre4(System t_system)
Definition GaussLegendre4.hxx:84
GaussLegendre4()
Definition GaussLegendre4.hxx:78
Butcher Tableau for the Gauss-Legendre order 4 method.
Definition GaussLegendre4.hxx:41
GaussLegendre4Tableau()
Definition GaussLegendre4.hxx:50
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