![]() |
GranOO
3.0
A robust and versatile workbench to build 3D dynamic simulations based on the Discrete Element Method
|
a class that represents a generic physical interaction between two bodies More...
#include <BodyInteraction.hpp>
Public Member Functions | |
BodyInteraction (Body &b1, Body &b2, bool contact_interaction) | |
constructor More... | |
virtual | ~BodyInteraction () |
destructor More... | |
void | apply_torque () |
apply the current torque value More... | |
void | clear_torque () |
set the torques to zero More... | |
Geom::Vector & | torque_on (const Body &b) |
get the torque value applied on b More... | |
const Geom::Vector & | torque_on (const Body &b) const |
same as BodyInteraction::torque_on More... | |
void | add_label_torque (const std::string &label, const Geom::Vector &t1, const Geom::Vector &t2) |
add a label for the torque More... | |
void | swap (Body &from, Body &to) |
swap one body More... | |
![]() | |
NodeInteraction (Node &de1, Node &de2, bool build_node_interaction) | |
virtual | ~NodeInteraction () |
bool | contact_interaction () const |
void | apply_force () |
void | clear_force () |
Geom::Vector & | force_on (const Node &) |
const Geom::Vector & | force_on (const Node &) const |
void | swap (Node &from, Node &to) |
virtual std::ostream & | write_ascii (std::ostream &out) const |
void | add_label_force (const std::string &label, const Geom::Vector &f1, const Geom::Vector &f2) |
![]() | |
virtual | ~Base () |
virtual std::string | info () const |
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 () |
virtual std::istream & | read_ascii (std::istream &in) |
virtual std::ostream & | export_to_povray (std::ostream &out) const |
Signal< Base & > & | deleted_signal () |
![]() | |
Null () | |
virtual | ~Null () |
![]() | |
Drawable () | |
virtual | ~Drawable () |
virtual void | draw () |
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 |
![]() | |
Register () | |
virtual | ~Register () |
void | erase_from_all_setof () |
bool | belong_to_setof (const std::string &setOfId) const |
bool | belong_to_setof (const SetOf< NodeInteraction > &set) const |
std::list< SetOf< NodeInteraction > * > & | get_setof_list () |
unsigned long long int | get_numeric_ID () const |
![]() | |
Register () | |
virtual | ~Register () |
void | erase_from_all_setof () |
bool | belong_to_setof (const std::string &setOfId) const |
bool | belong_to_setof (const SetOf< BodyInteraction > &set) const |
std::list< SetOf< BodyInteraction > * > & | get_setof_list () |
unsigned long long int | get_numeric_ID () const |
Protected Attributes | |
Body * | _body1 |
a pointer the first body More... | |
Body * | _body2 |
a pointer the second body More... | |
Geom::Vector | _torque_on1 |
the current value of the applied torque on the body 1 More... | |
Geom::Vector | _torque_on2 |
the current value of the applied torque on the body 2 More... | |
![]() | |
const bool | _contact_interaction |
Node * | _node1 |
Node * | _node2 |
Geom::Vector | _force_on1 |
Geom::Vector | _force_on2 |
Private Member Functions | |
BodyInteraction ()=delete | |
BodyInteraction (const BodyInteraction &frame)=delete | |
BodyInteraction & | operator= (const BodyInteraction &)=delete |
template<class Archive > | |
void | serialize (Archive &, const unsigned int) |
complete serializing of the item in the *.gdd format More... | |
Private Attributes | |
std::map< std::string, Geom::Vector > | _energy_balance_torque1 |
a map of label for computing energy balance (internal usage only) More... | |
std::map< std::string, Geom::Vector > | _energy_balance_torque2 |
a map of label for computing energy balance (internal usage only) More... | |
Friends | |
class | boost::serialization::access |
Additional Inherited Members | |
![]() | |
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 () |
![]() | |
static Null | null = Null() |
![]() | |
Base () | |
![]() | |
static unsigned int | affect_class_rank_ID () |
a class that represents a generic physical interaction between two bodies
A Physic::BodyInteraction simply represents a physicial interaction between two bodies. This interaction is generic and the real type of the interaction is unknown at this class level.
GranOO3::Physic::BodyInteraction::BodyInteraction | ( | Body & | b1, |
Body & | b2, | ||
bool | contact_interaction | ||
) |
constructor
[in] | b1 | : the first body |
[in] | b2 | : the second body |
[in] | contact_interaction | : a flag to say that the interaction comes from a contact |
Construct a new Physic::BodyInteraction with the given parameters. Note that the constructor send a message to its two bodies for registering the interaction.
|
virtual |
destructor
Destroying the interaction. Note that the destructor send a message to its two bodies for unregistering the interaction.
|
privatedelete |
|
privatedelete |
void GranOO3::Physic::BodyInteraction::add_label_torque | ( | const std::string & | label, |
const Geom::Vector & | t1, | ||
const Geom::Vector & | t2 | ||
) |
add a label for the torque
[in] | label | : the label string ID |
[in] | t1 | : the torque applied on the body 1 |
[in] | t2 | : the torque applied on the body 2 |
Not documented. This method is used for energy balance computation. It is for internal usage only.
void GranOO3::Physic::BodyInteraction::apply_torque | ( | ) |
apply the current torque value
This method apply the current value (_torque_on1 and _torque_on2) of the torque to the two bodies in interaction.
void GranOO3::Physic::BodyInteraction::clear_torque | ( | ) |
set the torques to zero
This method simply set the torques (_torque_on1 and _torque_on2) to zero.
|
privatedelete |
|
private |
complete serializing of the item in the *.gdd format
swap one body
This method is able to swap (change) one body. It could be used when one of the interacted body changes. Note that this method is experimental.
Geom::Vector & GranOO3::Physic::BodyInteraction::torque_on | ( | const Body & | b | ) |
get the torque value applied on b
This method simply returns the (_torque_on1 and _torque_on2) depending on the parameter b
. Note that if b
does not corresponding to one of the 2 registered bodies (_body1 or _body2), an assertion is raised.
const Geom::Vector & GranOO3::Physic::BodyInteraction::torque_on | ( | const Body & | b | ) | const |
same as BodyInteraction::torque_on
|
friend |
|
protected |
a pointer the first body
|
protected |
a pointer the second body
|
private |
a map of label for computing energy balance (internal usage only)
|
private |
a map of label for computing energy balance (internal usage only)
|
protected |
the current value of the applied torque on the body 1
|
protected |
the current value of the applied torque on the body 2