Sandals  v0.0.0
A C++ library for ODEs/DAEs integration
Loading...
Searching...
No Matches
ExplicitEuler.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_EXPLICITEULER_HH
14#define SANDALS_EXPLICITEULER_HH
15
16#include <Sandals.hh>
17#include <Sandals/RungeKutta.hh>
18
19namespace Sandals
20{
35 template <typename Real>
36 class ExplicitEulerTableau : public Tableau<Real, 1>
37 {
38 public:
39 using typename Tableau<Real, 1>::Type;
40 using typename Tableau<Real, 1>::Vector;
41 using typename Tableau<Real, 1>::Matrix;
42
47 this->name = "ExplicitEuler";
48 this->type = Type::ERK;
49 this->order = 1;
50 this->A << 0.0;
51 this->b << 1.0;
52 this->c << 0.0;
53 }
54 }; // class ExplicitEulerTableau
55
64 template <typename Real, Integer N, Integer M = 0>
65 class ExplicitEuler : public RungeKutta<Real, 1, N, M>
66 {
67 public:
69
73 ExplicitEuler() : RungeKutta<Real, 1, N, M>(ExplicitEulerTableau<Real>()) {}
74
79 ExplicitEuler(System t_system) : RungeKutta<Real, 1, N, M>(ExplicitEulerTableau<Real>(), t_system) {}
80
81 }; // class ExplicitEuler
82
83} // namespace Sandals
84
85#endif // SANDALS_EXPLICITEULER_HH
typename Implicit< Real, N, M >::Pointer System
Definition ExplicitEuler.hh:68
ExplicitEuler(System t_system)
Definition ExplicitEuler.hh:79
ExplicitEuler()
Definition ExplicitEuler.hh:73
Butcher tableau for the Explicit Euler method.
Definition ExplicitEuler.hh:37
ExplicitEulerTableau()
Definition ExplicitEuler.hh:46
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