Contact time duration

Asked by Chiara Modenese

Hi there,

I want to compute an average contact time duration. I would like some suggestions from you on which is the best way of doing it in Yade. Basically I need to know when a contact forms (T_initial) and when it is erased (T_final). Any hints?

Thank you,
Chiara

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#1

Interaction::iterMadeReal will probably help.
Tracking death of the contact is more difficult. You may have to hack
the collider to make it dump deletion data, or write a relatively
complex python script that compares lists of interactions to see if some
of them disappear...

If you know the current number of contact and their lifetimes with
iterMadeReal, isn't there a logical way to deduce the statistics of
death-times?...

Bruno

Revision history for this message
Chiara Modenese (chiara-modenese) said :
#2

On 18 May 2012, at 14:15, Chareyre wrote:

> Your question #197576 on Yade changed:
> https://answers.launchpad.net/yade/+question/197576
>
> Status: Open => Answered
>
> Chareyre proposed the following answer:
> Interaction::iterMadeReal will probably help.
Right, I think that can help to track the moment at which the interaction is created.

> Tracking death of the contact is more difficult. You may have to hack
> the collider to make it dump deletion data, or write a relatively
> complex python script that compares lists of interactions to see if some
> of them disappear...
Maybe it could be easily done inside the contact law? In fact, it might be hard to do that in python now that I think more about it.

>
> If you know the current number of contact and their lifetimes with
> iterMadeReal, isn't there a logical way to deduce the statistics of
> death-times?...

>
> Bruno
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/yade/+question/197576/+confirm?answer_id=0
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/yade/+question/197576
>
> You received this question notification because you asked the question.

Revision history for this message
Launchpad Janitor (janitor) said :
#3

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Chiara Modenese (chiara-modenese) said :
#4

Hi Bruno,

As for this question, I was thinking to something like

if (uN<0) {
phys->contact_time=(scene->iter-contact->iterMadeReal)*scene->dt; //
contact time duration
scene->interactions->requestErase(contact->getId1(),contact->getId2());
}

I tried but the problem is that at the next iteration the contact gets
deleted and so I am not on time to record the value i.phys.contact_time.

Now, how do I output those numbers directly to an output file from Yade
c++ code? Is there any example in Yade I can look at? It is also a
general question which would be good to know.

Or I could create a list from a template where I keep the information of
initial/final/total contact time for each contact. How to do that in
Yade? Any example in the code?

Thanks for help!
Chiara

On 03/06/12 09:22, Launchpad Janitor wrote:
> Question #197576 on Yade changed:
> https://answers.launchpad.net/yade/+question/197576
>
> Status: Open => Expired
>
> Launchpad Janitor expired the question:
> This question was expired because it remained in the 'Open' state
> without activity for the last 15 days.
>

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#5

>phys->contact_time=(scene->iter-contact->iterMadeReal)*scene->dt;

Be carefull, dt can change if you use a timeStepper, I guess you figured that. So you need to fix dt in this case...

>Now, how do I output those numbers directly to an output file from Yade c++ code?

grep "ofstream" in the source code.

Revision history for this message
Anton Gladky (gladky-anton) said :
#6

Hi Chiara,

please, have a look at this code. Maybe, it will be helpful.
https://github.com/yade/trunk/blob/master/pkg/dem/ForceTorqueRecorder.cpp#L13

Anton

Can you help with this problem?

Provide an answer of your own, or ask Chiara Modenese for more information if necessary.

To post a message you must log in.