GranOO  3.0
A robust and versatile workbench to build 3D dynamic simulations based on the Discrete Element Method
PlasticBeamIT.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 // - Inigo Terreros
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 // Bug fixes and improvements made by Do Xuan Vinh Nguyen, <dxvn818@uowmail.edu.au>
16 //
17 // Copyright (C) 2018 Do Xuan Vinh Nguyen
18 // Copyright (C) 2008-2016 JL. CHARLES, D. ANDRE, I. IORDANOFF, J. GIRARDOT
19 //
20 //
21 //
22 //
23 //
24 // This program is free software: you can redistribute it and/or modify
25 // it under the terms of the GNU General Public License as published by
26 // the Free Software Foundation, either version 3 of the License, or
27 // (at your option) any later version.
28 //
29 // This program is distributed in the hope that it will be useful,
30 // but WITHOUT ANY WARRANTY; without even the implied warranty of
31 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 // GNU General Public License for more details.
33 //
34 // You should have received a copy of the GNU General Public License
35 // along with this program. If not, see <http://www.gnu.org/licenses/>.
36 
37 
38 #ifndef _libDEM_PlasticBeamIT_hpp_
39 #define _libDEM_PlasticBeamIT_hpp_
40 
41 #include <string>
42 #include <vector>
43 
45 #include "GranOO3/DEM/Element.hpp"
46 #include "GranOO3/Core/SetOf.hpp"
47 
48 
49 #include "GranOO3/Geom/Point.hpp"
50 
51 namespace GranOO3
52 {
53  namespace DEM
54  {
55 
56 
57  class PlasticBeamIT : public Beam, public Core::Register< PlasticBeamIT >
58  {
59 
60  GRANOO_CLASS(DEM::PlasticBeamIT, Beam);
61 
62  public:
63  //TEST
64  virtual void draw();
65 
66  //CONSTRUCTORS & DESTRUCTORS
67  PlasticBeamIT(Element& el1, Element& el2);
68  PlasticBeamIT(Element& el1, Element& el2, double young_mod, double damp, double radius, double poisson_ratio, double max_stress);
69  virtual ~PlasticBeamIT();
70 
71  //USEFULL
72  virtual void compute_load();
73  virtual std::string info() const;
74 
75  GRANOO_ACCESS(max_elastic_relative_elongation, double, _max_elastic_relative_elongation);
76 
77  private:
78  PlasticBeamIT() = delete;
79  PlasticBeamIT(const PlasticBeamIT& frame) = delete;
80  PlasticBeamIT & operator=(const PlasticBeamIT &) = delete;
81 
82  private:
83  //BOOST SERIALIZATION
85  template<class Archive> void serialize(Archive&, const unsigned int);
86 
87  private:
90  double _kmax;
95  };
96 
97 
98 
99  //BOOST SERIALIZATION
100  template<class Archive>
101  void
102  PlasticBeamIT::serialize(Archive & ar, const unsigned int version) {
103  ar & boost::serialization::base_object<Beam>(*this);
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  inline 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  inline 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::PlasticBeamIT(*de1,*de2);
139  }
140 
141  }
142 } // namespace ...
143 
144 
145 namespace GranOO3
146 {
147  GRANOO_CLASS_DECLARE_TPL(DEM::PlasticBeamIT);
148 }
149 
150 
151 #endif
152 
153 
BOOST_CLASS_VERSION(GranOO3::DEM::PlasticBeamIT, 0) namespace boost
Definition: PlasticBeamIT.hpp:112
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: PlasticBeamIT.hpp:58
virtual void compute_load()
trigger the computing of the reaction force and torque
Definition: PlasticBeamIT.cpp:72
virtual ~PlasticBeamIT()
destructor
Definition: PlasticBeamIT.cpp:68
Geom::Vector _max_force1
an attribute is able to store the current elastic force applied on element 1 (for internal usage only...
Definition: PlasticBeamIT.hpp:91
Geom::Vector _max_force2
an attribute is able to store the current elastic force applied on element 2 (for internal usage only...
Definition: PlasticBeamIT.hpp:92
Geom::Vector _max_torque1
an attribute is able to store the current elastic torque applied on element 1 (for internal usage onl...
Definition: PlasticBeamIT.hpp:93
double _sigma_vonmises_max
the elastic limit in terms of vonmises stress
Definition: PlasticBeamIT.hpp:89
void serialize(Archive &, const unsigned int)
complete serializing of the bond in the *.gdd format
Definition: PlasticBeamIT.hpp:102
double _kmax
an internal variable able to drive the plastic deformation (for internal usage only)
Definition: PlasticBeamIT.hpp:90
virtual std::string info() const
Display some useful info in the terminal
Definition: PlasticBeamIT.cpp:106
Geom::Vector _max_torque2
an attribute is able to store the current elastic torque applied on element 2 (for internal usage onl...
Definition: PlasticBeamIT.hpp:94
PlasticBeamIT & operator=(const PlasticBeamIT &)=delete
friend class boost::serialization::access
Definition: PlasticBeamIT.hpp:84
double _max_elastic_relative_elongation
the elastic limit in terms of deformation
Definition: PlasticBeamIT.hpp:88
virtual void draw()
OpenGL draw of the bond
Definition: PlasticBeamIT.cpp:113
PlasticBeamIT(const PlasticBeamIT &frame)=delete
Definition: Vector.hpp:75
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