GranOO  3.0
A robust and versatile workbench to build 3D dynamic simulations based on the Discrete Element Method
PlasticBeam.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_PlasticBeam_hpp_
31 #define _libDEM_PlasticBeam_hpp_
32 
33 #include <string>
34 #include <vector>
35 
37 #include "GranOO3/DEM/Element.hpp"
38 #include "GranOO3/Core/SetOf.hpp"
39 
40 
41 #include "GranOO3/Geom/Point.hpp"
42 
43 namespace GranOO3
44 {
45  namespace DEM
46  {
47 
48 
49  class PlasticBeam : public Beam,
50  public Core::Register< PlasticBeam >
51  {
52 
53  GRANOO_CLASS(DEM::PlasticBeam, Beam);
54 
55  public:
56  //CONSTRUCTORS & DESTRUCTORS
57  PlasticBeam(Element& el1, Element& el2);
58  PlasticBeam(Element& el1, Element& el2, double young_mod, double damp, double rad, double poisson_ratio, double max_stress);
59  virtual ~PlasticBeam();
60 
61  //USEFULL
62  virtual void compute_load();
63  virtual std::string info() const;
64  virtual void draw();
65  bool is_plastic() const;
66  void enable_plastic_mode();
67 
68  GRANOO_ACCESS(max_elastic_elongation, double, _max_elastic_relative_elongation);
69 
70  private:
71  PlasticBeam() = delete;
72  PlasticBeam(const PlasticBeam& ) = delete;
73  PlasticBeam & operator=(const PlasticBeam& ) = delete;
74 
75  private:
76  //BOOST SERIALIZATION
78  template<class Archive> void serialize(Archive&, const unsigned int);
79 
80  private:
81  bool _plastic;
83  double _max_normal_force; // <- it is automatically computed
84  double _max_bending_force; // <- it is automatically computed
85  };
86 
87 
88  inline bool
90  return _plastic;
91  }
92 
93  //BOOST SERIALIZATION
94  template<class Archive> void
95  PlasticBeam::serialize(Archive & ar, const unsigned int version) {
96  ar & boost::serialization::base_object<Beam>(*this);
97  ar & _plastic;
99  ar & _max_normal_force;
100  ar & _max_bending_force;
101  }
102 
103  }
104 }
105 
106 
107 #include <boost/serialization/version.hpp>
109 
110 // need placement new snippet because no default constructor exist
111 namespace boost
112 {
113  namespace serialization
114  {
115 
116  template<class Archive>
117  inline void save_construct_data(Archive & ar,
119  const unsigned int) {
120  const GranOO3::DEM::Element* de1 = &t->get_element1();
121  const GranOO3::DEM::Element* de2 = &t->get_element2();
122  ar << de1;
123  ar << de2;
124  }
125 
126  template<class Archive>
127  inline void load_construct_data(Archive & ar,
129  const unsigned int) {
130  GranOO3::DEM::Element* de1 = nullptr;
131  GranOO3::DEM::Element* de2 = nullptr;
132  ar >> de1;
133  ar >> de2;
134  ::new(t)GranOO3::DEM::PlasticBeam(*de1,*de2);
135  }
136 
137  }
138 }
139 
140 
141 namespace GranOO3 {
142  GRANOO_CLASS_DECLARE_TPL(DEM::PlasticBeam);
143 }
144 
145 
146 #endif
147 
148 
BOOST_CLASS_VERSION(GranOO3::DEM::PlasticBeam, 0) namespace boost
Definition: PlasticBeam.hpp:108
Definition: SetOf.hpp:346
a bond beam that works in tension, compression, bending and torsion
Definition: Beam.hpp:53
a base class that represents an element
Definition: Element.hpp:55
a bond model that represents a beam able to handle plastic deformation.
Definition: PlasticBeam.hpp:51
PlasticBeam(const PlasticBeam &)=delete
PlasticBeam & operator=(const PlasticBeam &)=delete
virtual ~PlasticBeam()
destructor
Definition: PlasticBeam.cpp:60
virtual void compute_load()
trigger the computing of the reaction force and torque
Definition: PlasticBeam.cpp:77
virtual void draw()
OpenGL draw of the bond
Definition: PlasticBeam.cpp:133
void enable_plastic_mode()
a method that enable the plastic mode
Definition: PlasticBeam.cpp:65
virtual std::string info() const
Display some useful info in the terminal
Definition: PlasticBeam.cpp:120
PlasticBeam(Element &el1, Element &el2, double young_mod, double damp, double rad, double poisson_ratio, double max_stress)
constructor
bool _plastic
a Boolean variable to know if the beam is currently in plastic mode or not
Definition: PlasticBeam.hpp:81
double _max_bending_force
this attribute is able to store the current maximal bending force (for internal usage only)
Definition: PlasticBeam.hpp:84
double _max_normal_force
this attribute is able to store the current maximal normal force (for internal usage only)
Definition: PlasticBeam.hpp:83
bool is_plastic() const
util method to know if the beam is exhibiting plastic deformation
Definition: PlasticBeam.hpp:89
double _max_elastic_relative_elongation
the elastic limit in terms of deformation
Definition: PlasticBeam.hpp:82
friend class boost::serialization::access
Definition: PlasticBeam.hpp:77
void serialize(Archive &, const unsigned int)
complete serializing of the bond in the *.gdd format
Definition: PlasticBeam.hpp:95
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