![]() |
GranOO
3.0
A robust and versatile workbench to build 3D dynamic simulations based on the Discrete Element Method
|
a base class that represents an element More...
#include <Element.hpp>
Public Member Functions | |
Element (Shape::Volume &shape, const Geom::Point &point) | |
constructor More... | |
Element (Shape::Volume &shape) | |
constructor More... | |
virtual | ~Element ()=0 |
destructor More... | |
virtual std::string | shape_class_ID () const =0 |
get the related shape classID 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... | |
Bond & | common_bond (const Element &el) |
returns the bond that bonds the current element with the el element More... | |
const Bond & | common_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< Element > | get_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... | |
virtual std::string | info () const |
get some info on a given element 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... | |
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... | |
virtual bool | is_spherical_element () const =0 |
util method for knowing if the element is spherical or not More... | |
virtual bool | is_polyhedral_element () const =0 |
util method for knowing if the element is polyhedral or not More... | |
![]() | |
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::Volume & | to_volume_shape () const |
cast the current object to Shape::Volume More... | |
Shape::Volume & | to_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... | |
![]() | |
Node (const Geom::Vector &position) | |
Node (const Geom::Point &position) | |
Node () | |
virtual | ~Node () |
void | clear_force () |
void | clear_torque () |
const Geom::Frame & | local_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 &) |
virtual void | draw () |
![]() | |
virtual | ~Base () |
size_t | numID () const |
size_t | uID () const |
void | set_numID (size_t val) |
void | clear_numID () |
Physic::Material & | get_mat () const |
void | set_mat (Physic::Material *) |
Base & | item () |
const Base & | item () 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 Base & | clone () |
template<class T > | |
T & | clone_to () |
Signal< Base & > & | deleted_signal () |
![]() | |
Null () | |
virtual | ~Null () |
![]() | |
Drawable () | |
virtual | ~Drawable () |
virtual void | draw_edge () |
virtual void | init_default_color () |
virtual std::ostream & | get_info (std::ostream &os) const |
virtual const Color & | default_color () const |
Color & | get_color () |
const Color & | get_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 |
![]() | |
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 |
![]() | |
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 |
![]() | |
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 |
![]() | |
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 |
![]() | |
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 |
![]() | |
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 |
![]() | |
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 |
Static Public Member Functions | |
static Element * | new_object (const TiXmlElement *el) |
instantiate a new element from an XML input file More... | |
![]() | |
static Base & | get_by_numID (size_t) |
static void | clear_all_numID () |
static unsigned int | get_sub_class_number () |
![]() | |
static Drawable & | get_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 () |
Protected Attributes | |
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... | |
![]() | |
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... | |
![]() | |
std::vector< Core::Prop< Node > * > | _prop |
![]() | |
std::vector< Core::Prop< Body > * > | _prop |
![]() | |
std::vector< Core::Prop< Element > * > | _prop |
Private Member Functions | |
Element (const Element &)=delete | |
Element & | operator= (const Element &)=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 Null | null = Null() |
![]() | |
Base () | |
![]() | |
static unsigned int | affect_class_rank_ID () |
a base class that represents an element
Be aware, an Element has no associated shape, so this is a pure virtual class. A shape is associated to an Element through its child template class ElementT.
Note that, for GranOO, a DiscreteElement is simply a spherical Element.
GranOO3::DEM::Element::Element | ( | Shape::Volume & | shape, |
const Geom::Point & | point | ||
) |
constructor
[in] | shape | : the shape to clone |
[in] | point | : initial position of the element |
GranOO3::DEM::Element::Element | ( | Shape::Volume & | shape | ) |
constructor
[in] | shape | : the shape to clone |
|
pure virtual |
destructor
Note that the destructor send a message to its related DEM::Bond for destructing them
|
privatedelete |
void GranOO3::DEM::Element::add_bond | ( | Bond & | bond | ) |
add a bond to the _bondset list
[in] | bond | : the bond to add |
This is a utility method for managing the _bondset list. In addition to the _bondset list, this method add the bonded Element to the _neighbour list
returns the bond that bonds the current element with the el
element
[in] | el | : the element to check |
This is a useful method for extracting a common bond between to element. Note that, if no common bond are detected, this method raises an assertion. So, you have to be sure that the el
element is connected to the current one.
void GranOO3::DEM::Element::compute_bond_cluster | ( | Core::SetOfBase< DEM::Element > & | cluster_set, |
Core::SetOfBase< DEM::Bond > & | parsed_bond | ||
) |
util method for detecting a cluster
[out] | cluster_set | : a list of element that represents the cluster of element |
[out] | parsed_bond | : a list of the bond that was parsed for creating the cluster |
This method can be used for retrieving a cluster of Element. A cluster is is simply a set of Element which are bonded. This method can be used for retrieving pieces of
element that detach from another one. Note that this method requires huge computational time as it use a recursive algorithm for finding cluster.
|
inline |
compute the kinetic energy of the current element
Here, the kinetic energy includes the linear and angular velocity part. Note that the way the kinetic energy is computed for the angular volicity is too simple (it is correct only for spherical element). TODO (we must revise this)
void GranOO3::DEM::Element::delete_all_bond | ( | ) |
delete all the bond connected to the current element
Note that this method, really delete the bonds by invoking their destructors
void GranOO3::DEM::Element::erase_bond | ( | Bond & | bond | ) |
erase a bond from the _bondset list
[in] | bond | : the bond to erase |
This is a utility method for managing the _bondset list. In addition to the _bondset list, this method remove the bonded Element to the _neighbour list
|
inline |
get the number of bond connected to the current element
|
inline |
get the bond list of the current element
Note that this method returns the list in read and write mode. It means that you can modify it. If you modify the list in such way, you must know what you do, because it could lead to unexpected behavior.
Core::SetOfBase< Element > GranOO3::DEM::Element::get_bonded_element | ( | ) |
get a list of bonded element
As there is no internal way of storing the list of bonded element, this list is built on-the-fly and this method returns a copy of this list. Note that this method induces some computational cost.
|
virtual |
get some info on a given element
Reimplemented from GranOO3::Physic::Node.
Reimplemented in GranOO3::DEM::ElementT< shape >, GranOO3::DEM::ElementT< Shape::Sphere >, GranOO3::DEM::ElementT< GranOO3::Shape::Polyhedron >, and GranOO3::DEM::DiscreteElement.
bool GranOO3::DEM::Element::is_bonded | ( | ) | const |
util method to know if the current element is bonded
true
is the the current element isnbonded false
otherwiseAn element is considered as bonded if one bond at least is connected to the current element.
bool GranOO3::DEM::Element::is_bonded | ( | const Bond & | bond | ) | const |
ask if the current element is bonded to bond
[in] | bond | : the bond to check if it is connected to the current element |
bond
one, false otherwiseThis is a useful method for detecting if an element is bonded to a specific Bond.
bool GranOO3::DEM::Element::is_bonded | ( | const Element & | el | ) | const |
ask if the current element is bonded to another one
[in] | el | : the another one element |
el
one, false otherwiseThis is a useful method for detecting if an element is bonded through a Bond to another one.
ask if the current element is bonded to another one
[in] | el | : the another one element |
[out] | commonBond | : a pointer to the common bond (nullptr if it is not bonded) |
el
one, false otherwiseThis is a useful method for detecting if an element is bonded through a Bond to another one. If this is the case, this method retrieve the commonBond
.
similar as is_bonded(const Element& el, Bond*& commonBond), given for convenience
|
pure virtual |
util method for knowing if the element is polyhedral or not
true
if the element is polyhedral, false
otherwiseNote that this method is pure virtual because the Element class does not know its real shape
Implemented in GranOO3::DEM::ElementT< shape >, GranOO3::DEM::ElementT< Shape::Sphere >, GranOO3::DEM::ElementT< GranOO3::Shape::Polyhedron >, GranOO3::DEM::ElementT< shape >, GranOO3::DEM::ElementT< Shape::Sphere >, and GranOO3::DEM::ElementT< GranOO3::Shape::Polyhedron >.
|
pure virtual |
util method for knowing if the element is spherical or not
true
if the element is spherical, false
otherwiseNote that this method is pure virtual because the Element class does not know its real shape
Implemented in GranOO3::DEM::ElementT< shape >, GranOO3::DEM::ElementT< Shape::Sphere >, GranOO3::DEM::ElementT< GranOO3::Shape::Polyhedron >, GranOO3::DEM::ElementT< shape >, GranOO3::DEM::ElementT< Shape::Sphere >, and GranOO3::DEM::ElementT< GranOO3::Shape::Polyhedron >.
bool GranOO3::DEM::Element::is_unbonded | ( | ) | const |
util method to know if the current element is unbonded
true
is the the current element is unbonded false
otherwiseAn element is considered as unbonded if no bond is connected to the current element.
void GranOO3::DEM::Element::make_equal_to | ( | const Element & | el | ) |
for equalizing two elements
[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.
|
inline |
get a list of neighbour element
An element is considered as a neighbour of another one if it is bonded to this element. Note that the neighbour list could potentially be used with contact but this not implemented.
|
inline |
same as Element::neighbour(), provided for convenience
|
inline |
get a list of neighbour element
This method is quite similar to Element::neighbour() The sole difference is that it returns directly a list (SetOfBase) of Element instead of returning a NeighbourManager<Element> object.
|
inline |
same as neighbour_set(), provided for convenience
|
static |
instantiate a new element from an XML input file
[in] | el | : a pointer to the xml element where the element is described |
This method is mainly used for internal usage
|
virtual |
update the current state of the element from an ascii file format *.lgdd
[in] | is | : the stream where the data are read |
Reimplemented from GranOO3::Physic::Body.
Reimplemented in GranOO3::DEM::ElementT< shape >, GranOO3::DEM::ElementT< Shape::Sphere >, GranOO3::DEM::ElementT< GranOO3::Shape::Polyhedron >, and GranOO3::DEM::DiscreteElement.
|
private |
|
pure virtual |
get the related shape classID
As this method is pure virtual, this method returns the "true" class_ID of the shape ("Sphere", "Cone", etc.)
Implemented in GranOO3::DEM::ElementT< shape >, GranOO3::DEM::ElementT< Shape::Sphere >, and GranOO3::DEM::ElementT< GranOO3::Shape::Polyhedron >.
|
virtual |
dump the current state of the element in a ascii file (standard *.lgdd format)
[in] | os | : the stream where the data will be written |
Reimplemented from GranOO3::Physic::Body.
Reimplemented in GranOO3::DEM::DiscreteElement, GranOO3::DEM::ElementT< shape >, GranOO3::DEM::ElementT< Shape::Sphere >, and GranOO3::DEM::ElementT< GranOO3::Shape::Polyhedron >.
|
friend |
|
protected |
the always up-to-date list of bond which are bonded to the current element
|
protected |
the always up-to-date list of bond which are bonded to the current element