Specific data extraction for post-processing purposes

Asked by Dominik Boemer

Hi everyone!

I have a three part question about data extraction for post-processing purposes:

1. Until now, I have always extracted data with the VTKRecorder. Is there another way to do it using the following format:
- one file for each time step
- each line of the file starts with the identifier of the selected body
- the identifier is followed by selected properties of the body (like the y position of the sphere's center)

I suppose that it is necessary to write either a python script (called by the PyRunner) or a C++ equivalent of the VTKRecorder to do this job?

2. Moreover, I want to know the impact velocity of a sphere on a facet. How could I determine this velocity? Let's say that the relative velocity is known for a given interaction; this issue will be adressed in my last question. It would then be necessary to determine if a new interaction is created or not. Is there a way to extract an interaction list, i.e. a list of which each element contains two IDs, the IDs of the objects in contact, at each time step? If a new element is added to the list, I would then be able to detect a new contact. Or is there another way of doing so?

3. Usually I use the visco-elastic law (ViscElPhys) implemented in ViscoelasticPM.cpp. This law calculates internally the relative velocity between the bodies in contact (mentioned earlier) as well as the different components of the interaction force (normal/tangential elastic/viscous components). I would like to extract this data during a simulation. How could this be done? Has this specific data extraction already been done for other contact laws?

Thank you in advance,
Dominik

Question information

Language:
English Edit question
Status:
Expired
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jan Stránský (honzik) said :
#1

Hi Dominik,

> 1. Until now, I have always extracted data with the VTKRecorder. Is there
> another way to do it using the following format:
> - one file for each time step
> - each line of the file starts with the identifier of the selected body
> - the identifier is followed by selected properties of the body (like the
> y position of the sphere's center)

> I suppose that it is necessary to write either a python script (called by
> the PyRunner) or a C++ equivalent of the VTKRecorder to do this job?
>

IMO using PyRunner is the easiest way, You can either use some preexisting
export functions (e.g. [1], not exactly compatible with your requirements,
e.g. line does not start with id), or you can define your own export
function to be called (if you don't know how to proceed, we can help you)

>
> 2. Moreover, I want to know the impact velocity of a sphere on a facet.
> How could I determine this velocity? Let's say that the relative velocity
> is known for a given interaction; this issue will be adressed in my last
> question. It would then be necessary to determine if a new interaction is
> created or not. Is there a way to extract an interaction list, i.e. a list
> of which each element contains two IDs, the IDs of the objects in contact,
> at each time step? If a new element is added to the list, I would then be
> able to detect a new contact. Or is there another way of doing so?
>
>
listIdsPairs = [(i.id1,i.id2) for i in O.interactions]

you can use Python set to determine new interactions [2]. But if you have a
lot of interactions and want the determination each time step, it would
probably make the code much slower..

> 3. Usually I use the visco-elastic law (ViscElPhys) implemented in
> ViscoelasticPM.cpp. This law calculates internally the relative velocity
> between the bodies in contact (mentioned earlier) as well as the different
> components of the interaction force (normal/tangential elastic/viscous
> components). I would like to extract this data during a simulation. How
> could this be done? Has this specific data extraction already been done
> for other contact laws?
>
>
you can get the data from interaction like:

for i in O.interactions:
  fN = i.phys.normalForce
  fS = i.phys.shearForce
  vel = i.geom.incidentVel
  # ... whatever else, I don't know ViscElPhys much, you can check the docs
  # also you can extract here the data in your own defined export function

cheers
Jan

[1] https://yade-dem.org/doc/yade.export.html#yade.export.textExt
[2] https://answers.launchpad.net/yade/+question/245380

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

Hi Dominik,

>> 3. Usually I use the visco-elastic law (ViscElPhys) implemented in
>> ViscoelasticPM.cpp. This law calculates internally the relative velocity
>> between the bodies in contact

We should definitely fix it. If you wish to do it, change the internal
velocity calculation to a geom-function and test it. It would be fine
and I will be glad to apply a patch.

Best regards

Anton

Revision history for this message
Dominik Boemer (dominik-boemer) said :
#3

Hello again,

thank you very much! I'll try to change the internal velocity calculation soon. Could you please tell me for which contact law this has already been done; in order to not start from nothing.

Best regards,

Dominik

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

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