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

a class that represents a generic physical interaction between two bodies More...

#include <BodyInteraction.hpp>

Inheritance diagram for GranOO3::Physic::BodyInteraction:
Inheritance graph
[legend]

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::Vectortorque_on (const Body &b)
 get the torque value applied on b More...
 
const Geom::Vectortorque_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...
 
- Public Member Functions inherited from GranOO3::Physic::NodeInteraction
 NodeInteraction (Node &de1, Node &de2, bool build_node_interaction)
 
virtual ~NodeInteraction ()
 
bool contact_interaction () const
 
void apply_force ()
 
void clear_force ()
 
Geom::Vectorforce_on (const Node &)
 
const Geom::Vectorforce_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)
 
- Public Member Functions inherited from GranOO3::Core::Base
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::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::istream & read_ascii (std::istream &in)
 
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 ()
 
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::Register< NodeInteraction >
 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
 
- Public Member Functions inherited from GranOO3::Core::Register< BodyInteraction >
 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...
 
- Protected Attributes inherited from GranOO3::Physic::NodeInteraction
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
 
BodyInteractionoperator= (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 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 ()
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ BodyInteraction() [1/3]

GranOO3::Physic::BodyInteraction::BodyInteraction ( Body b1,
Body b2,
bool  contact_interaction 
)

constructor

Parameters
[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.

◆ ~BodyInteraction()

GranOO3::Physic::BodyInteraction::~BodyInteraction ( )
virtual

destructor

Destroying the interaction. Note that the destructor send a message to its two bodies for unregistering the interaction.

◆ BodyInteraction() [2/3]

GranOO3::Physic::BodyInteraction::BodyInteraction ( )
privatedelete

◆ BodyInteraction() [3/3]

GranOO3::Physic::BodyInteraction::BodyInteraction ( const BodyInteraction frame)
privatedelete

Member Function Documentation

◆ add_label_torque()

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

Parameters
[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.

◆ apply_torque()

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.

◆ clear_torque()

void GranOO3::Physic::BodyInteraction::clear_torque ( )

set the torques to zero

This method simply set the torques (_torque_on1 and _torque_on2) to zero.

◆ operator=()

BodyInteraction& GranOO3::Physic::BodyInteraction::operator= ( const BodyInteraction )
privatedelete

◆ serialize()

template<class Archive >
void GranOO3::Physic::BodyInteraction::serialize ( Archive &  ar,
const unsigned int   
)
private

complete serializing of the item in the *.gdd format

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

◆ swap()

void GranOO3::Physic::BodyInteraction::swap ( Body from,
Body to 
)

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.

◆ torque_on() [1/2]

Geom::Vector & GranOO3::Physic::BodyInteraction::torque_on ( const Body b)

get the torque value applied on b

Parameters
[in]theconcerned body (must be _body1 or _body2)

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.

◆ torque_on() [2/2]

const Geom::Vector & GranOO3::Physic::BodyInteraction::torque_on ( const Body b) const

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Member Data Documentation

◆ _body1

Body * GranOO3::Physic::BodyInteraction::_body1
protected

a pointer the first body

◆ _body2

Body * GranOO3::Physic::BodyInteraction::_body2
protected

a pointer the second body

◆ _energy_balance_torque1

std::map< std::string, Geom::Vector > GranOO3::Physic::BodyInteraction::_energy_balance_torque1
private

a map of label for computing energy balance (internal usage only)

◆ _energy_balance_torque2

std::map< std::string, Geom::Vector > GranOO3::Physic::BodyInteraction::_energy_balance_torque2
private

a map of label for computing energy balance (internal usage only)

◆ _torque_on1

Geom::Vector GranOO3::Physic::BodyInteraction::_torque_on1
protected

the current value of the applied torque on the body 1

◆ _torque_on2

Geom::Vector GranOO3::Physic::BodyInteraction::_torque_on2
protected

the current value of the applied torque on the body 2


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