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 | Private Attributes | Friends | List of all members
GranOO3::DEM::Spring Class Reference

a bond spring More...

#include <Spring.hpp>

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

Public Member Functions

 Spring (Element &el1, Element &el2)
 constructor More...
 
 Spring (Element &el1, Element &el2, double stiffness, double damping, double max_relative_elongation=0)
 constructor More...
 
 Spring (Element &el1, Element &el2, double stiffness, double damping, double attrac_coef, double rep_coeff, double max_relative_elongation=0)
 constructor More...
 
virtual ~Spring ()
 destructor More...
 
void init ()
 initialize the spring (it does nothing) More...
 
virtual void update ()
 update the current values of elongation, local frame, etc... More...
 
void process ()
 update the current value of reaction force More...
 
virtual void compute_load ()
 trigger the computation of the reaction force and torque of the spring More...
 
virtual double get_linear_stiffness () const
 compute the linear stiffness of the bond More...
 
virtual double get_angular_stiffness () const
 always return 0 in case of spring More...
 
virtual double compute_critical_time_step () const
 compute the critical time of the bond More...
 
virtual std::string info () const
 Display some useful info in the terminal
More...
 
double get_restitution_coeff () const
 get the current value of the restitution coefficient More...
 
void set_restitution_coeff (double val)
 set the current value of the restitution coefficient More...
 
- Public Member Functions inherited from GranOO3::DEM::Bond
 Bond (Element &el1, Element &el2, bool contact=false)
 Constructor. More...
 
virtual ~Bond ()=0
 Destructor. More...
 
virtual void draw ()
 OpenGL draw of the bond
More...
 
Elementget_item1 ()
 
const Elementget_item1 () const
 
Elementget_item2 ()
 
const Elementget_item2 () const
 
Elementitem1 ()
 
Elementitem2 ()
 
double get_normal_force_intensity () const
 
double get_tangential_force_intensity () const
 
Elementbonded_element (const Element &)
 get the bonded element More...
 
const Elementget_bonded_element (const Element &) const
 same as bonded_element(const Element&) (provided for convenience) More...
 
void apply_linear_damping_factor ()
 compute and apply the linear (translation) damping factor of the bond More...
 
void apply_angular_damping_factor ()
 similar as apply_linear_damping_factor() for rotation More...
 
void apply_load ()
 apply the computed reaction force and torque to the bonded Element (_element1 and _element2) More...
 
void disable (bool manage_slave=true)
 disable the bond More...
 
void disable_fast_mode (bool manage_slave=true)
 simply disable the bond by switching the _disabled attribute to true without doing the lot of things done by the disable() method More...
 
void enable (bool manage_slave=true)
 simply enable the bond by switching the _disabled attribute to false More...
 
bool is_disabled () const
 check if the bond is enable or not More...
 
void crack (bool manage_slave=true)
 
void uncrack (bool manage_slave=true)
 
bool is_cracked () const
 
void init_local_frame (bool update_initial_param=false)
 initialize the bond local frame More...
 
void update_local_frame ()
 update the bond local frame More...
 
void update_current_length ()
 update the current value of the bond length (see _current_length attribute) More...
 
void build_voronoi_bond ()
 build a voronoi bond from the current bond More...
 
virtual void stiffness_matrix (Eigen::MatrixXd &kMatrix)
 assemble a stiffness matrix More...
 
virtual void update_dof ()
 update the bond dof More...
 
const std::vector< unsigned int > & get_dof () const
 get the dof vector More...
 
const Geom::Pointinitial_pos (const Element &) const
 get the initial position of the el element More...
 
Geom::Vector get_disp (const Element &) const
 get the displacement of the el element More...
 
Geom::Vector get_disp1 () const
 get the displacement of the first bonded element (_element1) More...
 
Geom::Vector get_disp2 () const
 similar as get_disp1() More...
 
void swap (Element &from, Element &to)
 swap the bond from the Element from to to More...
 
void add_slave (Bond &b)
 add a slave bond (useful for periodic simulation) More...
 
virtual std::ostream & export_to_povray (std::ostream &out) const
 exporting to povray format More...
 
- Public Member Functions inherited from GranOO3::Physic::BodyInteraction
 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 ()
 
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)
 
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_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
 
- Public Member Functions inherited from GranOO3::Core::PropClass< Bond >
 PropClass ()
 
virtual ~PropClass ()
 
T & new_object ()
 
T & get ()
 
const T & get () const
 
bool prop_exist () const
 
void add_prop (Core::Prop< Bond > *)
 
void remove_prop (Core::Prop< Bond > *)
 
std::string info () const
 
- Public Member Functions inherited from GranOO3::Core::Register< Bond >
 Register ()
 
virtual ~Register ()
 
void erase_from_all_setof ()
 
bool belong_to_setof (const std::string &setOfId) const
 
bool belong_to_setof (const SetOf< Bond > &set) const
 
std::list< SetOf< Bond > * > & get_setof_list ()
 
unsigned long long int get_numeric_ID () const
 
- Public Member Functions inherited from GranOO3::Core::Register< Spring >
 Register ()
 
virtual ~Register ()
 
void erase_from_all_setof ()
 
bool belong_to_setof (const std::string &setOfId) const
 
bool belong_to_setof (const SetOf< Spring > &set) const
 
std::list< SetOf< Spring > * > & get_setof_list ()
 
unsigned long long int get_numeric_ID () const
 

Private Member Functions

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

Private Attributes

double _stiffness
 the stiffness of the spring in [N/m] More...
 
double _attractive_coeff
 the attractive coefficient which is used as a multiplication factor on the reaction force when the elongation is positive More...
 
double _repulsive_coeff
 the repulsive coefficient which is used as a multiplication factor on the reaction force when the elongation is positive More...
 
Geom::Vector _direction
 the current direction of the spring (for internal usage) More...
 
double _elongation_energy
 the current elongation energy of the spring More...
 
Geom::Vector _F1
 the current force acting on the element1 for energy computation (internal usage) More...
 
Geom::Vector _F2
 the current force acting on the element2 for energy computation (internal usage) More...
 
Geom::Vector _d1
 the current relative displacement of the element1 for energy computation (internal usage) More...
 
Geom::Vector _d2
 the current relative displacement of the element2 for energy computation (internal usage) More...
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Public Types inherited from GranOO3::DEM::Bond
enum  FailureMode { NONE =0 , TENSION =1 , COMPRESSION =2 , SHEAR =3 }
 
enum  DrawMode { SOLID , LINE , NO }
 
- Static Public Member Functions inherited from GranOO3::DEM::Bond
static double get_disabled_cumulative_surface ()
 get the total surface disabled surface 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::Physic::CriticalTimeStep
static const std::set< CriticalTimeStep * > & get_all ()
 
- Static Public Attributes inherited from GranOO3::DEM::Bond
static double epsilon
 a very small value used as a threshold More...
 
static double draw_solid_factor
 
static DrawMode draw_mode = LINE
 
static Core::Signal< Bond & > disable_signal = Core::Signal<Bond&>()
 get the signal when a bond is disabled More...
 
- Static Public Attributes inherited from GranOO3::Core::Null
static Null null = Null()
 
- Protected Member Functions inherited from GranOO3::DEM::Bond
template<class Archive >
void save (Archive &, const unsigned int) const
 
template<class Archive >
void load (Archive &, const unsigned int)
 
 BOOST_SERIALIZATION_SPLIT_MEMBER ()
 
- Protected Member Functions inherited from GranOO3::Core::Base
 Base ()
 
- Protected Member Functions inherited from GranOO3::Physic::CriticalTimeStep
 CriticalTimeStep ()
 constructor More...
 
virtual ~CriticalTimeStep ()
 destructor More...
 
- Static Protected Member Functions inherited from GranOO3::Core::Base
static unsigned int affect_class_rank_ID ()
 
- Protected Attributes inherited from GranOO3::DEM::Bond
Element_element1
 the first of the two bonded Element More...
 
Element_element2
 the second of the two bonded Element More...
 
double _linear_damping_factor
 the linear damping factor of the bond More...
 
double _angular_damping_factor
 the angular damping factor of the bond More...
 
double _relaxed_length
 the relaxed length of the bond. More...
 
double _current_length
 the current length of the bond that correspond to the norm of the vector between the center of the bonded elements More...
 
double _max_relative_elongation
 a threshold corresponding to a maximal admissible relative elongation (the longitudinal strain) More...
 
double _surface
 this attribute stores the corresponding normal surface of the bond More...
 
Core::SetOfBase< Bond_slave
 a container that list the slave bond More...
 
std::vector< unsigned int > _dofs
 a vector that stores the dof of the bond More...
 
- Protected Attributes inherited from GranOO3::Physic::BodyInteraction
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
 
- Protected Attributes inherited from GranOO3::Core::PropClass< Bond >
std::vector< Core::Prop< Bond > * > _prop
 

Detailed Description

a bond spring

This bond is only able to work in tension/compression with normal force. This force can include a stiffness, a damping, an attractive and repulsive parts. Note that this interaction does not transmit any torque.

Constructor & Destructor Documentation

◆ Spring() [1/5]

GranOO3::DEM::Spring::Spring ( Element el1,
Element el2 
)

constructor

Parameters
[in]el1: first bonded element
[in]el2: second bonded element

Build a new Spring. Mechanical attributes are set to zero.

◆ Spring() [2/5]

GranOO3::DEM::Spring::Spring ( Element el1,
Element el2,
double  stiffness,
double  damping,
double  max_relative_elongation = 0 
)

constructor

Parameters
[in]el1: first bonded element
[in]el2: second bonded element
[in]stiffness: stiffness of the bond in [N/m]
[in]damping: the damping factor (in the [0,1] range) which is expressed as the ratio of the critical damping
[in]max_relative_elongation: the maximal deformation treshold expressed in terms of longitudinal strain

Build a new Spring with the required attribute values.

◆ Spring() [3/5]

GranOO3::DEM::Spring::Spring ( Element el1,
Element el2,
double  stiffness,
double  damping,
double  attrac_coef,
double  rep_coeff,
double  max_relative_elongation = 0 
)

constructor

Parameters
[in]el1: first bonded element
[in]el2: second bonded element
[in]stiffness: stiffness of the bond in [N/m]
[in]damping: the damping factor (in the [0,1] range) which is expressed as the ratio of the critical damping
[in]attrac_coef: the attractive coefficient which is used as a multiplication factor to the reaction force when the elongation is positive
[in]rep_coeff: the repulsive coefficient which is used as a multiplication factor to the reaction force when the elongation is negative
[in]max_relative_elongation: the maximal deformation treshold expressed in terms of longitudinal strain

Build a new Spring with the required attribute values.

◆ ~Spring()

GranOO3::DEM::Spring::~Spring ( )
virtual

destructor

◆ Spring() [4/5]

GranOO3::DEM::Spring::Spring ( )
privatedelete

◆ Spring() [5/5]

GranOO3::DEM::Spring::Spring ( const Spring )
privatedelete

Member Function Documentation

◆ compute_critical_time_step()

double GranOO3::DEM::Spring::compute_critical_time_step ( ) const
virtual

compute the critical time of the bond

Returns
the maximal time step

Note that this method computes on-the-fly the critical time step.

Implements GranOO3::Physic::CriticalTimeStep.

◆ compute_load()

void GranOO3::DEM::Spring::compute_load ( )
virtual

trigger the computation of the reaction force and torque of the spring

Reimplemented from GranOO3::DEM::Bond.

Reimplemented in GranOO3::DEM::RepulsiveSpring, and GranOO3::DEM::AttractiveSpring.

◆ get_angular_stiffness()

double GranOO3::DEM::Spring::get_angular_stiffness ( ) const
virtual

always return 0 in case of spring

Reimplemented from GranOO3::DEM::Bond.

◆ get_linear_stiffness()

double GranOO3::DEM::Spring::get_linear_stiffness ( ) const
virtual

compute the linear stiffness of the bond

Returns
the linear stiffness

Reimplemented from GranOO3::DEM::Bond.

◆ get_restitution_coeff()

double GranOO3::DEM::Spring::get_restitution_coeff ( ) const

get the current value of the restitution coefficient

Returns
the restitution coefficient value

Here, the value of the restitution coeff is automatically computed from the value of the damping factor

◆ info()

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

Display some useful info in the terminal

Reimplemented from GranOO3::DEM::Bond.

Reimplemented in GranOO3::DEM::RepulsiveSpring, and GranOO3::DEM::AttractiveSpring.

◆ init()

void GranOO3::DEM::Spring::init ( )

initialize the spring (it does nothing)

◆ operator=()

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

◆ process()

void GranOO3::DEM::Spring::process ( )

update the current value of reaction force

◆ serialize()

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

complete serializing of the bond in the *.gdd format

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

◆ set_restitution_coeff()

oid GranOO3::DEM::Spring::set_restitution_coeff ( double  val)

set the current value of the restitution coefficient

Parameters
[in]val: the value of the restitution coefficient

Here, the value of the restitution coeff is converted into damping factor for internal storage

◆ update()

void GranOO3::DEM::Spring::update ( )
virtual

update the current values of elongation, local frame, etc...

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Member Data Documentation

◆ _attractive_coeff

double GranOO3::DEM::Spring::_attractive_coeff
private

the attractive coefficient which is used as a multiplication factor on the reaction force when the elongation is positive

◆ _d1

Geom::Vector GranOO3::DEM::Spring::_d1
private

the current relative displacement of the element1 for energy computation (internal usage)

◆ _d2

Geom::Vector GranOO3::DEM::Spring::_d2
private

the current relative displacement of the element2 for energy computation (internal usage)

◆ _direction

Geom::Vector GranOO3::DEM::Spring::_direction
private

the current direction of the spring (for internal usage)

◆ _elongation_energy

double GranOO3::DEM::Spring::_elongation_energy
private

the current elongation energy of the spring

◆ _F1

Geom::Vector GranOO3::DEM::Spring::_F1
private

the current force acting on the element1 for energy computation (internal usage)

◆ _F2

Geom::Vector GranOO3::DEM::Spring::_F2
private

the current force acting on the element2 for energy computation (internal usage)

◆ _repulsive_coeff

double GranOO3::DEM::Spring::_repulsive_coeff
private

the repulsive coefficient which is used as a multiplication factor on the reaction force when the elongation is positive

◆ _stiffness

double GranOO3::DEM::Spring::_stiffness
private

the stiffness of the spring in [N/m]


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