GranOO  3.0
A robust and versatile workbench to build 3D dynamic simulations based on the Discrete Element Method
SinterNeck_Rojek.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_Rojek_hpp_
31 #define _libDEM_SinterNeck_Rojek_hpp_
32 
33 #include <string>
34 #include <vector>
35 
36 
37 
38 
40 
41 namespace GranOO3
42 {
43  namespace DEM
44  {
45 
46 
47  class SinterNeck_Rojek : public SinterNeck,
48  public Core::Register< SinterNeck_Rojek >
49  {
50 
51  GRANOO_CLASS(DEM::SinterNeck_Rojek, SinterNeck);
52 
53 
54  public:
55  //CONSTRUCTORS & DESTRUCTORS
56  SinterNeck_Rojek(Element& el1, Element& el2);
57  virtual ~SinterNeck_Rojek();
58 
59  //USEFULL
60  virtual void compute_load();
61  virtual std::string info() const;
62 
63  // UPDATE PARAMETERS
64  void update_delta_b();
65 
66  //ACCESSORS
67  GRANOO_ACCESS(Dg_x_delta_g, double, _Dg_x_delta_g ); // diffusion coefficient
68  GRANOO_ACCESS(psi , double, _psi ); // dihedral angle
69 
70  private:
71  SinterNeck_Rojek() = delete;
72  SinterNeck_Rojek(const SinterNeck_Rojek& 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  protected:
83  // Parameter
84  double _Dg_x_delta_g = 0.; // diffusion coefficient (Dg.δg: Rojek)
85  double _psi = 0.; // dihedral angle ( Ψ: Rojek)
86 
87  };
88 
89 
90  template<class Archive> void
91  SinterNeck_Rojek::save(Archive& ar, const unsigned int v) const {
92  ar << boost::serialization::base_object<SinterNeck>(*this);
93  ar << _Dg_x_delta_g;
94  ar << _psi;
95 
96 
97  }
98 
99  template<class Archive> void
100  SinterNeck_Rojek::load(Archive& ar, const unsigned int v) {
101  ar >> boost::serialization::base_object<SinterNeck>(*this);
102  ar >> _Dg_x_delta_g;
103  ar >> _psi;
104  }
105 
106 
107  }
108 }
109 
110 
111 #include <boost/serialization/version.hpp>
113 
114 // need placement new snippet because no default constructor exist
115 namespace boost
116 {
117  namespace serialization
118  {
119 
120  template<class Archive>
121  void save_construct_data(Archive & ar,
123  const unsigned int) {
124  const GranOO3::DEM::Element* de1 = &t->get_element1();
125  const GranOO3::DEM::Element* de2 = &t->get_element2();
126  ar << de1;
127  ar << de2;
128  }
129 
130  template<class Archive>
131  void load_construct_data(Archive & ar,
133  const unsigned int) {
134  GranOO3::DEM::Element* de1 = nullptr;
135  GranOO3::DEM::Element* de2 = nullptr;
136  ar >> de1;
137  ar >> de2;
138  ::new(t)GranOO3::DEM::SinterNeck_Rojek(*de1,*de2);
139  }
140 
141  }
142 } // namespace ...
143 
144 namespace GranOO3
145 {
146  GRANOO_CLASS_DECLARE_TPL(DEM::SinterNeck_Rojek);
147 }
148 
149 
150 #endif
151 
152 
BOOST_CLASS_VERSION(GranOO3::DEM::SinterNeck_Rojek, 0) namespace boost
Definition: SinterNeck_Rojek.hpp:112
Definition: SetOf.hpp:346
a base class that represents an element
Definition: Element.hpp:55
Definition: SinterNeck_Rojek.hpp:49
void save(Archive &, const unsigned int) const
Definition: SinterNeck_Rojek.hpp:91
void load(Archive &, const unsigned int)
Definition: SinterNeck_Rojek.hpp:100
virtual void compute_load()
compute the reaction force and torque of the bond
Definition: SinterNeck_Rojek.cpp:64
SinterNeck_Rojek(const SinterNeck_Rojek &frame)=delete
SinterNeck_Rojek & operator=(const SinterNeck_Rojek &)=delete
virtual std::string info() const
Display some useful info in the terminal
Definition: SinterNeck_Rojek.cpp:116
void update_delta_b()
Definition: SinterNeck_Rojek.cpp:59
virtual ~SinterNeck_Rojek()
Definition: SinterNeck_Rojek.cpp:55
double _psi
Definition: SinterNeck_Rojek.hpp:85
friend class boost::serialization::access
Definition: SinterNeck_Rojek.hpp:77
double _Dg_x_delta_g
Definition: SinterNeck_Rojek.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