GranOO  3.0
A robust and versatile workbench to build 3D dynamic simulations based on the Discrete Element Method
Strain.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 //
14 // Copyright (C) 2008-2016 JL. CHARLES, D. ANDRE, I. IORDANOFF, J. GIRARDOT
15 //
16 //
17 //
18 //
19 //
20 // This program is free software: you can redistribute it and/or modify
21 // it under the terms of the GNU General Public License as published by
22 // the Free Software Foundation, either version 3 of the License, or
23 // (at your option) any later version.
24 //
25 // This program is distributed in the hope that it will be useful,
26 // but WITHOUT ANY WARRANTY; without even the implied warranty of
27 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 // GNU General Public License for more details.
29 //
30 // You should have received a copy of the GNU General Public License
31 // along with this program. If not, see <http://www.gnu.org/licenses/>.
32 
33 
34 
35 #ifndef _LibDEM_Prop_Strain_HPP
36 #define _LibDEM_Prop_Strain_HPP
37 
38 
39 #include "GranOO3/Core/Prop.hpp"
40 #include "GranOO3/DEM/Element.hpp"
41 #include "GranOO3/Geom/Tensor.hpp"
43 
44 
45 
46 namespace GranOO3
47 {
48  namespace DEM
49  {
50 
51  class Strain : public Core::Prop<Element>,
52  public Core::Register<Strain>
53  {
54 
55  GRANOO_CLASS(DEM::Strain, Core::Prop<Element>);
56 
57  public:
58  //CONSTRUCTORS & DESTRUCTORS
59  Strain();
60  virtual ~Strain();
61 
62  //USEFULL
63  virtual std::string info() const;
64 
65  //ACCESSORS
66  GRANOO_ACCESS(displacement_gradient, Geom::Tensor , _displacement_gradient);
67  GRANOO_ACCESS(strain_tensor , Geom::SymTensor, _strain_tensor);
68 
69  //METHOD
70  void init();
71  void update_lsq(bool ignore_cracked_bond);
72 
73  private:
74  //Serialization
76  template<class Archive> void serialize(Archive& ar, const unsigned int );
77 
78  private:
81  };
82 
83 
84 
85 
86  inline std::string
87  Strain::info() const
88  {
89  std::ostringstream os;
90  return os.str();
91  }
92 
93  template<class Archive> void
94  Strain::serialize(Archive& ar, const unsigned int version)
95  {
96  ar & boost::serialization::base_object<Core::Prop<Element>>(*this);
98  ar & _strain_tensor;
99  }
100 
101  }
102 }
103 
104 
105 #include <boost/serialization/version.hpp>
107 
108 
109 namespace GranOO3{
110  GRANOO_CLASS_DECLARE_TPL(DEM::Strain);}
111 
112 
113 #endif
114 
BOOST_CLASS_VERSION(GranOO3::DEM::Strain, 0) namespace GranOO3
Definition: Strain.hpp:106
Definition: Prop.hpp:48
Definition: SetOf.hpp:346
a property for computing strain associated to DEM::Element
Definition: Strain.hpp:53
Geom::SymTensor _strain_tensor
the strain tensor which is the main result of this property
Definition: Strain.hpp:80
void init()
just clear (set to zero) the _displacement_gradient and the _strain_tensor attributes
Definition: Strain.cpp:69
void update_lsq(bool ignore_cracked_bond)
update the strain tensors using the least quare method (lsq)
Definition: Strain.cpp:76
void serialize(Archive &ar, const unsigned int)
complete serializing of the item in the *.gdd format
Definition: Strain.hpp:94
Strain()
constructor
virtual ~Strain()
destructor
Definition: Strain.cpp:64
friend class boost::serialization::access
Definition: Strain.hpp:75
virtual std::string info() const
Display some useful info in the terminal
Definition: Strain.hpp:87
Geom::Tensor _displacement_gradient
the displacement gradient tensor (be aware, this tensor is not symmetrical)
Definition: Strain.hpp:79
Definition: SymTensor.hpp:68
Definition: Tensor.hpp:62
Definition: Common.hpp:198
static char_cptr version
Definition: Exprtk.hpp:44221