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  //USEFULL
62  virtual void compute_load();
63  virtual std::string info() const;
64 
65  //ACCESSORS
66  GRANOO_ACCESS(mu , double, _mu ); // viscosity
67  GRANOO_ACCESS(beta, double, _beta); // viscosity constant in Arrhenius law
68  GRANOO_ACCESS(Q , double, _Q ); // activation energy
69 
70  private:
71  SinterNeck_Viscous() = delete;
72  SinterNeck_Viscous(const SinterNeck_Viscous& frame) = delete;
74 
75  private:
76  //SERIALIZATION
78  template<class Archive> void save(Archive&, const unsigned int ) const;
79  template<class Archive> void load(Archive&, const unsigned int);
81 
82 
83  private:
84  double _mu = 0.; // current viscosity
85  double _beta = 0.; // viscosity constant in Arrhenius law ( β )
86  double _Q = 0.; // activation energy (Q : J/mol)
87  };
88 
89 
90  template<class Archive> void
91  SinterNeck_Viscous::save(Archive& ar, const unsigned int v) const {
92  ar << boost::serialization::base_object<SinterNeck>(*this);
93  ar << _mu;
94  ar << _beta;
95  if (v >= 1)
96  ar << _Q;
97  }
98 
99  template<class Archive> void
100  SinterNeck_Viscous::load(Archive& ar, const unsigned int v) {
101  ar >> boost::serialization::base_object<SinterNeck>(*this);
102  ar >> _mu;
103  ar >> _beta;
104  if (v >= 1)
105  ar >> _Q;
106  }
107 
108 
109  }
110 }
111 
112 
113 #include <boost/serialization/version.hpp>
115 
116 // need placement new snippet because no default constructor exist
117 namespace boost
118 {
119  namespace serialization
120  {
121 
122  template<class Archive>
123  void save_construct_data(Archive & ar,
125  const unsigned int) {
126  const GranOO3::DEM::Element* de1 = &t->get_element1();
127  const GranOO3::DEM::Element* de2 = &t->get_element2();
128  ar << de1;
129  ar << de2;
130  }
131 
132  template<class Archive>
133  void load_construct_data(Archive & ar,
135  const unsigned int) {
136  GranOO3::DEM::Element* de1 = nullptr;
137  GranOO3::DEM::Element* de2 = nullptr;
138  ar >> de1;
139  ar >> de2;
140  ::new(t)GranOO3::DEM::SinterNeck_Viscous(*de1,*de2);
141  }
142 
143  }
144 } // namespace ...
145 
146 namespace GranOO3
147 {
148  GRANOO_CLASS_DECLARE_TPL(DEM::SinterNeck_Viscous);
149 }
150 
151 
152 #endif
153 
154 
BOOST_CLASS_VERSION(GranOO3::DEM::SinterNeck_Viscous, 1) namespace boost
Definition: SinterNeck_Viscous.hpp:114
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:125
void load(Archive &, const unsigned int)
Definition: SinterNeck_Viscous.hpp:100
void update_mu()
Definition: SinterNeck_Viscous.cpp:63
SinterNeck_Viscous & operator=(const SinterNeck_Viscous &)=delete
double _beta
Definition: SinterNeck_Viscous.hpp:85
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:86
friend class boost::serialization::access
Definition: SinterNeck_Viscous.hpp:77
SinterNeck_Viscous(const SinterNeck_Viscous &frame)=delete
void save(Archive &, const unsigned int) const
Definition: SinterNeck_Viscous.hpp:91
double _mu
Definition: SinterNeck_Viscous.hpp:84
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