GranOO  3.0
A robust and versatile workbench to build 3D dynamic simulations based on the Discrete Element Method
Public Member Functions | Private Member Functions | Friends | List of all members
GranOO3::DEM::Domain Class Reference

singleton class mainly used for IO More...

#include <Domain.hpp>

Inheritance diagram for GranOO3::DEM::Domain:
Inheritance graph
[legend]

Public Member Functions

 ~Domain ()
 destructor, it does nothing particular More...
 
void save (std::string) const
 save the current of the domain state in the specified file More...
 
void load (std::string)
 load a domain from the specified file More...
 
void save_ascii () const
 save the current of the domain state with ascii file format More...
 
void save_ascii (std::string) const
 save the current of the domain state with ascii file format More...
 
void load_ascii (std::string)
 load a domain from the specified file More...
 
void save_roga () const
 
void save_roga (std::string) const
 
void load_roga (std::string)
 
void save_off (std::string) const
 save the current SupportShape More...
 
void save_xyz (std::string set="Global") const
 save the current state of the domain in the *.xyz format More...
 
void save_xyz (std::string, std::string set="Global") const
 save the current state of the domain in the *.xyz format More...
 
void save_xyzr (std::string set="Global") const
 save the current state of the domain in the *.xyzr format More...
 
void save_xyzr (std::string, std::string set="Global") const
 save the current state of the domain in the *.xyzr format More...
 
void load_xyzr (std::string)
 load the current state of the domain More...
 
void load_rxyz (std::string)
 load the current state of the domain More...
 
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 More...
 
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 ! More...
 
- Public Member Functions inherited from GranOO3::Core::Domain
void clear ()
 
void save () const
 
void save_light () const
 
void save_light (std::string) const
 
void load_light (std::string)
 
void export_to_povray () const
 
void export_to_povray (std::string) const
 
std::ostream & export_to_povray (std::ostream &out) const
 

Private Member Functions

 Domain ()
 constructor, it does nothing particular More...
 
 Domain (const Domain &)=delete
 
Domainoperator= (const Domain &)=delete
 
template<class Archive >
void serialize (Archive &, const unsigned int)
 serialize the whole domain in the standard gdd format More...
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Static Public Member Functions inherited from GranOO3::Core::Singleton< Domain >
static bool exist ()
 
static Domainget ()
 
static void instanciate ()
 
static void delete_me ()
 
- Static Public Member Functions inherited from GranOO3::Core::Domain
static std::string std_file_extension ()
 
static std::string light_file_extension ()
 
static std::string ascii_file_extension ()
 
static std::string povray_file_extension ()
 
static std::string xyzr_file_extension ()
 
static std::string rxyz_file_extension ()
 
static std::string gfem_file_extension ()
 
static std::string light_file_header ()
 
static std::string roga_file_extension ()
 
- Protected Member Functions inherited from GranOO3::Core::SingletonB< Domain, Core::Domain >
 SingletonB ()
 
virtual ~SingletonB ()
 
- Protected Member Functions inherited from GranOO3::Core::Singleton< Domain >
 Singleton ()
 
virtual ~Singleton ()
 
- Protected Member Functions inherited from GranOO3::Core::Domain
 Domain ()
 
- Protected Attributes inherited from GranOO3::Core::Domain
IOManager _io
 
std::string _file_prefix
 
- Static Protected Attributes inherited from GranOO3::Core::Singleton< Domain >
static Domain_me
 

Detailed Description

singleton class mainly used for IO

Constructor & Destructor Documentation

◆ ~Domain()

GranOO3::DEM::Domain::~Domain ( )
virtual

destructor, it does nothing particular

Reimplemented from GranOO3::Core::Domain.

◆ Domain() [1/2]

GranOO3::DEM::Domain::Domain ( )
private

constructor, it does nothing particular

◆ Domain() [2/2]

GranOO3::DEM::Domain::Domain ( const Domain )
privatedelete

Member Function Documentation

◆ load()

void GranOO3::DEM::Domain::load ( std::string  file)
virtual

load a domain from the specified file

Parameters
[in]file: file name

The type of the file is automatically detected with the extension (*.gdd, *.agdd, etc.)

Reimplemented from GranOO3::Core::Domain.

◆ load_ascii()

void GranOO3::DEM::Domain::load_ascii ( std::string  file)

load a domain from the specified file

Parameters
[in]file: file name

Here the expected type of file is *.agdd, see save_ascii()

◆ load_roga()

void GranOO3::DEM::Domain::load_roga ( std::string  fileName)

◆ load_rxyz()

void GranOO3::DEM::Domain::load_rxyz ( std::string  file)

load the current state of the domain

Parameters
[in]file: the file name is the *.rxyz format

Load the current state of the domain with the well-known-simple *.rxyz format

◆ load_xyzr()

void GranOO3::DEM::Domain::load_xyzr ( std::string  file)

load the current state of the domain

Parameters
[in]file: the file name is the *.xyzr format

Load the current state of the domain with the well-known-simple *.xyzr format

◆ operator=()

Domain& GranOO3::DEM::Domain::operator= ( const Domain )
privatedelete

◆ read_sample_file()

void GranOO3::DEM::Domain::read_sample_file ( const std::string &  fileName,
const std::string &  setID,
const Geom::Frame frame,
const std::string &  prefix,
const std::string &  suffix,
bool  update,
bool  clear,
bool  support_shape 
)

utility method for loading a sample file with a lot of option !

Parameters
[in]fileName: the file name to load
[in]setID: if not empty, build new SetOf and put the entire domain inside
[in]frame: translate and rotate the sample file to the desired place
[in]prefix: all the SetOf contained in the sample file will be prefixed by the specified prefix
[in]suffix: all the SetOf contained in the sample file will be suffixed by the specified suffix
[in]update: if true, the current state of the loaded domain will be considered as the initial state
[in]clear: if true, the kinematics (velocity, acceleration) will be considered as zero
[in]support_shape: if true, the associated support shape will be updated

This method is mainly used for loading a sample file at the beginning of a simulation. It allows to change the orientation and the position of the sample, to consider these new positions as initial parameters and so on...

◆ save()

void GranOO3::DEM::Domain::save ( std::string  file) const
virtual

save the current of the domain state in the specified file

Parameters
[in]file: file name

The type of the file is automatically detected with the extension (*.gdd, *.agdd, etc.)

Reimplemented from GranOO3::Core::Domain.

◆ save_ascii() [1/2]

void GranOO3::DEM::Domain::save_ascii ( ) const

save the current of the domain state with ascii file format

The name of the file is automatically built with the current iteration number. Here, the standard granoo ascii file format (*.agdd) is chosen for saved the file. This simple format is dedicated to discrete domains with spherical elements. The advantage of this format is its compatibility between the different granoo version.

◆ save_ascii() [2/2]

void GranOO3::DEM::Domain::save_ascii ( std::string  file) const

save the current of the domain state with ascii file format

Parameters
[in]file: file name of the output file

Same as save_ascii() (with a specified file)

◆ save_off()

void GranOO3::DEM::Domain::save_off ( std::string  file) const

save the current SupportShape

Parameters
[in]file: file name of the output file

This method is quite particular. It allows to save in the *.off format the main support shape (with a polyhedral shape) in the *.off format. Be aware, this method does not save the whole state of a domain !

◆ save_roga() [1/2]

void GranOO3::DEM::Domain::save_roga ( ) const

◆ save_roga() [2/2]

void GranOO3::DEM::Domain::save_roga ( std::string  fileName) const

◆ save_xyz() [1/2]

void GranOO3::DEM::Domain::save_xyz ( std::string  set = "Global") const

save the current state of the domain in the *.xyz format

Parameters
[in]set: the set ID of the Element to save (default is the Global set)

The name of the file is automatically built with the current iteration number. Here, the standard *.xyz is chosen for saved the file. This very very simple format is mainly dedicated to discrete domains with spherical elements. Its advantage is its compatibility between different simulation tools.

◆ save_xyz() [2/2]

void GranOO3::DEM::Domain::save_xyz ( std::string  file,
std::string  set = "Global" 
) const

save the current state of the domain in the *.xyz format

Parameters
[in]file: the file name
[in]set: the set ID of the Element to save (default is the Global set)

Similar as save_xyz(std::string set="Global") (with a specified file).

◆ save_xyzr() [1/2]

void GranOO3::DEM::Domain::save_xyzr ( std::string  set = "Global") const

save the current state of the domain in the *.xyzr format

Parameters
[in]set: the set ID of the Element to save (default is the Global set)

The name of the file is automatically built with the current iteration number. Here, the standard *.xyzr is chosen for saved the file. This very very simple format is mainly dedicated to discrete domains with spherical elements. Its advantage is its compatibility between different simulation tools.

◆ save_xyzr() [2/2]

void GranOO3::DEM::Domain::save_xyzr ( std::string  file,
std::string  set = "Global" 
) const

save the current state of the domain in the *.xyzr format

Parameters
[in]file: the file name
[in]set: the set ID of the Element to save (default is the Global set)

Similar as save_xyzr(std::string set="Global") (with a specified file).

◆ serialize()

template<class Archive >
void GranOO3::DEM::Domain::serialize ( Archive &  ar,
const unsigned int  version 
)
inlineprivate

serialize the whole domain in the standard gdd format

◆ to_vtk()

void GranOO3::DEM::Domain::to_vtk ( std::vector< std::pair< std::string, vtkSmartPointer< vtkUnstructuredGrid > > > &  data,
bool  with_element_shape 
)

utility method for saving the current state of the domain in vtk

Parameters
[in]data: a vector of (key,pointer) that represents the data
[in]with_element_shape: export also the element shape (mainly used for polyhedral elements)

This method is used for paraview export

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

The documentation for this class was generated from the following files: