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::ElementT< shape > Class Template Reference

a template class that model an element with a given shape More...

#include <ElementT.hpp>

Inheritance diagram for GranOO3::DEM::ElementT< shape >:
Inheritance graph
[legend]

Public Member Functions

 ElementT (const Geom::Point &pos, double radius, double density)
 constructor mainly used for spherical element More...
 
 ElementT (const Geom::Point &pos, double density)
 constructor More...
 
 ElementT (const Geom::Point &pos)
 constructor More...
 
 ElementT ()
 default constructor More...
 
virtual ~ElementT ()
 destructor More...
 
virtual void draw ()
 util method for GL drawing the element (used by granoo-viewer) More...
 
virtual void draw_edge ()
 
virtual std::string info () const
 get some info on a given element More...
 
std::string shape_class_ID () const
 get the related shape classID More...
 
double get_volume () const
 get the volume the element More...
 
const Geom::Vectorget_position () const
 get the current position vector of the element More...
 
virtual Core::Baseclone ()
 clone the current ElementT More...
 
void make_equal_to (const ElementT &el)
 for equalizing two elements More...
 
virtual bool is_spherical_element () const
 util method for knowing if the element is spherical or not More...
 
virtual bool is_polyhedral_element () const
 util method for knowing if the element is polyhedral or not More...
 
virtual std::ostream & write_ascii (std::ostream &os) const
 dump the current state of the element in a ascii file (standard *.lgdd format) More...
 
virtual std::istream & read_ascii (std::istream &is)
 update the current state of the element from an ascii file format *.lgdd More...
 
 ElementT (const Geom::Point &p, double radius, double density)
 
bool is_spherical_element () const
 util method for knowing if the element is spherical or not More...
 
bool is_polyhedral_element () const
 util method for knowing if the element is polyhedral or not More...
 
- Public Member Functions inherited from GranOO3::DEM::Element
 Element (Shape::Volume &shape, const Geom::Point &point)
 constructor More...
 
 Element (Shape::Volume &shape)
 constructor More...
 
virtual ~Element ()=0
 destructor More...
 
void add_bond (Bond &b)
 add a bond to the _bondset list More...
 
void erase_bond (Bond &b)
 erase a bond from the _bondset list More...
 
bool is_bonded (const Element &el) const
 ask if the current element is bonded to another one More...
 
bool is_bonded (const Element &el, Bond *&commonBond)
 ask if the current element is bonded to another one More...
 
bool is_bonded (const Element &el, const Bond *&commonBond) const
 similar as is_bonded(const Element& el, Bond*& commonBond), given for convenience More...
 
bool is_bonded (const Bond &bond) const
 ask if the current element is bonded to bond More...
 
Bondcommon_bond (const Element &el)
 returns the bond that bonds the current element with the el element More...
 
const Bondcommon_bond (const Element &el) const
 
void delete_all_bond ()
 delete all the bond connected to the current element More...
 
Core::SetOfBase< Bond > & get_bond_set ()
 get the bond list of the current element More...
 
size_t get_bond_number () const
 get the number of bond connected to the current element More...
 
Core::SetOfBase< Elementget_bonded_element ()
 get a list of bonded element More...
 
bool is_unbonded () const
 util method to know if the current element is unbonded More...
 
bool is_bonded () const
 util method to know if the current element is bonded More...
 
double compute_kinetic_energy () const
 compute the kinetic energy of the current element More...
 
void compute_bond_cluster (Core::SetOfBase< DEM::Element > &cluster_set, Core::SetOfBase< DEM::Bond > &parsed_bond)
 util method for detecting a cluster More...
 
NeighbourManager< Element > & neighbour ()
 get a list of neighbour element More...
 
const NeighbourManager< Element > & neighbour () const
 same as Element::neighbour(), provided for convenience More...
 
Core::SetOfBase< Element > & neighbour_set ()
 get a list of neighbour element More...
 
const Core::SetOfBase< Element > & neighbour_set () const
 same as neighbour_set(), provided for convenience More...
 
void make_equal_to (const Element &el)
 for equalizing two elements More...
 
- Public Member Functions inherited from GranOO3::Physic::Body
 Body (Shape::Volume &shape, const Geom::Point &p, const Geom::Quaternion &q, double mass, const Geom::Tensor &inertia)
 constructor More...
 
 Body (Shape::Volume &shape, const Geom::Point &p)
 constructor More...
 
 Body (Shape::Volume &shape)
 constructor More...
 
virtual ~Body ()=0
 destructor More...
 
void set_inertia_tensor (const Geom::Tensor &inertia)
 set the inertia tensor value More...
 
void set_density (double density)
 set the density value More...
 
Geom::Vector compute_torque_at (const Geom::Point &A) const
 
double get_kinetic_energy () const
 
double get_mass () const
 get the current mass value of the body More...
 
void apply_force_at (const Geom::Vector &, const Geom::Point &)
 
const Shape::Volumeto_volume_shape () const
 cast the current object to Shape::Volume More...
 
Shape::Volumeto_volume_shape ()
 cast the current object to Shape::Volume More...
 
double get_volume () const
 get the current volume of the body More...
 
double get_bounding_radius () const
 get the current bounding radius of the body More...
 
AABB aabb () const
 get the aabb tree the body More...
 
bool collide (const Body &other, Collision::Data &col)
 collision detection with another body More...
 
bool collide (const Body &other)
 collision detection with another body More...
 
void make_equal_to (const Body &other)
 for equalizing two bodies More...
 
std::string info () const
 Display some useful info in the terminal
More...
 
virtual std::ostream & export_to_povray (std::ostream &out) const
 exporting to povray format More...
 
- Public Member Functions inherited from GranOO3::Physic::Node
 Node (const Geom::Vector &position)
 
 Node (const Geom::Point &position)
 
 Node ()
 
virtual ~Node ()
 
void clear_force ()
 
void clear_torque ()
 
const Geom::Framelocal_frame () const
 
void incremental_move (const Geom::Vector &vec)
 
void incremental_unmove (const Geom::Vector &vec)
 
void update_position_from_displacement ()
 
void update_displacement_from_position ()
 
void set_displacement (const Geom::Vector &)
 
void clear_displacement ()
 
void set_displacement_x (const double &)
 
void set_displacement_y (const double &)
 
void set_displacement_z (const double &)
 
void set_position (const Geom::Vector &)
 
void set_position_x (const double &)
 
void set_position_y (const double &)
 
void set_position_z (const double &)
 
void set_center (const Geom::Point &)
 
void update_initial_parameter_to_current_parameter ()
 
void update_from_fem ()
 
void update_from_dem ()
 
void add_interaction (Node &)
 
void erase_interaction (Node &)
 
bool interact_with (const Node &) const
 
bool interact_with (const Ground &) const
 
bool interact_with (const FEM::Surface &) const
 
void apply_force (const Geom::Vector &)
 
void apply_torque (const Geom::Vector &)
 
void set_quaternion_velocity_from_angular_velocity (const Geom::Vector &angularVelocity)
 
void set_quaternion_acceleration_from_angular_acceleration (const Geom::Vector &angularAcceleration, const Geom::Vector &angularVelocity)
 
void update_angular_velocity ()
 
virtual void clear_kinematic ()
 
Geom::Vector get_linear_velocity_at (const Geom::Point &) const
 
void make_equal_to (const Node &)
 
- 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
 
template<class T >
T & clone_to ()
 
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 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< Node >
 PropClass ()
 
virtual ~PropClass ()
 
T & new_object ()
 
T & get ()
 
const T & get () const
 
bool prop_exist () const
 
void add_prop (Core::Prop< Node > *)
 
void remove_prop (Core::Prop< Node > *)
 
std::string info () const
 
- Public Member Functions inherited from GranOO3::Core::Register< Node >
 Register ()
 
virtual ~Register ()
 
void erase_from_all_setof ()
 
bool belong_to_setof (const std::string &setOfId) const
 
bool belong_to_setof (const SetOf< Node > &set) const
 
std::list< SetOf< Node > * > & get_setof_list ()
 
unsigned long long int get_numeric_ID () const
 
- Public Member Functions inherited from GranOO3::Core::PropClass< Body >
 PropClass ()
 
virtual ~PropClass ()
 
T & new_object ()
 
T & get ()
 
const T & get () const
 
bool prop_exist () const
 
void add_prop (Core::Prop< Body > *)
 
void remove_prop (Core::Prop< Body > *)
 
std::string info () const
 
- Public Member Functions inherited from GranOO3::Core::Register< Body >
 Register ()
 
virtual ~Register ()
 
void erase_from_all_setof ()
 
bool belong_to_setof (const std::string &setOfId) const
 
bool belong_to_setof (const SetOf< Body > &set) const
 
std::list< SetOf< Body > * > & get_setof_list ()
 
unsigned long long int get_numeric_ID () const
 
- Public Member Functions inherited from GranOO3::Core::PropClass< Element >
 PropClass ()
 
virtual ~PropClass ()
 
T & new_object ()
 
T & get ()
 
const T & get () const
 
bool prop_exist () const
 
void add_prop (Core::Prop< Element > *)
 
void remove_prop (Core::Prop< Element > *)
 
std::string info () const
 
- Public Member Functions inherited from GranOO3::Core::Register< Element >
 Register ()
 
virtual ~Register ()
 
void erase_from_all_setof ()
 
bool belong_to_setof (const std::string &setOfId) const
 
bool belong_to_setof (const SetOf< Element > &set) const
 
std::list< SetOf< Element > * > & get_setof_list ()
 
unsigned long long int get_numeric_ID () const
 
- Public Member Functions inherited from GranOO3::Core::PropClass< ElementT< shape > >
 PropClass ()
 
virtual ~PropClass ()
 
T & new_object ()
 
T & get ()
 
const T & get () const
 
bool prop_exist () const
 
void add_prop (Core::Prop< ElementT< shape > > *)
 
void remove_prop (Core::Prop< ElementT< shape > > *)
 
std::string info () const
 
- Public Member Functions inherited from GranOO3::Core::Register< ElementT< shape > >
 Register ()
 
virtual ~Register ()
 
void erase_from_all_setof ()
 
bool belong_to_setof (const std::string &setOfId) const
 
bool belong_to_setof (const SetOf< ElementT< shape > > &set) const
 
std::list< SetOf< ElementT< shape > > * > & get_setof_list ()
 
unsigned long long int get_numeric_ID () const
 

Private Member Functions

 ElementT (const ElementT &)=delete
 
ElementToperator= (const ElementT &)=delete
 
template<class Archive >
void serialize (Archive &, const unsigned int)
 complete serializing of the element in the *.gdd format More...
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Static Public Member Functions inherited from GranOO3::DEM::Element
static Elementnew_object (const TiXmlElement *el)
 instantiate a new element from an XML input file 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 ()
 
- Static Public Attributes inherited from GranOO3::Core::Null
static Null null = Null()
 
- 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::Element
Core::SetOfBase< Bond_bondset
 the always up-to-date list of bond which are bonded to the current element More...
 
NeighbourManager< Element_neighbour
 the always up-to-date list of bond which are bonded to the current element More...
 
- Protected Attributes inherited from GranOO3::Physic::Body
double _density
 the density value of the body More...
 
double _mass
 the mass value of the body More...
 
Geom::Tensor _inertia_tensor
 the inertia tensor of the body More...
 
Geom::Tensor _inverse_inertia_tensor
 the inverse of the inertia tensor of the body More...
 
- Protected Attributes inherited from GranOO3::Core::PropClass< Node >
std::vector< Core::Prop< Node > * > _prop
 
- Protected Attributes inherited from GranOO3::Core::PropClass< Body >
std::vector< Core::Prop< Body > * > _prop
 
- Protected Attributes inherited from GranOO3::Core::PropClass< Element >
std::vector< Core::Prop< Element > * > _prop
 
- Protected Attributes inherited from GranOO3::Core::PropClass< ElementT< shape > >
std::vector< Core::Prop< ElementT< shape > > * > _prop
 

Detailed Description

template<class shape>
class GranOO3::DEM::ElementT< shape >

a template class that model an element with a given shape

Template Parameters
shapethe real shape of the ElementT

This template class ElementT<shape> derives from two classes :

In such way an ElementT<T> object is both an element and a volume shape. So, you can either ask an ElementT<T> for getting its mass and its lengths.

Constructor & Destructor Documentation

◆ ElementT() [1/6]

template<class shape >
GranOO3::DEM::ElementT< shape >::ElementT ( const Geom::Point pos,
double  radius,
double  density 
)

constructor mainly used for spherical element

Parameters
[in]pos: initial position of the element
[in]radius: radius of the element
[in]density: density of the element (mass per volume)

◆ ElementT() [2/6]

template<class shape >
GranOO3::DEM::ElementT< shape >::ElementT ( const Geom::Point pos,
double  density 
)

constructor

Parameters
[in]pos: initial position of the element
[in]density: density of the element (mass per volume)

◆ ElementT() [3/6]

template<class shape >
GranOO3::DEM::ElementT< shape >::ElementT ( const Geom::Point pos)

constructor

Parameters
[in]pos: initial position of the element

◆ ElementT() [4/6]

template<class shape >
GranOO3::DEM::ElementT< shape >::ElementT

default constructor

◆ ~ElementT()

template<class shape >
GranOO3::DEM::ElementT< shape >::~ElementT
virtual

destructor

◆ ElementT() [5/6]

template<class shape >
GranOO3::DEM::ElementT< shape >::ElementT ( const ElementT< shape > &  )
privatedelete

◆ ElementT() [6/6]

GranOO3::DEM::ElementT< Shape::Sphere >::ElementT ( const Geom::Point p,
double  radius,
double  density 
)

Member Function Documentation

◆ clone()

template<class shape >
Core::Base & GranOO3::DEM::ElementT< shape >::clone
virtual

clone the current ElementT

Returns
a new instance corresponding to the clone of the current element

Note that this instance create a new instance of the class ElementT<shape>. The Core::Base reference returned by this method is a reference through this new instance.

Reimplemented from GranOO3::Core::Base.

Reimplemented in GranOO3::DEM::DiscreteElement.

◆ draw()

template<class shape >
void GranOO3::DEM::ElementT< shape >::draw
virtual

util method for GL drawing the element (used by granoo-viewer)

Reimplemented from GranOO3::Physic::Node.

◆ draw_edge()

template<class shape >
void GranOO3::DEM::ElementT< shape >::draw_edge
virtual

Reimplemented from GranOO3::Core::Drawable.

◆ get_position()

template<class shape >
const Geom::Vector & GranOO3::DEM::ElementT< shape >::get_position

get the current position vector of the element

Returns
the current position vector

This method is given here for avoiding confusion with the base class shape

◆ get_volume()

template<class shape >
double GranOO3::DEM::ElementT< shape >::get_volume

get the volume the element

Returns
the volume

This method is given here for avoiding confusion with the base class shape

◆ info()

template<class shape >
std::string GranOO3::DEM::ElementT< shape >::info
virtual

get some info on a given element

Returns
a string that contains some info about the element

Reimplemented from GranOO3::DEM::Element.

Reimplemented in GranOO3::DEM::DiscreteElement.

◆ is_polyhedral_element() [1/2]

bool GranOO3::DEM::ElementT< Shape::Polyhedron >::is_polyhedral_element ( ) const
virtual

util method for knowing if the element is polyhedral or not

Returns
true if the element is polyhedral, false otherwise

Note that this method is pure virtual because the Element class does not know its real shape

Implements GranOO3::DEM::Element.

◆ is_polyhedral_element() [2/2]

template<class shape >
bool GranOO3::DEM::ElementT< shape >::is_polyhedral_element
virtual

util method for knowing if the element is polyhedral or not

Returns
true if the element is polyhedral, false otherwise

Implements GranOO3::DEM::Element.

◆ is_spherical_element() [1/2]

bool GranOO3::DEM::ElementT< Shape::Sphere >::is_spherical_element ( ) const
virtual

util method for knowing if the element is spherical or not

Returns
true if the element is spherical, false otherwise

Note that this method is pure virtual because the Element class does not know its real shape

Implements GranOO3::DEM::Element.

◆ is_spherical_element() [2/2]

template<class shape >
bool GranOO3::DEM::ElementT< shape >::is_spherical_element
virtual

util method for knowing if the element is spherical or not

Returns
true if the element is spherical, false otherwise

Implements GranOO3::DEM::Element.

◆ make_equal_to()

template<class shape >
void GranOO3::DEM::ElementT< shape >::make_equal_to ( const ElementT< shape > &  el)

for equalizing two elements

Parameters
[in]el: the element which will be used as a model for equalizing

This method can be used for equalizing the current element (this) to another one (el). When you equalize two elements, they have the same position, velocity, mass, etc. This method can be used used for cloning elements.

◆ operator=()

template<class shape >
ElementT& GranOO3::DEM::ElementT< shape >::operator= ( const ElementT< shape > &  )
privatedelete

◆ read_ascii()

template<class shape >
std::istream & GranOO3::DEM::ElementT< shape >::read_ascii ( std::istream &  is)
virtual

update the current state of the element 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

Reimplemented from GranOO3::DEM::Element.

Reimplemented in GranOO3::DEM::DiscreteElement.

◆ serialize()

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

complete serializing of the element in the *.gdd format

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

◆ shape_class_ID()

template<class shape >
std::string GranOO3::DEM::ElementT< shape >::shape_class_ID
virtual

get the related shape classID

Returns
the shape classID

As this method is pure virtual, this method returns the "true" class_ID of the shape ("Sphere", "Cone", etc.)

Returns
the shape classID

Implements GranOO3::DEM::Element.

◆ write_ascii()

template<class shape >
std::ostream & GranOO3::DEM::ElementT< shape >::write_ascii ( std::ostream &  os) const
virtual

dump the current state of the element 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

Reimplemented from GranOO3::DEM::Element.

Reimplemented in GranOO3::DEM::DiscreteElement.

Friends And Related Function Documentation

◆ boost::serialization::access

template<class shape >
friend class boost::serialization::access
friend

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