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 _LibDEM_Domain_hpp_
31 #define _LibDEM_Domain_hpp_
32 
33 #include <list>
34 #include <utility>
35 #include <vtkUnstructuredGrid.h>
36 #include <vtkSmartPointer.h>
37 
38 
40 #include "GranOO3/Core/Domain.hpp"
42 #include "GranOO3/Geom/Frame.hpp"
43 
44 namespace GranOO3
45 {
46  namespace DEM
47  {
48  class Domain : public Core::SingletonB<Domain, Core::Domain>,
49  public Core::Domain
50  {
51  GRANOO_SINGLETON_CLASS(Domain);
52 
53  public:
54  ~Domain();
55 
56  void save(std::string) const;
57  void load(std::string);
58 
59  void save_ascii() const;
60  void save_ascii(std::string) const;
61  void load_ascii(std::string);
62 
63  void save_roga() const;
64  void save_roga(std::string) const;
65  void load_roga(std::string);
66 
67  void save_off(std::string) const;
68 
69  void save_xyz(std::string set="Global") const;
70  void save_xyz(std::string, std::string set="Global") const;
71 
72  void save_xyzr(std::string set="Global") const;
73  void save_xyzr(std::string, std::string set="Global") const;
74 
75  void load_xyzr(std::string);
76  void load_rxyz(std::string);
77 
78  void to_vtk(std::vector<std::pair<std::string, vtkSmartPointer<vtkUnstructuredGrid> > > &data,
79  bool save_discrete_element_shape);
80 
81  //USEFULL
82  void read_sample_file(const std::string& fileName,
83  const std::string& Id,
84  const Geom::Frame& f,
85  const std::string& prefix,
86  const std::string& suffix,
87  bool updateInitialParametersToCurrentParameters,
88  bool clearKinematics,
89  bool updateDiscreteShape);
90 
91 
92 
93 
94  private:
95  Domain();
96  Domain(const Domain&) = delete;
97  Domain & operator=(const Domain &) = delete;
98 
99  //BOOST SERIALIZATION
101  template<class Archive> void serialize(Archive&, const unsigned int);
102 
103  };
104 
105  template<class Archive>
106  inline void
107  Domain::serialize(Archive & ar, const unsigned int version) {
108  ar & boost::serialization::base_object<Core::Domain>(*this);
109  }
110 
111 
112  }
113 }
114 
115 #endif
Definition: Domain.hpp:46
void save() const
Definition: Domain.cpp:107
Definition: Singleton.hpp:93
singleton class mainly used for IO
Definition: Domain.hpp:50
Domain(const Domain &)=delete
void save_roga() const
Definition: Domain.cpp:100
~Domain()
destructor, it does nothing particular
Definition: Domain.cpp:63
Domain()
constructor, it does nothing particular
Definition: Domain.cpp:61
void load(std::string)
load a domain from the specified file
Definition: Domain.cpp:76
void serialize(Archive &, const unsigned int)
serialize the whole domain in the standard gdd format
Definition: Domain.hpp:107
void load_rxyz(std::string)
load the current state of the domain
Definition: Domain.cpp:739
void load_roga(std::string)
Definition: Domain.cpp:519
void save_off(std::string) const
save the current SupportShape
Definition: Domain.cpp:766
void read_sample_file(const std::string &fileName, const std::string &Id, const Geom::Frame &f, const std::string &prefix, const std::string &suffix, bool updateInitialParametersToCurrentParameters, bool clearKinematics, bool updateDiscreteShape)
utility method for loading a sample file with a lot of option !
Definition: Domain.cpp:848
void save_ascii() const
save the current of the domain state with ascii file format
Definition: Domain.cpp:94
Domain & operator=(const Domain &)=delete
void save_xyzr(std::string set="Global") const
save the current state of the domain in the *.xyzr format
Definition: Domain.cpp:820
friend class boost::serialization::access
Definition: Domain.hpp:100
void to_vtk(std::vector< std::pair< std::string, vtkSmartPointer< vtkUnstructuredGrid > > > &data, bool save_discrete_element_shape)
utility method for saving the current state of the domain in vtk
Definition: Domain.cpp:997
void save_xyz(std::string set="Global") const
save the current state of the domain in the *.xyz format
Definition: Domain.cpp:792
void load_ascii(std::string)
load a domain from the specified file
Definition: Domain.cpp:365
void load_xyzr(std::string)
load the current state of the domain
Definition: Domain.cpp:712
Definition: Frame.hpp:68
Definition: Common.hpp:198
static std::string data()
Definition: Exprtk.hpp:44228
static char_cptr version
Definition: Exprtk.hpp:44221