GranOO  3.0
A robust and versatile workbench to build 3D dynamic simulations based on the Discrete Element Method
BondElectrical.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_BondElectrical_HPP
36 #define _LibDEM_Prop_BondElectrical_HPP
37 
38 
39 #include "GranOO3/Core/Prop.hpp"
40 #include "GranOO3/DEM/Bond.hpp"
41 
42 
43 
44 namespace GranOO3
45 {
46  namespace DEM
47  {
48 
49  class BondElectrical : public Core::Prop<Bond>,
50  public Core::Register<BondElectrical>
51  {
52 
54 
55  public:
56  //CONSTRUCTORS & DESTRUCTORS
58  virtual ~BondElectrical();
59 
60  //USEFULL
61  virtual std::string info() const;
62 
63  //ACCESSORS
64  GRANOO_ACCESS(current, double, _current);
65  double get_abs_current() const;
66 
67  GRANOO_ACCESS(potential, double, _potential);
68  double get_abs_potential() const;
69 
70  GRANOO_ACCESS(resistance, double, _resistance);
71  double get_abs_resistance() const;
72 
73  GRANOO_ACCESS(initial_resistance, double, _initial_resistance);
74 
75  private:
76  //Serialization
78  template<class Archive> void serialize(Archive& ar, const unsigned int );
79 
80  private:
81  double _current;
82  double _potential;
83  double _resistance;
85  };
86 
87 
88  inline std::string
90  std::ostringstream os;
91  return os.str();
92  }
93 
94  template<class Archive> void
95  BondElectrical::serialize(Archive& ar, const unsigned int version) {
96  ar & boost::serialization::base_object<Core::Prop<Bond>>(*this);
97  ar & _current;
98  ar & _potential;
99  ar & _resistance;
100  if (version >= 1)
101  ar & _initial_resistance;
102  }
103 
104  }
105 }
106 
107 
108 #include <boost/serialization/version.hpp>
110 
111 
112 namespace GranOO3{
113  GRANOO_CLASS_DECLARE_TPL(DEM::BondElectrical);}
114 
115 
116 #endif
117 
BOOST_CLASS_VERSION(GranOO3::DEM::BondElectrical, 1) namespace GranOO3
Definition: BondElectrical.hpp:109
Definition: Prop.hpp:48
Definition: SetOf.hpp:346
Definition: BondElectrical.hpp:51
double _resistance
Definition: BondElectrical.hpp:83
double _initial_resistance
Definition: BondElectrical.hpp:84
double _potential
Definition: BondElectrical.hpp:82
virtual std::string info() const
Definition: BondElectrical.hpp:89
void serialize(Archive &ar, const unsigned int)
Definition: BondElectrical.hpp:95
double get_abs_potential() const
Definition: BondElectrical.cpp:80
virtual ~BondElectrical()
Definition: BondElectrical.cpp:71
friend class boost::serialization::access
Definition: BondElectrical.hpp:77
double _current
Definition: BondElectrical.hpp:81
double get_abs_resistance() const
Definition: BondElectrical.cpp:85
double get_abs_current() const
Definition: BondElectrical.cpp:75
Definition: Common.hpp:198
static char_cptr version
Definition: Exprtk.hpp:44221