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

a singleton virtual class for representing periodic boundaries More...

#include <Full3D.hpp>

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

Public Member Functions

 Full3D ()
 constructor More...
 
virtual ~Full3D ()
 destructor More...
 
void set_bounding_box (const Shape::Box &box)
 set the length of the periodic box More...
 
void set_bounding_box (double lx, double ly, double lz)
 set the length of the periodic box More...
 
void scale_bounding_box (double factor)
 apply an expansion factor to the length of the periodic box More...
 
void init_function ()
 a function that must be triggered to initialize the periodic boundary More...
 
double get_lx () const
 get the length of the periodic box along x More...
 
double get_ly () const
 get the length of the periodic box along y More...
 
double get_lz () const
 get the length of the periodic box along z More...
 
void set_length_on_x (double value)
 set the length of the periodic box along x More...
 
void set_length_on_y (double value)
 set the length of the periodic box along y More...
 
void set_length_on_z (double value)
 set the length of the periodic box along z More...
 
void distort_on_x (double angle)
 distort the periodic domain along x More...
 
void distort_on_y (double angle)
 distort the periodic domain along y More...
 
void distort_on_z (double angle)
 distort the periodic domain along z More...
 
virtual void draw ()
 a pure virtual function to draw the domain More...
 
virtual std::string info () const
 get some info on the periodic bounday More...
 
virtual std::ostream & write_ascii (std::ostream &out) const
 dump the current state of the periodic boundary in a ascii file (standard *.lgdd format) More...
 
virtual std::istream & read_ascii (std::istream &in)
 update the current state of periodic boundary from an ascii file format *.lgdd More...
 
- Public Member Functions inherited from GranOO3::DEM::PeriodicBoundary
 PeriodicBoundary ()
 constructor More...
 
virtual ~PeriodicBoundary ()
 destructor More...
 
void make_periodic (Element &el)
 a function that transforms a normal element into a periodic master element with its related slaves More...
 
void init_periodic_object ()
 a function that initializes all the Periodic instances More...
 
void retrieve_slave ()
 
void clean_slave_element_without_master ()
 
std::function< Geom::Vector(const Geom::Vector &, bool &)> & get_periodic_mv_function ()
 get the move function More...
 
std::function< Geom::Vector(const Geom::Vector &)> & get_follow_master_function (unsigned int rank)
 get the "follow master" More...
 
- Public Member Functions inherited from GranOO3::Core::Base
virtual ~Base ()
 
size_t numID () const
 
size_t uID () const
 
void set_numID (size_t val)
 
void clear_numID ()
 
Physic::Materialget_mat () const
 
void set_mat (Physic::Material *)
 
Baseitem ()
 
const Baseitem () const
 
bool is_same (const Base &) const
 
template<class T >
T & cast_to ()
 
template<class T >
const T & cast_to () const
 
template<class T >
bool is () const
 
virtual bool is (size_t) const
 
virtual const std::string & get_ID () const
 
virtual Baseclone ()
 
template<class T >
T & clone_to ()
 
virtual std::ostream & export_to_povray (std::ostream &out) const
 
Signal< Base & > & deleted_signal ()
 
- Public Member Functions inherited from GranOO3::Core::Null
 Null ()
 
virtual ~Null ()
 
- Public Member Functions inherited from GranOO3::Core::Drawable
 Drawable ()
 
virtual ~Drawable ()
 
virtual void draw_edge ()
 
virtual void init_default_color ()
 
virtual std::ostream & get_info (std::ostream &os) const
 
virtual const Colordefault_color () const
 
Colorget_color ()
 
const Colorget_color () const
 
virtual void set_color (const Color &)
 
virtual void set_alpha (float alpha)
 
void apply_color () const
 
void apply_edge_color () const
 
void apply_default_color ()
 
void apply_selected_color ()
 
void set_line_width (float)
 
float get_line_width () const
 
float & get_line_width ()
 
void apply_line_width () const
 
bool is_visible () const
 
void set_visible (bool)
 
void paint ()
 
void paint_edge ()
 
unsigned int get_item_glkey () const
 
- Public Member Functions inherited from GranOO3::Core::Register< Base >
 Register ()
 
virtual ~Register ()
 
void erase_from_all_setof ()
 
bool belong_to_setof (const std::string &setOfId) const
 
bool belong_to_setof (const SetOf< Base > &set) const
 
std::list< SetOf< Base > * > & get_setof_list ()
 
unsigned long long int get_numeric_ID () const
 
- Public Member Functions inherited from GranOO3::Core::PropClass< PeriodicBoundary >
 PropClass ()
 
virtual ~PropClass ()
 
T & new_object ()
 
T & get ()
 
const T & get () const
 
bool prop_exist () const
 
void add_prop (Core::Prop< PeriodicBoundary > *)
 
void remove_prop (Core::Prop< PeriodicBoundary > *)
 
std::string info () const
 
- Public Member Functions inherited from GranOO3::Core::Register< PeriodicBoundary >
 Register ()
 
virtual ~Register ()
 
void erase_from_all_setof ()
 
bool belong_to_setof (const std::string &setOfId) const
 
bool belong_to_setof (const SetOf< PeriodicBoundary > &set) const
 
std::list< SetOf< PeriodicBoundary > * > & get_setof_list ()
 
unsigned long long int get_numeric_ID () const
 
- Public Member Functions inherited from GranOO3::Core::PropClass< Full3D >
 PropClass ()
 
virtual ~PropClass ()
 
T & new_object ()
 
T & get ()
 
const T & get () const
 
bool prop_exist () const
 
void add_prop (Core::Prop< Full3D > *)
 
void remove_prop (Core::Prop< Full3D > *)
 
std::string info () const
 
- Public Member Functions inherited from GranOO3::Core::Register< Full3D >
 Register ()
 
virtual ~Register ()
 
void erase_from_all_setof ()
 
bool belong_to_setof (const std::string &setOfId) const
 
bool belong_to_setof (const SetOf< Full3D > &set) const
 
std::list< SetOf< Full3D > * > & get_setof_list ()
 
unsigned long long int get_numeric_ID () const
 

Static Public Member Functions

static Full3Dget ()
 get the singleton instance of the periodic boundaries More...
 
- Static Public Member Functions inherited from GranOO3::DEM::PeriodicBoundary
static PeriodicBoundaryget ()
 get the singleton instance of the periodic boundaries More...
 
- Static Public Member Functions inherited from GranOO3::Core::Base
static Baseget_by_numID (size_t)
 
static void clear_all_numID ()
 
static unsigned int get_sub_class_number ()
 
- Static Public Member Functions inherited from GranOO3::Core::Drawable
static Drawableget_drawable_item_by_glkey (int)
 
static void set_draw_precision (unsigned int p)
 
static void increase_draw_precision ()
 
static void decrease_draw_precision ()
 
static unsigned int get_draw_precision ()
 

Private Member Functions

 Full3D (const Full3D &)=delete
 
Full3Doperator= (const Full3D &)=delete
 
template<class Archive >
void serialize (Archive &, const unsigned int)
 complete serializing of the periodic boundary in the *.gdd format More...
 

Private Attributes

Geom::Vector _a
 a vector, representing the length along x More...
 
Geom::Vector _b
 a vector, representing the length along y More...
 
Geom::Vector _c
 a vector, representing the length along z More...
 

Static Private Attributes

static Full3D_me = nullptr
 a pointer to the singleton More...
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Static Public Attributes inherited from GranOO3::Core::Null
static Null null = Null()
 
- Protected Member Functions inherited from GranOO3::DEM::PeriodicBoundary
template<class Archive >
void serialize (Archive &, const unsigned int)
 complete serializing of the FractureFacet in the *.gdd format More...
 
- Protected Member Functions inherited from GranOO3::Core::Base
 Base ()
 
- Static Protected Member Functions inherited from GranOO3::Core::Base
static unsigned int affect_class_rank_ID ()
 
- Protected Attributes inherited from GranOO3::DEM::PeriodicBoundary
std::function< Geom::Vector(const Geom::Vector &, bool &)> _periodic_mv_function
 a simple function for moving master elements from one boundary to another More...
 
std::vector< std::function< Geom::Vector(const Geom::Vector &)> > _follow_master_function
 a list of simple functions for moving slave elements considering the master More...
 
- Protected Attributes inherited from GranOO3::Core::PropClass< PeriodicBoundary >
std::vector< Core::Prop< PeriodicBoundary > * > _prop
 
- Protected Attributes inherited from GranOO3::Core::PropClass< Full3D >
std::vector< Core::Prop< Full3D > * > _prop
 

Detailed Description

a singleton virtual class for representing periodic boundaries

This class represent a full 3D periodic boundary. It simply represents a box where each opposite faces periodic. The length and direction of the box are stored in three vectors _a, _b, and _c. Initially these vectors are perpendicular unit vector. The magnitude of these vectors can be changed to match the length of the box. In addition, the angle between vector (initially equal de 90 degree) can be changed to distort the domain.

Constructor & Destructor Documentation

◆ Full3D() [1/2]

GranOO3::DEM::Full3D::Full3D ( )

constructor

◆ ~Full3D()

GranOO3::DEM::Full3D::~Full3D ( )
virtual

destructor

◆ Full3D() [2/2]

GranOO3::DEM::Full3D::Full3D ( const Full3D )
privatedelete

Member Function Documentation

◆ distort_on_x()

void GranOO3::DEM::Full3D::distort_on_x ( double  angle)

distort the periodic domain along x

Parameters
[in]angle: the angle value for distorting the domain

This method apply a distorsion angle along x to the domain. Applying a distorsion angle lead to deform the periodic box to a configuration where the _b and _c are not perpendicular. After applying a distortion angle, the angle between _b and _c is 90° - angle. This method can be used for applying pure shear in a periodic domain.

◆ distort_on_y()

void GranOO3::DEM::Full3D::distort_on_y ( double  angle)

distort the periodic domain along y

Parameters
[in]angle: the angle value for distorting the domain

This method apply a distorsion angle along y to the domain. Applying a distorsion angle lead to deform the periodic box to a configuration where the _a and _c are not perpendicular. After applying a distortion angle, the angle between _a and _c is 90° - angle. This method can be used for applying pure shear in a periodic domain.

◆ distort_on_z()

void GranOO3::DEM::Full3D::distort_on_z ( double  angle)

distort the periodic domain along z

Parameters
[in]angle: the angle value for distorting the domain

This method apply a distorsion angle along z to the domain. Applying a distorsion angle lead to deform the periodic box to a configuration where the _a and _b are not perpendicular. After applying a distortion angle, the angle between _a and _b is 90° - angle. This method can be used for applying pure shear in a periodic domain.

◆ draw()

void GranOO3::DEM::Full3D::draw ( )
virtual

a pure virtual function to draw the domain

This function is used by the granoo-viewer tool in order to visualize the periodic boundary.

Implements GranOO3::DEM::PeriodicBoundary.

◆ get()

Full3D & GranOO3::DEM::Full3D::get ( )
static

get the singleton instance of the periodic boundaries

◆ get_lx()

double GranOO3::DEM::Full3D::get_lx ( ) const

get the length of the periodic box along x

Returns
the periodic length

This method return the norm of the _a vector

◆ get_ly()

double GranOO3::DEM::Full3D::get_ly ( ) const

get the length of the periodic box along y

Returns
the periodic length

This method return the norm of the _b vector

◆ get_lz()

double GranOO3::DEM::Full3D::get_lz ( ) const

get the length of the periodic box along z

Returns
the periodic length

This method return the norm of the _c vector

◆ info()

std::string GranOO3::DEM::Full3D::info ( ) const
virtual

get some info on the periodic bounday

Returns
a string that contains some info

Reimplemented from GranOO3::DEM::PeriodicBoundary.

◆ init_function()

void GranOO3::DEM::Full3D::init_function ( )
virtual

a function that must be triggered to initialize the periodic boundary

This function must be triggered in order to initialize the _follow_master_function of the base class PeriodicBoundary

Implements GranOO3::DEM::PeriodicBoundary.

◆ operator=()

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

◆ read_ascii()

std::istream & GranOO3::DEM::Full3D::read_ascii ( std::istream &  is)
virtual

update the current state of periodic boundary from an ascii file format *.lgdd

Parameters
[in]is: the stream where the data are read
Returns
the stream
See also
the Domain classes to get additional info about I/O

TODO, this feature is not yet implemented (only gdd file are supported)

Reimplemented from GranOO3::DEM::PeriodicBoundary.

◆ scale_bounding_box()

void GranOO3::DEM::Full3D::scale_bounding_box ( double  factor)

apply an expansion factor to the length of the periodic box

Parameters
[in]factor: the expansion factor to apply

This function simply apply a factor to the length _a, _b, _c, of the periodic box. If the factor is higher than 1, the periodic box expands and it contracts otherwise.

◆ serialize()

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

complete serializing of the periodic boundary in the *.gdd format

See also
the Domain classes to get additional info about I/O

◆ set_bounding_box() [1/2]

void GranOO3::DEM::Full3D::set_bounding_box ( const Shape::Box box)

set the length of the periodic box

Parameters
[in]box: a box that will be taken as model

This function simply set the length _a, _b, _c, of the periodic box

◆ set_bounding_box() [2/2]

void GranOO3::DEM::Full3D::set_bounding_box ( double  lx,
double  ly,
double  lz 
)

set the length of the periodic box

Parameters
[in]lx: the length along x for setting _a
[in]ly: the length along y for setting _b
[in]lz: the length along z for setting _c

This function simply set the length _a, _b, _c, of the periodic box

◆ set_length_on_x()

void GranOO3::DEM::Full3D::set_length_on_x ( double  value)

set the length of the periodic box along x

Parameters
[in]value: the length value

This method set the length along x, it simply set the norm of _a vector to the value

◆ set_length_on_y()

void GranOO3::DEM::Full3D::set_length_on_y ( double  value)

set the length of the periodic box along y

Parameters
[in]value: the length value

This method set the length along y, it simply set the norm of _b vector to the value

◆ set_length_on_z()

void GranOO3::DEM::Full3D::set_length_on_z ( double  value)

set the length of the periodic box along z

Parameters
[in]value: the length value

This method set the length along z, it simply set the norm of _c vector to the value

◆ write_ascii()

std::ostream & GranOO3::DEM::Full3D::write_ascii ( std::ostream &  os) const
virtual

dump the current state of the periodic boundary in a ascii file (standard *.lgdd format)

Parameters
[in]os: the stream where the data will be written
Returns
the stream (with the expected additional data)
See also
the Domain classes to get additional info about I/O

TODO, this feature is not yet implemented (only gdd file are supported)

Reimplemented from GranOO3::DEM::PeriodicBoundary.

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Member Data Documentation

◆ _a

Geom::Vector GranOO3::DEM::Full3D::_a
private

a vector, representing the length along x

The vector is initially along the global x axis. However, this direction could change a little bit if you apply a distorsion.

◆ _b

Geom::Vector GranOO3::DEM::Full3D::_b
private

a vector, representing the length along y

The vector is initially along the global y axis. However, this direction could change a little bit if you apply a distorsion.

◆ _c

Geom::Vector GranOO3::DEM::Full3D::_c
private

a vector, representing the length along z

The vector is initially along the global z axis. However, this direction could change a little bit if you apply a distorsion.

◆ _me

Full3D * GranOO3::DEM::Full3D::_me = nullptr
staticprivate

a pointer to the singleton


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