GranOO  3.0
A robust and versatile workbench to build 3D dynamic simulations based on the Discrete Element Method
Domain.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 _LibCore_Domain_hpp_
31 #define _LibCore_Domain_hpp_
32 
33 
34 #include <iosfwd>
38 
39 
40 
41 namespace GranOO3
42 {
43  namespace Core
44  {
45  class Domain : Core::Singleton<Domain>
46  {
47  GRANOO_SINGLETON_CLASS(Domain);
48 
49  public:
50  static std::string std_file_extension() {return std::string(".gdd");}
51  static std::string light_file_extension() {return std::string(".lgdd");}
52  static std::string ascii_file_extension() {return std::string(".agdd");}
53  static std::string povray_file_extension() {return std::string(".pov");}
54  static std::string xyzr_file_extension() {return std::string(".xyzr");}
55  static std::string rxyz_file_extension() {return std::string(".rxyz");}
56  static std::string gfem_file_extension() {return std::string(".gfem");}
57  static std::string light_file_header() {return std::string("GranOO_LightFile_Version");}
58  static std::string roga_file_extension() {return std::string(".roga");}
59 
60  public:
61  //USEFULL
62  void clear();
63  virtual void save(std::string) const;
64  virtual void load(std::string);
65  void save() const;
66 
67  void save_light() const;
68  void save_light(std::string) const;
69  void load_light(std::string);
70 
71  void export_to_povray() const;
72  void export_to_povray(std::string) const;
73  std::ostream& export_to_povray (std::ostream& out) const;
74 
75  GRANOO_ACCESS(precision , int , _precision );
76  GRANOO_ACCESS(file_prefix, std::string, _file_prefix );
77 
78  protected:
79  Domain();
80  virtual ~Domain();
81 
82  private:
83  Domain(const Domain&) = delete;
84  Domain & operator=(const Domain &) = delete;
85 
86  //SERIALIZATION
88  template<class Archive> void save(Archive & ar, const unsigned int version) const;
89  template<class Archive> void load(Archive & ar, const unsigned int version);
91 
92  protected:
94  std::string _file_prefix;
95 
96  private:
98 
99  };
100 
101  inline
103  }
104 
105  inline void
108  }
109 
110  template<class Archive>
111  inline void
112  Domain::save(Archive & ar, const unsigned int version) const {
114  }
115 
116  template<class Archive>
117  inline void
118  Domain::load(Archive & ar, const unsigned int version) {
120  }
121 
122  }
123 }
124 
125 
126 #include <boost/serialization/version.hpp>
128 
129 #endif
BOOST_CLASS_VERSION(GranOO3::Core::Base, 1) namespace GranOO3
Definition: Base.hpp:277
Definition: Domain.hpp:46
void save_light() const
Definition: Domain.cpp:112
static std::string rxyz_file_extension()
Definition: Domain.hpp:55
void load_light(std::string)
Definition: Domain.cpp:144
static std::string povray_file_extension()
Definition: Domain.hpp:53
int _precision
Definition: Domain.hpp:97
static std::string light_file_header()
Definition: Domain.hpp:57
void clear()
Definition: Domain.hpp:106
std::string _file_prefix
Definition: Domain.hpp:94
virtual void load(std::string)
Definition: Domain.cpp:85
void save() const
Definition: Domain.cpp:107
static std::string roga_file_extension()
Definition: Domain.hpp:58
IOManager _io
Definition: Domain.hpp:93
static std::string xyzr_file_extension()
Definition: Domain.hpp:54
static std::string ascii_file_extension()
Definition: Domain.hpp:52
void export_to_povray() const
Definition: Domain.cpp:161
Domain & operator=(const Domain &)=delete
Domain(const Domain &)=delete
static std::string light_file_extension()
Definition: Domain.hpp:51
friend class boost::serialization::access
Definition: Domain.hpp:87
static std::string gfem_file_extension()
Definition: Domain.hpp:56
Domain()
Definition: Domain.cpp:49
virtual ~Domain()
Definition: Domain.hpp:102
static std::string std_file_extension()
Definition: Domain.hpp:50
Definition: IOManager.hpp:53
void LoadAll(boost::archive::text_iarchive &, const unsigned int)
Definition: SetOfManager.cpp:146
void SaveAll(boost::archive::text_oarchive &, const unsigned int)
Definition: SetOfManager.cpp:121
void ClearAll()
Definition: SetOfManager.cpp:94
Definition: Singleton.hpp:75
static SetOfManager & get()
Definition: Singleton.hpp:127
Definition: Common.hpp:198
static char_cptr version
Definition: Exprtk.hpp:44221