GranOO  3.0
A robust and versatile workbench to build 3D dynamic simulations based on the Discrete Element Method
FlatBond.hpp
Go to the documentation of this file.
1 
2 // This file is part of GranOO, a workbench for DEM simulation.
3 //
4 // Author(s) : - Jean-luc CHARLES I2M-DuMAS/ENSAM Talence France
5 // <jean-luc.charles@ensam.eu>
6 // - Damien ANDRE SPCTS/ENS Ceramique industrielle, Limoges France
7 // <damien.andre@unilim.fr>
8 // - Jeremie GIRARDOT I2M-DuMAS/ENSAM Talence France
9 // <jeremie.girardot@ensam.eu>
10 // - Cedric Hubert LAMIH/UVHC Valenciennes France
11 // <cedric.hubert@univ-valenciennes.fr>
12 // - Ivan IORDANOFF I2M-DuMAS-MPI/ENSAM Talence France
13 // <ivan.iordanoff@ensam.eu>
14 //
15 // Copyright (C) 2008-2016 JL. CHARLES, D. ANDRE, I. IORDANOFF, J. GIRARDOT
16 //
17 //
18 //
19 //
20 //
21 // This program is free software: you can redistribute it and/or modify
22 // it under the terms of the GNU General Public License as published by
23 // the Free Software Foundation, either version 3 of the License, or
24 // (at your option) any later version.
25 //
26 // This program is distributed in the hope that it will be useful,
27 // but WITHOUT ANY WARRANTY; without even the implied warranty of
28 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 // GNU General Public License for more details.
30 //
31 // You should have received a copy of the GNU General Public License
32 // along with this program. If not, see <http://www.gnu.org/licenses/>.
33 
34 
35 #ifndef _libDEM_FlatBond_hpp_
36 #define _libDEM_FlatBond_hpp_
37 
38 #include <string>
39 #include <vector>
40 
41 
42 
43 #include "GranOO3/DEM/Bond.hpp"
44 #include "GranOO3/Core/SetOf.hpp"
45 #include "GranOO3/DEM/Element.hpp"
47 
49 #include "GranOO3/Geom/Point.hpp"
50 
51 namespace GranOO3
52 {
53  namespace DEM
54  {
55 
56 
57  class FlatBond : public Bond,
58  public Core::Register<FlatBond >,
60  {
61 
62  GRANOO_CLASS(DEM::FlatBond, Bond);
63 
64  public:
67  static bool update_current_stress;
68  static bool update_current_strain;
69 
70  public:
71  //CONSTRUCTORS & DESTRUCTORS
72  FlatBond(Element& el1, Element& el2, bool build_voronoi_bond = true);
73  FlatBond(Element& el1, Element& el2, double young_modulus, double poisson_ratio, bool build_voronoi_bond = true);
74  virtual ~FlatBond();
75 
76  //USEFULL
78  virtual void compute_load();
79  double get_linear_stiffness() const;
80  double get_angular_stiffness() const;
81  virtual double compute_critical_time_step() const;
82  virtual std::string info() const;
83  virtual void draw();
84 
85 
86  //ACCESSORS
87  GRANOO_ACCESS(manage_crack_closure , bool , _manage_crack_closure );
88  GRANOO_ACCESS(young_modulus , double , _young_modulus );
89  GRANOO_ACCESS(poisson_ratio , double , _poisson_ratio );
90  GRANOO_ACCESS(friction_coeff , double , _friction_coeff );
91  GRANOO_ACCESS(maximum_tensile_stress , double , _maximum_tensile_stress );
92  GRANOO_ACCESS(maximum_compressive_stress, double , _maximum_compressive_stress );
93  GRANOO_ACCESS(maximum_shear_stress , double , _maximum_shear_stress );
94  GRANOO_ACCESS(current_stress_vector , Geom::Vector , _current_stress_vector );
95  GRANOO_ACCESS(current_normal_stress , double , _current_normal_stress );
96  GRANOO_ACCESS(current_shear_stress , double , _current_shear_stress );
97  GRANOO_ACCESS(current_stress_tensor , Geom::SymTensor, _current_stress_tensor );
98  GRANOO_ACCESS(current_strain_tensor , Geom::SymTensor, _current_strain_tensor );
99 
100  GRANOO_ACCESS_GET_COPY(current_normal_stress_abs, double ,fabs( _current_normal_stress) );
101 
102  private:
103  void fail(const FailureMode mode);
104 
105  private:
106  FlatBond() = delete;
107  FlatBond(const FlatBond&) = delete;
108  FlatBond & operator=(const FlatBond &) = delete;
109 
110  private:
111  //BOOST SERIALIZATION
113  template<class Archive> void serialize(Archive&, const unsigned int);
114 
115  private:
131  };
132 
133  //BOOST SERIALIZATION
134  template<class Archive> void
135  FlatBond::serialize(Archive & ar, const unsigned int version) {
136  ar & boost::serialization::base_object<Bond>(*this);
137  ar & _young_modulus;
138  ar & _poisson_ratio;
143  ar & _FC1;
144  ar & _FC2;
145  if (version >= 1)
147  if (version >= 2)
149  if (version >= 3)
151  if (version >= 4)
153  if (version >= 5)
154  ar & _friction_coeff;
155  if (version >= 6)
157 
158  }
159 
160  }
161 }
162 
163 
164 #include <boost/serialization/version.hpp>
166 
167 
168 // need placement new snippet because no default constructor exist
169 namespace boost
170 {
171  namespace serialization
172  {
173 
174  template<class Archive>
175  inline void save_construct_data(Archive & ar,
176  const GranOO3::DEM::FlatBond * t,
177  const unsigned int) {
178  const GranOO3::DEM::Element* de1 = &t->get_element1();
179  const GranOO3::DEM::Element* de2 = &t->get_element2();
180  ar << de1;
181  ar << de2;
182  }
183 
184 
185  template<class Archive>
186  inline void load_construct_data(Archive & ar,
188  const unsigned int) {
189  GranOO3::DEM::Element* de1 = nullptr;
190  GranOO3::DEM::Element* de2 = nullptr;
191  ar >> de1;
192  ar >> de2;
193  ::new(t)GranOO3::DEM::FlatBond(*de1, *de2, false);
194  }
195  }
196 }
197 
198 
199 namespace GranOO3{
200  GRANOO_CLASS_DECLARE_TPL(DEM::FlatBond);
201 }
202 
203 
204 #endif
205 
206 
BOOST_CLASS_VERSION(GranOO3::DEM::FlatBond, 6) namespace boost
Definition: FlatBond.hpp:165
Definition: SetOf.hpp:346
the base class for all bonds between discrete elements.
Definition: Bond.hpp:49
FailureMode
Definition: Bond.hpp:59
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
a special bond that must be used with Voronoi domain in order to model a perfect elastic media
Definition: FlatBond.hpp:60
double _poisson_ratio
the Poisson's ratio of the flatbond in [-]
Definition: FlatBond.hpp:119
virtual void compute_load()
trigger the computing of the reaction force and torque
Definition: FlatBond.cpp:279
double _maximum_tensile_stress
the maximal tensile stress of the flatbond in [Pa]
Definition: FlatBond.hpp:121
double _friction_coeff
Definition: FlatBond.hpp:120
void serialize(Archive &, const unsigned int)
complete serializing of the bond in the *.gdd format
Definition: FlatBond.hpp:135
virtual std::string info() const
Display some useful info in the terminal
Definition: FlatBond.cpp:325
void fail(const FailureMode mode)
Definition: FlatBond.cpp:286
static bool update_current_strain
Definition: FlatBond.hpp:68
double _young_modulus
the Young's modulus value of the flatbond in [Pa]
Definition: FlatBond.hpp:118
VoronoiBond * _voronoi_bond
a pointer to the associated VoronoiBond property
Definition: FlatBond.hpp:116
double get_linear_stiffness() const
compute the linear stiffness of the bond
Definition: FlatBond.cpp:315
Geom::SymTensor _current_strain_tensor
Definition: FlatBond.hpp:130
Geom::Point _FC2
the center of the voronoi facet expressed in the el2 local frame
Definition: FlatBond.hpp:125
double _current_shear_stress
Definition: FlatBond.hpp:128
virtual void draw()
OpenGL draw of the bond
Definition: FlatBond.cpp:335
Geom::SymTensor _current_stress_tensor
Definition: FlatBond.hpp:129
double _maximum_shear_stress
Definition: FlatBond.hpp:123
double _current_normal_stress
Definition: FlatBond.hpp:127
Geom::Point _FC1
the center of the voronoi facet expressed in the el1 local frame
Definition: FlatBond.hpp:124
FlatBond & operator=(const FlatBond &)=delete
double _maximum_compressive_stress
the maximal compressive stress of the flatbond in [Pa]
Definition: FlatBond.hpp:122
virtual double compute_critical_time_step() const
compute the critical time of the bond
Definition: FlatBond.cpp:300
FlatBond(const FlatBond &)=delete
bool _manage_crack_closure
Definition: FlatBond.hpp:117
Geom::Vector _current_stress_vector
the current value of the stress vector with the normal perpendicular to the Voronoi facet
Definition: FlatBond.hpp:126
static DrawMode draw_mode
Definition: FlatBond.hpp:66
DrawMode
Definition: FlatBond.hpp:65
@ INTERFACE
Definition: FlatBond.hpp:65
@ NO_INTERFACE
Definition: FlatBond.hpp:65
void update_strain_tensor_and_compute_reaction_force_and_torque()
update the reaction force and torque
Definition: FlatBond.cpp:104
friend class boost::serialization::access
Definition: FlatBond.hpp:112
virtual ~FlatBond()
destructor
Definition: FlatBond.cpp:99
static bool update_current_stress
Definition: FlatBond.hpp:67
double get_angular_stiffness() const
similar as get_linear_stiffness() for rotation
Definition: FlatBond.cpp:320
a bond property which is dedicated to voronoi domain.
Definition: VoronoiBond.hpp:47
Definition: Point.hpp:62
Definition: SymTensor.hpp:68
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