GranOO  3.0
A robust and versatile workbench to build 3D dynamic simulations based on the Discrete Element Method
FlatBond_Ortho.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 // - Harikeshava RANGANATHAN IRCER, Limoges France/IMERYS, Lyon France
14 // <harikeshava.ranganathan@unilim.fr>
15 //
16 // Copyright (C) 2008-2016 JL. CHARLES, D. ANDRE, I. IORDANOFF, J. GIRARDOT
17 // Copyright (C) 2023 H. RANGANATHAN
18 //
19 //
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 
36 #ifndef _libDEM_FlatBond_Ortho_hpp_
37 #define _libDEM_FlatBond_Ortho_hpp_
38 
39 #include <string>
40 #include <vector>
41 
42 
43 
44 #include "GranOO3/DEM/Bond.hpp"
45 #include "GranOO3/Core/SetOf.hpp"
46 #include "GranOO3/DEM/Element.hpp"
48 
50 #include "GranOO3/Geom/Point.hpp"
51 
52 namespace GranOO3
53 {
54  namespace DEM
55  {
56 
57 
58  class FlatBond_Ortho : public Bond,
59  public Core::Register<FlatBond_Ortho >,
61  {
62 
63  GRANOO_CLASS(DEM::FlatBond_Ortho, Bond);
64 
65  public:
66  //CONSTRUCTORS & DESTRUCTORS
67  FlatBond_Ortho(Element& el1, Element& el2, bool build_voronoi_bond = true);
68  FlatBond_Ortho(Element& el1, Element& el2, double Ex, double Ey, double Ez, double C11, double C12, double C13, double C21, double C22, double C23, double C31, double C32, double C33, double C44, double C55, double C66, bool build_voronoi_bond = true);
69  virtual ~FlatBond_Ortho();
70 
71  //USEFULL
73  virtual void compute_load();
74  double get_linear_stiffness() const;
75  double get_angular_stiffness() const;
76  virtual double compute_critical_time_step() const;
77  virtual std::string info() const;
78 
79  //ACCESSORS
80  GRANOO_ACCESS(Ex , double , _Ex );
81  GRANOO_ACCESS(Ey , double , _Ey );
82  GRANOO_ACCESS(Ez , double , _Ez );
83  GRANOO_ACCESS(C11 , double , _C11 );
84  GRANOO_ACCESS(C12 , double , _C12 );
85  GRANOO_ACCESS(C13 , double , _C13 );
86  GRANOO_ACCESS(C21 , double , _C21 );
87  GRANOO_ACCESS(C22 , double , _C22 );
88  GRANOO_ACCESS(C23 , double , _C23 );
89  GRANOO_ACCESS(C31 , double , _C31 );
90  GRANOO_ACCESS(C32 , double , _C32 );
91  GRANOO_ACCESS(C33 , double , _C33 );
92  GRANOO_ACCESS(C44 , double , _C44 );
93  GRANOO_ACCESS(C55 , double , _C55 );
94  GRANOO_ACCESS(C66 , double , _C66 );
95  GRANOO_ACCESS(current_stress_vector , Geom::Vector , _current_stress_vector );
96  GRANOO_ACCESS(current_normal_stress , double , _current_normal_stress );
97 
98 
99  private:
100  FlatBond_Ortho() = delete;
101  FlatBond_Ortho(const FlatBond_Ortho&) = delete;
103 
104  private:
105  //BOOST SERIALIZATION
107  template<class Archive> void serialize(Archive&, const unsigned int);
108 
109  private:
111  double _Ex;
112  double _Ey;
113  double _Ez;
114  double _C11;
115  double _C12;
116  double _C13;
117  double _C21;
118  double _C22;
119  double _C23;
120  double _C31;
121  double _C32;
122  double _C33;
123  double _C44;
124  double _C55;
125  double _C66;
126  // keep it
131  };
132 
133  //BOOST SERIALIZATION
134  template<class Archive> void
135  FlatBond_Ortho::serialize(Archive & ar, const unsigned int version) {
136  ar & boost::serialization::base_object<Bond>(*this);
137  ar & _Ex;
138  ar & _Ey;
139  ar & _Ez;
140  ar & _C11;
141  ar & _C12;
142  ar & _C13;
143  ar & _C21;
144  ar & _C22;
145  ar & _C23;
146  ar & _C31;
147  ar & _C32;
148  ar & _C33;
149  ar & _C44;
150  ar & _C55;
151  ar & _C66;
154  ar & _FC1;
155  ar & _FC2;
156  }
157 
158  }
159 }
160 
161 
162 #include <boost/serialization/version.hpp>
164 
165 
166 // need placement new snippet because no default constructor exist
167 namespace boost
168 {
169  namespace serialization
170  {
171 
172  template<class Archive>
173  inline void save_construct_data(Archive & ar,
175  const unsigned int) {
176  const GranOO3::DEM::Element* de1 = &t->get_element1();
177  const GranOO3::DEM::Element* de2 = &t->get_element2();
178  ar << de1;
179  ar << de2;
180  }
181 
182 
183  template<class Archive>
184  inline void load_construct_data(Archive & ar,
186  const unsigned int) {
187  GranOO3::DEM::Element* de1 = nullptr;
188  GranOO3::DEM::Element* de2 = nullptr;
189  ar >> de1;
190  ar >> de2;
191  ::new(t)GranOO3::DEM::FlatBond_Ortho(*de1, *de2, false);
192  }
193  }
194 }
195 
196 
197 namespace GranOO3{
198  GRANOO_CLASS_DECLARE_TPL(DEM::FlatBond_Ortho);
199 }
200 
201 
202 #endif
203 
204 
BOOST_CLASS_VERSION(GranOO3::DEM::FlatBond_Ortho, 1) namespace boost
Definition: FlatBond_Ortho.hpp:163
Definition: SetOf.hpp:346
the base class for all bonds between discrete elements.
Definition: Bond.hpp:49
void build_voronoi_bond()
build a voronoi bond from the current bond
Definition: Bond.cpp:361
a base class that represents an element
Definition: Element.hpp:55
Definition: FlatBond_Ortho.hpp:61
double _C44
Definition: FlatBond_Ortho.hpp:123
double _Ex
Definition: FlatBond_Ortho.hpp:111
double _C55
Definition: FlatBond_Ortho.hpp:124
virtual ~FlatBond_Ortho()
Definition: FlatBond_Ortho.cpp:111
double _C31
Definition: FlatBond_Ortho.hpp:120
double _current_normal_stress
Definition: FlatBond_Ortho.hpp:130
void update_strain_tensor_and_compute_reaction_force_and_torque()
Definition: FlatBond_Ortho.cpp:116
Geom::Point _FC1
Definition: FlatBond_Ortho.hpp:127
virtual void compute_load()
compute the reaction force and torque of the bond
Definition: FlatBond_Ortho.cpp:186
double _C66
Definition: FlatBond_Ortho.hpp:125
double _C11
Definition: FlatBond_Ortho.hpp:114
Geom::Point _FC2
Definition: FlatBond_Ortho.hpp:128
double _C33
Definition: FlatBond_Ortho.hpp:122
double _C22
Definition: FlatBond_Ortho.hpp:118
double get_angular_stiffness() const
similar as get_linear_stiffness() for rotation
Definition: FlatBond_Ortho.cpp:222
double _Ez
Definition: FlatBond_Ortho.hpp:113
Geom::Vector _current_stress_vector
Definition: FlatBond_Ortho.hpp:129
VoronoiBond * _voronoi_bond
Definition: FlatBond_Ortho.hpp:110
double _C12
Definition: FlatBond_Ortho.hpp:115
double get_linear_stiffness() const
compute the linear stiffness of the bond
Definition: FlatBond_Ortho.cpp:211
double _C13
Definition: FlatBond_Ortho.hpp:116
double _Ey
Definition: FlatBond_Ortho.hpp:112
void serialize(Archive &, const unsigned int)
Definition: FlatBond_Ortho.hpp:135
double _C23
Definition: FlatBond_Ortho.hpp:119
double _C21
Definition: FlatBond_Ortho.hpp:117
friend class boost::serialization::access
Definition: FlatBond_Ortho.hpp:106
virtual std::string info() const
Display some useful info in the terminal
Definition: FlatBond_Ortho.cpp:233
FlatBond_Ortho & operator=(const FlatBond_Ortho &)=delete
FlatBond_Ortho(const FlatBond_Ortho &)=delete
virtual double compute_critical_time_step() const
a pure virtual method able to return the critical time step value
Definition: FlatBond_Ortho.cpp:196
double _C32
Definition: FlatBond_Ortho.hpp:121
a bond property which is dedicated to voronoi domain.
Definition: VoronoiBond.hpp:47
Definition: Point.hpp:62
Definition: Vector.hpp:75
pure virtual class for modeling classes able to compute a critical time step
Definition: CriticalTimeStep.hpp:50
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
static char_cptr version
Definition: Exprtk.hpp:44221