GranOO  3.0
A robust and versatile workbench to build 3D dynamic simulations based on the Discrete Element Method
TanhAndConstant.hpp
Go to the documentation of this file.
1 // This file is part of GranOO, a workbench for DEM simulation.
2 //
3 // Author(s) : - Damien Andre IRCER/UNILIM, Limoges France
4 // <damien.andre@unilim.fr>
5 // - Jean-luc Charles Arts et Metiers ParisTech, CNRS, I2M, Bordeaux France
6 // <jean-luc.charles@ensam.eu>
7 // - Jeremie Girardot Arts et Metiers ParisTech, CNRS, I2M, Bordeaux France
8 // <jeremie.girardot@ensam.eu>
9 // - Cedric Hubert LAMIH/UPHF, Valenciennes France
10 // <cedric.hubert@uphf.fr>
11 // - Ivan Iordanoff Arts et Metiers ParisTech, CNRS, I2M, Bordeaux France
12 // <ivan.iordanoff@ensam.eu>
13 // - Harikeshava RANGANATHAN IRCER, Limoges France/IMERYS, Lyon France
14 // <harikeshava.ranganathan@unilim.fr>
15 //
16 // Copyright (C) 2008-2019 D. Andre, JL. Charles, J. Girardot, C. Hubert, I. Iordanoff
17 // Copyright (C) 2023 H. RANGANATHAN
18 //
19 // This program is free software: you can redistribute it and/or modify
20 // it under the terms of the GNU General Public License as published by
21 // the Free Software Foundation, either version 3 of the License, or
22 // (at your option) any later version.
23 //
24 // This program is distributed in the hope that it will be useful,
25 // but WITHOUT ANY WARRANTY; without even the implied warranty of
26 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 // GNU General Public License for more details.
28 //
29 // You should have received a copy of the GNU General Public License
30 // along with this program. If not, see <http://www.gnu.org/licenses/>.
31 //
32 
33 
34 #ifndef _GranOO_Math_Function_TanhAnd_Constanthpp_
35 #define _GranOO_Math_Function_TanhAnd_Constanthpp_
36 
38 
39 namespace GranOO3
40 {
41  namespace Math
42  {
43  //---------------------------------------------------//
44  // TanhAndConstant: f(x) = (e^x - e^-x)/(e^x + e^-x)//
45  //---------------------------------------------------//
46 
47  class TanhAndConstant : public FunctionT<TanhAndConstant>
48  {
49  public:
50  static std::string class_ID() {return "TanhAndConstant";}
51 
53  TanhAndConstant(const std::string& symbol, const std::string desc = "");
54  TanhAndConstant(const double& x, double lim, double cst, double cst1);
56 
57  double operator()();
58  double operator()(const double& x, const double& lim, const double& cst, const double& cst1);
59 
60  private:
61  TanhAndConstant(const TanhAndConstant&) = delete;
63 
64  private:
65  const double* _x;
66  double _lim;
67  double _cst;
68  double _cst1;
69 
70  };
71  }
72 }
73 #endif
Definition: FunctionT.hpp:48
Definition: TanhAndConstant.hpp:48
~TanhAndConstant()
Definition: TanhAndConstant.cpp:57
static std::string class_ID()
Definition: TanhAndConstant.hpp:50
double _cst1
Definition: TanhAndConstant.hpp:68
TanhAndConstant(const TanhAndConstant &)=delete
TanhAndConstant()
Definition: TanhAndConstant.cpp:42
const double * _x
Definition: TanhAndConstant.hpp:65
double _lim
Definition: TanhAndConstant.hpp:66
TanhAndConstant & operator=(const TanhAndConstant &)=delete
double _cst
Definition: TanhAndConstant.hpp:67
double operator()()
Definition: TanhAndConstant.cpp:61
static const char * desc
Definition: Between2SetOf.cpp:37
Definition: Common.hpp:198
x y t t *t x y t t t x y t t t x *y t *t t x *y t *t t x y t t t x y t t t x(y+z)