![]() |
GranOO
3.0
A robust and versatile workbench to build 3D dynamic simulations based on the Discrete Element Method
|
the base class for all bonds between discrete elements. More...
#include <Bond.hpp>
Public Types | |
enum | FailureMode { NONE =0 , TENSION =1 , COMPRESSION =2 , SHEAR =3 } |
enum | DrawMode { SOLID , LINE , NO } |
Public Member Functions | |
Bond (Element &el1, Element &el2, bool contact=false) | |
Constructor. More... | |
virtual | ~Bond ()=0 |
Destructor. More... | |
virtual void | draw () |
OpenGL draw of the bond More... | |
virtual std::string | info () const |
Display some useful info in the terminal More... | |
Element & | get_item1 () |
const Element & | get_item1 () const |
Element & | get_item2 () |
const Element & | get_item2 () const |
Element & | item1 () |
Element & | item2 () |
double | get_normal_force_intensity () const |
double | get_tangential_force_intensity () const |
Element & | bonded_element (const Element &) |
get the bonded element More... | |
const Element & | get_bonded_element (const Element &) const |
same as bonded_element(const Element&) (provided for convenience) More... | |
virtual void | compute_load () |
compute the reaction force and torque of the bond More... | |
virtual double | get_linear_stiffness () const |
compute the linear stiffness of the bond More... | |
virtual double | get_angular_stiffness () const |
similar as get_linear_stiffness() for rotation 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::Point & | initial_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... | |
![]() | |
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 () |
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) |
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 |
![]() | |
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 |
![]() | |
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 |
![]() | |
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 |
Static Public Member Functions | |
static double | get_disabled_cumulative_surface () |
get the total surface disabled surface 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 () |
Static Public Attributes | |
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 Null | null = Null() |
Protected Member Functions | |
template<class Archive > | |
void | save (Archive &, const unsigned int) const |
template<class Archive > | |
void | load (Archive &, const unsigned int) |
BOOST_SERIALIZATION_SPLIT_MEMBER () | |
![]() | |
Base () | |
Protected Attributes | |
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... | |
![]() | |
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 |
![]() | |
std::vector< Core::Prop< Bond > * > | _prop |
Private Member Functions | |
Bond ()=delete | |
Bond (const Bond &)=delete | |
Bond & | operator= (const Bond &)=delete |
Private Attributes | |
bool | _disabled |
an attribute that stores the enable/disable state More... | |
bool | _cracked |
FailureMode | _failure_mode |
double | _initial_length |
an attribute that stores the bond initial length More... | |
Geom::Point | _initial_pos1 |
the initial position of the _element1 expressed in the _element2 local frame More... | |
Geom::Point | _initial_pos2 |
the initial position of the _element2 expressed in the _element1 local frame More... | |
Geom::Quaternion | _quat_element1 |
the quaternion used for building the bond local frame (expressed in the _element1 local frame) More... | |
Geom::Quaternion | _quat_element2 |
same as the _quat_element1 but expressed in the _element2 local frame) More... | |
Geom::Quaternion | _local_quat |
this the quaternion that must be updated for updating the _local_frame More... | |
Geom::Frame | _local_frame |
the bond local frame, useful for making computation More... | |
Geom::Point | _local_center_element1 |
the center of _element1 expressed in the local frame. It is always equal to (0,0,0) More... | |
Geom::Frame | _local_frame_element1 |
this the frame that corresponds to the local _element1 frame expressed in the _local_frame More... | |
Geom::Point | _local_center_element2 |
Geom::Frame | _local_frame_element2 |
Static Private Attributes | |
static double | _disabled_cumulative_surface = 0. |
the attribute where the total disabled surface is stored More... | |
Friends | |
class | boost::serialization::access |
Additional Inherited Members | |
![]() | |
static unsigned int | affect_class_rank_ID () |
the base class for all bonds between discrete elements.
Bonds are a kind of interaction between discrete elements. The difference between a contact and a bond is :
During a DEM simulation contacts are destroyed and recreated many times, whereas a bond is created and deleted only one time.
The class DiscreteElement have a list of connected bond. The Bond constructor and destructor are implemented to update this list. So this list is automatically up to date.
Note that this class is not virtual. In some cases, it could be useful to instantiate a bond that does nothing. But be careful, if you call some methods like ComputeLoad() or GetCriticalTimeStep() methods, it will raise an assertion !
A bond can be disabled. It could be useful if you don't want to delete bonds during a simulation. You can get a specific SetOf, that contains all the disabled bonds, with the static method GetDisabledBonds().
Constructor.
[in] | el1 | : a reference to the first bonded element |
[in] | el2 | : a reference to the second bonded element |
[in] | contact | : use true if the bond comes from a contact (see Collision lib) |
This constructor send a message to both elements to trigger the update of their bond lists.
|
pure virtual |
Destructor.
This destructor send a message to both elements to trigger the update of their bond lists.
|
privatedelete |
|
privatedelete |
void GranOO3::DEM::Bond::add_slave | ( | Bond & | b | ) |
void GranOO3::DEM::Bond::apply_angular_damping_factor | ( | ) |
similar as apply_linear_damping_factor() for rotation
void GranOO3::DEM::Bond::apply_linear_damping_factor | ( | ) |
compute and apply the linear (translation) damping factor of the bond
Note that this method is automatically triggered by the apply_load() method (if the _linear_damping_factor value is different from zero).
void GranOO3::DEM::Bond::apply_load | ( | ) |
apply the computed reaction force and torque to the bonded Element (_element1 and _element2)
Note that the reaction force must be updated with the virtual compute_load() method.
This method do not apply the loading if the bond is disabled (see _disabled attribute).
get the bonded element
[in] | el | : a reference to one of the two bonded element |
el
element does not belong to the bond, this method raises an assertion
|
protected |
void GranOO3::DEM::Bond::build_voronoi_bond | ( | ) |
build a voronoi bond from the current bond
This method build a new VoronoiBond property from the current bond.
|
virtual |
compute the reaction force and torque of the bond
This method must be overridden by child classes. Note that this method checks if the _max_relative_elongation criterion is reached. This check is only done if the bond is active (see _disabled attribute).
This method do not apply the reaction force and torque to the bonded element. It is done by the apply_load() method.
Reimplemented in GranOO3::DEM::XBeam, GranOO3::DEM::Spring, GranOO3::DEM::SinterNeck_Viscous, GranOO3::DEM::SinterNeck_Rojek, GranOO3::DEM::SinterNeck_Martin, GranOO3::DEM::RepulsiveSpring, GranOO3::DEM::PlasticBeamIT, GranOO3::DEM::PlasticBeam, GranOO3::DEM::HertzSpring, GranOO3::DEM::FlatBond_Ortho, GranOO3::DEM::FlatBond, GranOO3::DEM::ContactBond, GranOO3::DEM::Beam, and GranOO3::DEM::AttractiveSpring.
void GranOO3::DEM::Bond::crack | ( | bool | manage_slave = true | ) |
void GranOO3::DEM::Bond::disable | ( | bool | manage_slave = true | ) |
disable the bond
if a bond is disabled, its reaction force and torque are not applied to the bonded element (see the apply_load() method). Note that this method does the following things :
void GranOO3::DEM::Bond::disable_fast_mode | ( | bool | manage_slave = true | ) |
|
virtual |
OpenGL draw of the bond
This method is used for fdrwaing the bond. It is used by the granoo-viewer vizualization tool
Reimplemented from GranOO3::Core::Drawable.
Reimplemented in GranOO3::DEM::XBeam, GranOO3::DEM::SinterNeck, GranOO3::DEM::PlasticBeamIT, GranOO3::DEM::PlasticBeam, GranOO3::DEM::FlatBond, and GranOO3::DEM::Beam.
void GranOO3::DEM::Bond::enable | ( | bool | manage_slave = true | ) |
simply enable the bond by switching the _disabled attribute to false
Note that if you want to enable/disable a bond, it is preferable to use the disable_fast_mode() method instead of the disable() method.
|
virtual |
exporting to povray format
[in] | os | : the stream to write |
This method is used in the granoo-viewer
for exporting a 3D scene to the povray program
Reimplemented from GranOO3::Core::Base.
|
virtual |
similar as get_linear_stiffness() for rotation
Reimplemented in GranOO3::DEM::Spring, GranOO3::DEM::SinterNeck, GranOO3::DEM::HertzSpring, GranOO3::DEM::FlatBond_Ortho, GranOO3::DEM::FlatBond, and GranOO3::DEM::Beam.
same as bonded_element(const Element&) (provided for convenience)
|
static |
get the total surface disabled surface
This static method simply returns the _disabled_cumulative_surface attribute which corresponds to the total surface of the disabled bonds. This feature could be useful to monitor the total crack surface in case of a lattice computation. To get more information, you can see alse the disable() method.
Geom::Vector GranOO3::DEM::Bond::get_disp | ( | const Element & | el | ) | const |
get the displacement of the el
element
[in] | el | : the Element which the displacement is needed |
el
Note that the returned displacement is expressed in the other element local frame. The behavior of this method is quite similar to the initial_pos(const Element& ) const method.
Geom::Vector GranOO3::DEM::Bond::get_disp1 | ( | ) | const |
get the displacement of the first bonded element (_element1)
Note that the returned displacement is expressed in the other element local frame (see the get_disp(const Element& ) const method)
Geom::Vector GranOO3::DEM::Bond::get_disp2 | ( | ) | const |
similar as get_disp1()
|
inline |
get the dof vector
This method is useful for lattice FEM computation (see stiffness_matrix(Eigen::MatrixXd &kMatrix)
|
inline |
|
inline |
|
inline |
|
inline |
|
virtual |
compute the linear stiffness of the bond
This method must be overridden by child classes. Note that this method returns 0 if it is not overridden. This method is mainly used for find the most rigid bond in order to compute the optimal time step of a simulation.
Reimplemented in GranOO3::DEM::Spring, GranOO3::DEM::SinterNeck, GranOO3::DEM::HertzSpring, GranOO3::DEM::FlatBond_Ortho, GranOO3::DEM::FlatBond, and GranOO3::DEM::Beam.
double GranOO3::DEM::Bond::get_normal_force_intensity | ( | ) | const |
double GranOO3::DEM::Bond::get_tangential_force_intensity | ( | ) | const |
|
virtual |
Display some useful info in the terminal
Reimplemented from GranOO3::Core::Base.
Reimplemented in GranOO3::DEM::XBeam, GranOO3::DEM::Spring, GranOO3::DEM::SinterNeck_Viscous, GranOO3::DEM::SinterNeck_Rojek, GranOO3::DEM::SinterNeck_Martin, GranOO3::DEM::SinterNeck, GranOO3::DEM::RepulsiveSpring, GranOO3::DEM::PlasticBeamIT, GranOO3::DEM::PlasticBeam, GranOO3::DEM::HertzSpring, GranOO3::DEM::FlatBond_Ortho, GranOO3::DEM::FlatBond, GranOO3::DEM::ContactBond, GranOO3::DEM::Beam, and GranOO3::DEM::AttractiveSpring.
void GranOO3::DEM::Bond::init_local_frame | ( | bool | update_initial_param = false | ) |
initialize the bond local frame
A local frame (see _local_frame attribute) can be used for complex bond model where a complete local frame is needed for managing rotation, tangential elongation and so on..
Because managing local frame has a non-negligible computational cost, this is not automatically triggered. If you want to use local frame in a custom bond (that derives from this Bond class), you must trigger this method at the initialization step of your bond. If you don't need local frame, you can do nothing.
Note that, if you need a local frame, you must update the local frame position and orientation with update_local_frame() method just before the computation of your reaction force and torque.
const Geom::Point & GranOO3::DEM::Bond::initial_pos | ( | const Element & | el | ) | const |
get the initial position of the el
element
[in] | el | : the Element which the initial position is needed |
el
This method returns the _initial_pos1 or the _initial_pos2 attributes depending from the el
which is passed as argument to this function. If the el
does not correspond to one of the bonded element, this method triggers an assertion.
Note that the returned Geom::Point object is expressed in the other element local frame. It means that the _initial_pos1 is expressed in the _element2 local frame and the _initial_pos2 is expressed in the _element1 local frame.
|
inline |
|
inline |
check if the bond is enable or not
|
inline |
|
inline |
|
protected |
|
protected |
|
inlinevirtual |
assemble a stiffness matrix
This method is useful for lattice FEM computation where a global stiffness matrix must be built. FEM computation is an experimental feature only available with the XBeam bond class.
Reimplemented in GranOO3::DEM::XBeam.
void GranOO3::DEM::Bond::uncrack | ( | bool | manage_slave = true | ) |
void GranOO3::DEM::Bond::update_current_length | ( | ) |
update the current value of the bond length (see _current_length attribute)
|
inlinevirtual |
update the bond dof
This method is useful for lattice FEM computation (see stiffness_matrix(Eigen::MatrixXd &kMatrix)
Reimplemented in GranOO3::DEM::XBeam.
void GranOO3::DEM::Bond::update_local_frame | ( | ) |
update the bond local frame
if you use a local frame (see init_local_frame()), you must update this frame at each computation. To do such thing, you can override the compute_load() method for triggering this update just before the computation of your reaction force and torque.
|
friend |
|
protected |
the angular damping factor of the bond
|
private |
|
protected |
the current length of the bond that correspond to the norm of the vector between the center of the bonded elements
Note that this attribute can be updated with update_current_length() method
|
private |
an attribute that stores the enable/disable state
|
staticprivate |
the attribute where the total disabled surface is stored
|
protected |
a vector that stores the dof of the bond
This is only used within lattice-FEM computations
|
private |
|
private |
an attribute that stores the bond initial length
|
private |
|
private |
|
protected |
the linear damping factor of the bond
|
private |
the center of _element1 expressed in the local frame. It is always equal to (0,0,0)
|
private |
|
private |
the bond local frame, useful for making computation
|
private |
this the frame that corresponds to the local _element1 frame expressed in the _local_frame
|
private |
|
private |
this the quaternion that must be updated for updating the _local_frame
|
protected |
a threshold corresponding to a maximal admissible relative elongation (the longitudinal strain)
If the bond reach this value, it is automatically disabled (see compute_load() method)
|
private |
the quaternion used for building the bond local frame (expressed in the _element1 local frame)
|
private |
same as the _quat_element1 but expressed in the _element2 local frame)
|
protected |
the relaxed length of the bond.
The relaxed length is the length value where there reaction force are equal to zero. This is often equal to the initial length. However, it could be differ if you want to implement special deformation that induces a shift into the reaction force such as thermal expansion or plastic strain.
|
protected |
a container that list the slave bond
Slave bond are used in case of periodic simulation. In case of a periodic simulation, you can use the INIT-PERIODIC-BOND plugin to initialize the slave bond. Slave bonds are used at the boundary while a given bond on the frontier has a dual bond on the other frontier. In such a case, it is important to list all these dual bonds within the _slave container. It is mainly used when breaking a bond for breaking all the corresponding the bond slaves.
|
protected |
this attribute stores the corresponding normal surface of the bond
This value is zero by default. However, in some cases, t could be practical to associate a surface to a bond for computing thermal conduction or crack surface. It have only a real physical sense in the case of VoronoiBond. In other case, some approximation could be done using IT methods (with platonic solids).
|
static |
get the signal when a bond is disabled
|
static |
|
static |
|
static |
a very small value used as a threshold
This threshold is used in the init_local_frame() for computing the local frame. This is quite complicated to explain, please take a look into the code, if you really want to know the usage of this variable.