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::DiscreteElement Class Reference

the discrete element is just a spherical Element with additional dedicated features More...

#include <DiscreteElement.hpp>

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

Public Member Functions

 DiscreteElement (const Geom::Point &center, double radius, double density)
 constructor More...
 
 DiscreteElement (const Geom::Point &center)
 constructor More...
 
 DiscreteElement ()
 constructor More...
 
virtual ~DiscreteElement ()
 destructor More...
 
virtual Core::Baseclone ()
 clone the object More...
 
void make_equal_to (const DiscreteElement &)
 equalize a DiscreteElement More...
 
double get_radius () const
 get the radius More...
 
virtual std::string info () const
 Display some useful info in the terminal
More...
 
virtual std::ostream & write_ascii (std::ostream &out) const
 dump the current state of the discrete element in a ascii file (standard *.lgdd format) More...
 
virtual std::istream & read_ascii (std::istream &in)
 update the current state of the discrete element from an ascii file format *.lgdd More...
 
- Public Member Functions inherited from GranOO3::DEM::ElementT< Shape::Sphere >
 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...
 
 ElementT (const Geom::Point &p, double radius, double density)
 
virtual ~ElementT ()
 destructor More...
 
virtual void draw ()
 util method for GL drawing the element (used by granoo-viewer) More...
 
virtual void draw_edge ()
 
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...
 
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...
 
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...
 
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...
 
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::Shape::Sphere
 Sphere ()
 
 Sphere (double radius)
 
 Sphere (double radius, const Geom::Frame &frame)
 
 Sphere (const Sphere &)
 
 Sphere (const Sphere &, const Geom::Frame &)
 
 Sphere (const Geom::Frame &)
 
virtual ~Sphere ()
 
void make_equal_to (const Sphere &)
 
void read_xml_element (const TiXmlElement *el)
 
virtual void to_vtk (vtkUnstructuredGrid *data)
 
void update_bounding_box ()
 
void update_bounding_sphere ()
 
double get_greatest_dimension () const
 
AABB aabb () const
 
Interference locate (const Geom::Point &) const
 
Interference locate (const Geom::Point &, double radius) const
 
bool collide_inside (const Geom::Point &p1, double radius, Collision::Data &info) const
 
bool collide_outside (const Geom::Point &p1, double radius, Collision::Data &info) const
 
Geom::Point farthest_point_along (const Geom::Vector &) const
 
void compute_inertia_tensor (double density, Geom::Tensor &) const
 
void draw_gl () const
 
void scale (double)
 
std::ostream & to_povray (std::ostream &out, const Core::Color &y) const
 
- Public Member Functions inherited from GranOO3::Shape::Volume
 Volume (const Geom::Frame &frame)
 
virtual ~Volume ()
 
bool is_surface () const
 
bool is_volume () const
 
const Boxget_bounding_box () const
 
const Sphereget_bounding_sphere () const
 
Boxget_bounding_box ()
 
Sphereget_bounding_sphere ()
 
void update_bounding_shape ()
 
bool is_bounding_shape () const
 
template<Interference T>
bool overlap (const Sphere &, Geom::Vector &normal, double &penetration) const
 
Interference locate (const Sphere &) const
 
bool collide_inside (const Geom::Point &, Collision::Data &) const
 
bool collide_outside (const Geom::Point &, Collision::Data &) const
 
virtual bool collide (const Volume &, Collision::Data &) const =0
 
virtual bool collide (const Sphere &, Collision::Data &) const =0
 
virtual bool collide (const Box &, Collision::Data &) const =0
 
virtual bool collide (const Cylinder &, Collision::Data &) const =0
 
virtual bool collide (const Cone &, Collision::Data &) const =0
 
virtual bool collide (const ConeTruncated &, Collision::Data &) const =0
 
virtual bool collide (const Polyhedron &, Collision::Data &) const =0
 
const std::set< std::string > & get_face_ID () const
 
template<>
bool overlap (const Sphere &s, Geom::Vector &normal, double &penetration) const
 
template<>
bool overlap (const Sphere &s, Geom::Vector &normal, double &penetration) const
 
template<>
bool overlap (const Sphere &s, Geom::Vector &normal, double &penetration) const
 
- Public Member Functions inherited from GranOO3::Shape::Base
 Base (const Geom::Frame &frame)
 
virtual ~Base ()
 
virtual void draw_gl_edge () const
 
void unscale (double)
 
virtual void add_glob (const std::string &)=0
 
const Geom::Framelocal_frame () const
 
const Geom::Pointget_center () const
 
const Geom::Quaternionget_quaternion () const
 
const Geom::Vectorget_position () const
 
void translate (Geom::Vector &)
 
void rotate (const Geom::Vector &axis, const double angleRadian)
 
- Public Member Functions inherited from GranOO3::Core::PropClass< C >
 PropClass ()
 
virtual ~PropClass ()
 
template<class T >
T & new_object ()
 
template<class T >
T & get ()
 
template<class T >
const T & get () const
 
template<class T >
bool prop_exist () const
 
template<class T >
void add_prop (Core::Prop< C > *)
 
void remove_prop (Core::Prop< C > *)
 
std::string info () const
 
- Public Member Functions inherited from GranOO3::Core::Register< type >
 Register ()
 
virtual ~Register ()
 
void erase_from_all_setof ()
 
bool belong_to_setof (const std::string &setOfId) const
 
bool belong_to_setof (const SetOf< type > &set) const
 
std::list< SetOf< type > * > & get_setof_list ()
 
unsigned long long int get_numeric_ID () const
 
- Public Member Functions inherited from GranOO3::Core::PropClass< DiscreteElement >
 PropClass ()
 
virtual ~PropClass ()
 
T & new_object ()
 
T & get ()
 
const T & get () const
 
bool prop_exist () const
 
void add_prop (Core::Prop< DiscreteElement > *)
 
void remove_prop (Core::Prop< DiscreteElement > *)
 
std::string info () const
 
- Public Member Functions inherited from GranOO3::Core::Register< DiscreteElement >
 Register ()
 
virtual ~Register ()
 
void erase_from_all_setof ()
 
bool belong_to_setof (const std::string &setOfId) const
 
bool belong_to_setof (const SetOf< DiscreteElement > &set) const
 
std::list< SetOf< DiscreteElement > * > & get_setof_list ()
 
unsigned long long int get_numeric_ID () const
 

Private Member Functions

 DiscreteElement (const DiscreteElement &)=delete
 
DiscreteElementoperator= (const DiscreteElement &)=delete
 
template<class Archive >
void serialize (Archive &, const unsigned int)
 

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 Member Functions inherited from GranOO3::Shape::Sphere
static std::string class_ID ()
 
static std::string desc ()
 
- Static Public Member Functions inherited from GranOO3::Shape::Volume
static std::string class_ID ()
 
- Static Public Member Functions inherited from GranOO3::Shape::Base
static Baseglob (const std::string &id)
 
static const Geom::Frameframe_buffer ()
 
static std::string class_ID ()
 
static Basenew_object (const TiXmlElement *el)
 
- Static Public Member Functions inherited from GranOO3::Core::ObjectFactoryInterface< Base, Sphere >
static Basebuild ()
 
static bool record (const std::string &id, std::string file_name="", std::string desc="")
 
- Static Public Member Functions inherited from GranOO3::Core::ObjectFactory< BaseClass >
static void record (std::function< BaseClass *()>, const std::string &, const std::string file="", const std::string desc="")
 
static BaseClass * new_object (const std::string &)
 
static std::vector< std::string > get_ID ()
 
static std::map< const std::string, std::function< BaseClass *()> > & get_map ()
 
- Static Public Attributes inherited from GranOO3::Core::Null
static Null null = Null()
 
- Protected Member Functions inherited from GranOO3::Core::Base
 Base ()
 
- Protected Member Functions inherited from GranOO3::Shape::Volume
template<typename T , typename ... Args>
void set_face_ID (const T &, Args... args)
 
template<typename T >
void set_face_ID (const T &)
 
void copy_face_ID (const std::set< std::string > &)
 
void add_face_ID (const std::string &)
 
- Protected Member Functions inherited from GranOO3::Core::ObjectFactoryInterface< Base, Sphere >
 ObjectFactoryInterface ()
 
virtual ~ObjectFactoryInterface ()
 
- Protected Member Functions inherited from GranOO3::Core::ObjectFactory< BaseClass >
 ObjectFactory ()
 
virtual ~ObjectFactory ()
 
- 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::Shape::Base
const Geom::Frame_frame
 
- Protected Attributes inherited from GranOO3::Core::PropClass< C >
std::vector< Core::Prop< C > * > _prop
 
- Protected Attributes inherited from GranOO3::Core::PropClass< DiscreteElement >
std::vector< Core::Prop< DiscreteElement > * > _prop
 

Detailed Description

the discrete element is just a spherical Element with additional dedicated features

Constructor & Destructor Documentation

◆ DiscreteElement() [1/4]

GranOO3::DEM::DiscreteElement::DiscreteElement ( const Geom::Point center,
double  radius,
double  density 
)

constructor

Parameters
[in]center: center of the discrete element (initial position)
[in]radius: radius of the discrete element
[in]density: density of the discrete element

◆ DiscreteElement() [2/4]

GranOO3::DEM::DiscreteElement::DiscreteElement ( const Geom::Point center)

constructor

Parameters
[in]center: center of the discrete element (initial position)

Some initial values are affected to undefined parameters such as density or radius.

◆ DiscreteElement() [3/4]

GranOO3::DEM::DiscreteElement::DiscreteElement ( )

constructor

Some initial values are affected to undefined parameters such as density or radius.

◆ ~DiscreteElement()

GranOO3::DEM::DiscreteElement::~DiscreteElement ( )
virtual

destructor

◆ DiscreteElement() [4/4]

GranOO3::DEM::DiscreteElement::DiscreteElement ( const DiscreteElement )
privatedelete

Member Function Documentation

◆ clone()

Core::Base & GranOO3::DEM::DiscreteElement::clone ( )
virtual

clone the object

Returns
a reference to the cloned object

This method create a new discrete element equals (same radius, same density, same position, etc.) and returns the new created object.

Reimplemented from GranOO3::DEM::ElementT< Shape::Sphere >.

◆ get_radius()

double GranOO3::DEM::DiscreteElement::get_radius ( ) const
inline

get the radius

Returns
the radius of the discrete element

◆ info()

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

Display some useful info in the terminal

Reimplemented from GranOO3::DEM::ElementT< Shape::Sphere >.

◆ make_equal_to()

void GranOO3::DEM::DiscreteElement::make_equal_to ( const DiscreteElement de)

equalize a DiscreteElement

Parameters
[in]de: the model discrete element

This method make equals the parameters (same radius, same density, same position, etc.) of the current object with another discrete element de

◆ operator=()

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

◆ read_ascii()

std::istream & GranOO3::DEM::DiscreteElement::read_ascii ( std::istream &  in)
virtual

update the current state of the discrete element from an ascii file format *.lgdd

Parameters
[in]in: 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::ElementT< Shape::Sphere >.

◆ serialize()

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

◆ write_ascii()

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

dump the current state of the discrete 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::ElementT< Shape::Sphere >.

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: