GranOO  3.0
A robust and versatile workbench to build 3D dynamic simulations based on the Discrete Element Method
FastCalibration.hpp
Go to the documentation of this file.
1 // This file is part of GranOO, a workbench for DEM simulation.
2 //
3 // Author(s) : - Jean-luc CHARLES I2M-DuMAS/ENSAM Talence France
4 // <jean-luc.charles@ensam.eu>
5 // - Damien ANDRE SPCTS/ENS Ceramique industrielle, Limoges France
6 // <damien.andre@unilim.fr>
7 // - Jeremie GIRARDOT I2M-DuMAS/ENSAM Talence France
8 // <jeremie.girardot@ensam.eu>
9 // - Cedric Hubert LAMIH/UVHC Valenciennes France
10 // <cedric.hubert@univ-valenciennes.fr>
11 // - Ivan IORDANOFF I2M-DuMAS-MPI/ENSAM Talence France
12 // <ivan.iordanoff@ensam.eu>
13 // - Truong Thi NGUYEN SPCTS, Limoges France
14 // <truong_thi.nguyen@unilim.fr>
15 //
16 // Copyright (C) 2008-2016 JL. CHARLES, D. ANDRE, I. IORDANOFF, J. GIRARDOT, Truong Thi NGUYEN
17 //
18 // The magic numbers used in the following algorithm were found by Truong Thi NGUYEN !
19 // The C++ version was implemented by DA.
20 //
21 //
22 // This program is free software: you can redistribute it and/or modify
23 // it under the terms of the GNU General Public License as published by
24 // the Free Software Foundation, either version 3 of the License, or
25 // (at your option) any later version.
26 //
27 // This program is distributed in the hope that it will be useful,
28 // but WITHOUT ANY WARRANTY; without even the implied warranty of
29 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 // GNU General Public License for more details.
31 //
32 // You should have received a copy of the GNU General Public License
33 // along with this program. If not, see <http://www.gnu.org/licenses/>.
34 
35 #ifndef _LibAlgo_FastCalibration_HPP
36 #define _LibAlgo_FastCalibration_HPP
37 
38 
39 #include <array>
40 #include <complex>
41 
42 
43 namespace GranOO3
44 {
45  namespace Algo
46  {
47 
48  // lowercase class name : "fast_calibration"
49  namespace FastCalibration
50  {
51 
52  // This is magic numbers
53  const std::array<double,4 > params_a1{ 0.42927654,-0.18406061, 0.37603434, 0.02089117};
54  const std::array<double,4 > params_b1{-0.49868929, 0.50000024, 0.42710086,-0.08271247};
55  const std::array<double,4 > params_c1{ 0.25794931,-0.49710941, 0.51427798,-0.10744844};
56  const std::array<double,4 > params_d1{-0.10526749, 0.16929038, 0.59430784,-0.13338102};
57 
58  const std::array<double,4 > params_a2{-2.43078868e-02, 1.47594889e-02,-2.03651119e-03, 6.88939912e-05};
59  const std::array<double,4 > params_b2{ 0.23544764,-0.15279903, 0.02172656,-0.00075681 };
60  const std::array<double,4 > params_c2{-0.39811319, 0.26217126,-0.03078207, 0.00110456 };
61  const std::array<double,4 > params_d2{ 0.02003125, 0.01309331, 0.01443429,-0.00053369 };
62 
63  const std::array<double,10> params_k{-0.56467597, 0.20824953,-0.0076038, 0.67696577, 0.09327836,-0.02297966, 0.00095033,-0.73897768, 0.08437881,-0.00239614};
64 
65  // some math functions
66  double f_tanh(const double x, const std::array<double,4>& array);
67  double f_3rd_order(const double x, const std::array<double,4>& array);
68  double f_EM_Em_Rm(const double x, const double y, const std::array<double,4>& array);
69  double f_k_Cn_Rm(const double x, const double y, const std::array<double,10>& array);
70 
71  std::array<std::complex<double>,3> cubic_solve(const std::array<double,4>& array);
72  std::array<double,4> compute_param_elastic_Num(const double cn);
73  std::array<double,4> compute_param_elastic_Em(const double cn);
74  double compute_Rm(const std::array<double,4>& param, const double NuM);
75 
76  // This is the main function interface, it takes as argument :
77  // - EM : Macroscopic Young's modulus (Pa)
78  // - NuM : Macroscopic Poisson's ration
79  // - SM : Macroscopic failure strength (Pa)
80  // This function returns
81  // - Em : Microscopic Young's modulus
82  // - Rm : Microscopic radius ratio
83  // - Sm : Microscopic failure strength
84  void compute(const double EM, const double NuM, const double SM, const double cn, double& Em, double& Rm, double& Sm);
85 
86  }
87 
88  }
89 }
90 
91 #endif
const std::array< double, 4 > params_d1
Definition: FastCalibration.hpp:56
const std::array< double, 10 > params_k
Definition: FastCalibration.hpp:63
double f_k_Cn_Rm(const double x, const double y, const std::array< double, 10 > &array)
Definition: FastCalibration.cpp:79
double f_tanh(const double x, const std::array< double, 4 > &array)
Definition: FastCalibration.cpp:51
const std::array< double, 4 > params_c2
Definition: FastCalibration.hpp:60
const std::array< double, 4 > params_c1
Definition: FastCalibration.hpp:55
void compute(const double EM, const double NuM, const double SM, const double cn, double &Em, double &Rm, double &Sm)
Definition: FastCalibration.cpp:191
const std::array< double, 4 > params_a2
Definition: FastCalibration.hpp:58
double f_EM_Em_Rm(const double x, const double y, const std::array< double, 4 > &array)
Definition: FastCalibration.cpp:70
double f_3rd_order(const double x, const std::array< double, 4 > &array)
Definition: FastCalibration.cpp:61
const std::array< double, 4 > params_b1
Definition: FastCalibration.hpp:54
const std::array< double, 4 > params_d2
Definition: FastCalibration.hpp:61
std::array< double, 4 > compute_param_elastic_Em(const double cn)
Definition: FastCalibration.cpp:169
const std::array< double, 4 > params_a1
Definition: FastCalibration.hpp:53
double compute_Rm(const std::array< double, 4 > &param, const double NuM)
Definition: FastCalibration.cpp:178
const std::array< double, 4 > params_b2
Definition: FastCalibration.hpp:59
std::array< std::complex< double >, 3 > cubic_solve(const std::array< double, 4 > &array)
Definition: FastCalibration.cpp:93
std::array< double, 4 > compute_param_elastic_Num(const double cn)
Definition: FastCalibration.cpp:160
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)