Particles forces

33 views
Skip to first unread message

Mohammad Wasfi

unread,
Oct 16, 2022, 3:48:33 AM10/16/22
to ProjectChrono
Hi, 

I am trying to obtain the forces the particles experience in my simulation as a CSV file. I am using the GPU module. I have looked and found that I can possibly use the WriteCsvParticles function that is capable of doing that. However, it seems that this is a protected function and can not be accessed. Is there another way that I can obtain the forces on all the particles in the system? 

Thank you so much, 

Ruochun Zhang

unread,
Oct 17, 2022, 4:09:16 PM10/17/22
to ProjectChrono
Hi Mohammad,

You should in your script set the output flag such that this information is outputted. The flag is FORCE_COMPONENTS, so the command should look like...
gpu_sys.SetParticleOutputFlags(ABSV | FORCE_COMPONENTS);

Now that you mentioned it, I found no demos is actually using this flag. Maybe it should be changed... Note this flag would give you the total contact force each particle experiences. But if it's the contact force of each contact pair that you are looking for, you'd have to do something different.

Thank you,
Ruochun

Mohammad Wasfi

unread,
Oct 17, 2022, 10:26:51 PM10/17/22
to ProjectChrono
That worked,  thank you so much!
Reply all
Reply to author
Forward
0 new messages