GranOO  3.0
A robust and versatile workbench to build 3D dynamic simulations based on the Discrete Element Method
SinterNeck_Viscous.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 //
14 // Copyright (C) 2008-2019 D. Andre, JL. Charles, J. Girardot, C. Hubert, I. Iordanoff
15 //
16 // This program is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 // This program is distributed in the hope that it will be useful,
22 // but WITHOUT ANY WARRANTY; without even the implied warranty of
23 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 // GNU General Public License for more details.
25 //
26 // You should have received a copy of the GNU General Public License
27 // along with this program. If not, see <http://www.gnu.org/licenses/>.
28 
29 
30 #ifndef _libDEM_SinterNeck_Viscous_hpp_
31 #define _libDEM_SinterNeck_Viscous_hpp_
32 
33 #include <string>
34 #include <vector>
35 
36 
37 
38 
40 
41 namespace GranOO3
42 {
43  namespace DEM
44  {
45 
46 
48  public Core::Register< SinterNeck_Viscous >
49  {
50 
51  GRANOO_CLASS(DEM::SinterNeck_Viscous, SinterNeck);
52 
53 
54  public:
55  //CONSTRUCTORS & DESTRUCTORS
57  virtual ~SinterNeck_Viscous();
58 
59  void update_delta_b() {};
60  void update_mu();
61  void update_viscous_a();
62  //USEFULL
63  virtual void compute_load();
64  virtual std::string info() const;
65 
66  //ACCESSORS
67  GRANOO_ACCESS(mu , double, _mu ); // viscosity
68  GRANOO_ACCESS(beta, double, _beta); // viscosity constant in Arrhenius law
69  GRANOO_ACCESS(Q , double, _Q ); // activation energy
70  GRANOO_ACCESS(K , double, _K ); // activation energy
71 
72  private:
73  SinterNeck_Viscous() = delete;
74  SinterNeck_Viscous(const SinterNeck_Viscous& frame) = delete;
76 
77  private:
78  //SERIALIZATION
80  template<class Archive> void save(Archive&, const unsigned int ) const;
81  template<class Archive> void load(Archive&, const unsigned int);
83 
84 
85  private:
86  double _mu = 0.; // current viscosity
87  double _beta = 0.; // viscosity constant in Arrhenius law ( β )
88  double _Q = 0.; // activation energy (Q : J/mol)
89  double _K = 1.; // Frenkel's law factor
90  };
91 
92 
93  template<class Archive> void
94  SinterNeck_Viscous::save(Archive& ar, const unsigned int v) const {
95  ar << boost::serialization::base_object<SinterNeck>(*this);
96  ar << _mu;
97  ar << _beta;
98  if (v >= 1)
99  ar << _Q;
100  if (v >= 2)
101  ar << _K;
102  }
103 
104  template<class Archive> void
105  SinterNeck_Viscous::load(Archive& ar, const unsigned int v) {
106  ar >> boost::serialization::base_object<SinterNeck>(*this);
107  ar >> _mu;
108  ar >> _beta;
109  if (v >= 1)
110  ar >> _Q;
111  if (v >= 2)
112  ar >> _K;
113  }
114 
115 
116  }
117 }
118 
119 
120 #include <boost/serialization/version.hpp>
122 
123 // need placement new snippet because no default constructor exist
124 namespace boost
125 {
126  namespace serialization
127  {
128 
129  template<class Archive>
130  void save_construct_data(Archive & ar,
132  const unsigned int) {
133  const GranOO3::DEM::Element* de1 = &t->get_element1();
134  const GranOO3::DEM::Element* de2 = &t->get_element2();
135  ar << de1;
136  ar << de2;
137  }
138 
139  template<class Archive>
140  void load_construct_data(Archive & ar,
142  const unsigned int) {
143  GranOO3::DEM::Element* de1 = nullptr;
144  GranOO3::DEM::Element* de2 = nullptr;
145  ar >> de1;
146  ar >> de2;
147  ::new(t)GranOO3::DEM::SinterNeck_Viscous(*de1,*de2);
148  }
149 
150  }
151 } // namespace ...
152 
153 namespace GranOO3
154 {
155  GRANOO_CLASS_DECLARE_TPL(DEM::SinterNeck_Viscous);
156 }
157 
158 
159 #endif
160 
161 
BOOST_CLASS_VERSION(GranOO3::DEM::SinterNeck_Viscous, 2) namespace boost
Definition: SinterNeck_Viscous.hpp:121
Definition: SetOf.hpp:346
a base class that represents an element
Definition: Element.hpp:55
Definition: SinterNeck_Viscous.hpp:49
virtual std::string info() const
Display some useful info in the terminal
Definition: SinterNeck_Viscous.cpp:137
void load(Archive &, const unsigned int)
Definition: SinterNeck_Viscous.hpp:105
double _K
Definition: SinterNeck_Viscous.hpp:89
void update_mu()
Definition: SinterNeck_Viscous.cpp:63
SinterNeck_Viscous & operator=(const SinterNeck_Viscous &)=delete
double _beta
Definition: SinterNeck_Viscous.hpp:87
void update_viscous_a()
Definition: SinterNeck_Viscous.cpp:124
virtual ~SinterNeck_Viscous()
Definition: SinterNeck_Viscous.cpp:57
void update_delta_b()
Definition: SinterNeck_Viscous.hpp:59
virtual void compute_load()
compute the reaction force and torque of the bond
Definition: SinterNeck_Viscous.cpp:69
double _Q
Definition: SinterNeck_Viscous.hpp:88
friend class boost::serialization::access
Definition: SinterNeck_Viscous.hpp:79
SinterNeck_Viscous(const SinterNeck_Viscous &frame)=delete
void save(Archive &, const unsigned int) const
Definition: SinterNeck_Viscous.hpp:94
double _mu
Definition: SinterNeck_Viscous.hpp:86
Definition: SinterNeck.hpp:55
Definition: Common.hpp:198
void save_construct_data(Archive &ar, const GranOO3::Core::Pair< type > *t, const unsigned int)
Definition: Pair.hpp:207
void load_construct_data(Archive &ar, GranOO3::Core::Pair< type > *t, const unsigned int)
Definition: Pair.hpp:217
Definition: Pair.hpp:202
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 t(t+t)") define_sfop3(16