access to the impact velocity

Submitted by gelinhan on
Riccardo Maione

hello gelinhan,

have a look at "tangential_model_history.h", in this file there's the definition of
// shear history effects
if(cdata.touch) *cdata.touch |= TOUCH_TANGENTIAL_MODEL;
double * const shear = &cdata.contact_history[history_offset];

which is the element where all the information from the previous time step are stored, so you can store the "first" velocity there. you just need to define a condition for the first collision step.

Regards,
Riccardo

Wed, 25 Apr 2018 - 10:21 Permalink

Hi developers,

I am implementing a new normal contact model which needs the impact velocity (the velocity just before the collision) as an input parameter. A basic idea is to get the previous and current particle distance , and then extract the velocity just before there is an overlap. Is there any simple method to access the previous particle distance or any easier method to get the impact velocity?

Thank you.
Linhan