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