Deactivating NewtonIntegrator.gravity on just a group of particles in the model

Asked by Marcus Moravia on 2021-04-16

Hi everyone!

In just a few particles of my model, I would like to keep the dynamics, but without the gravitational force on these elements. I mean, I wonder if it's possible to do this by turning off gravitational acceleration (NewtonIntegrator.gravity) on just a part of the model's elements and at the same time having gravitational forces acting on the rest of the model's particles.

Thank you very much,

Marcus

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jérôme Duriez
Solved:
Last query:
Last reply:
Jan Stránský (honzik) said : #1

Hello,

it is not possible.
It would not be too difficult (IMO!) to implement if needed.

A simple workaround is to apply "opposite force" on "gravity-free" particles.

cheers
Jan

Hi,

> A simple workaround is to apply "opposite force" on "gravity-free" particles.

Indeed. Or even set null gravity and assign weight as a permanent force, selectively.
Bruno

Marcus Moravia (mgmoravia) said : #3

Thanks for the answers. I had thought about applying a counter force as suggested by Jan, but the idea of applying a permanent force seems to me to be less costly for the simulation loop than a routine of counter forces. I'm going to test it, but Bruno would you know beforehand if this approach has a lower computational cost?

Thanks.

Best Jérôme Duriez (jduriez) said : #4

Since we have two ways to impose gravity, you may also look at https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.GravityEngine and its "mask" attribute.

By order of performance I would say, probably:
1. add forces selectively
2. add counter-forces selectively
3. gravity engine #4 (it implies one more loop)

The difference between 1 and 2 is probably negligibly small, though.
Bruno

Marcus Moravia (mgmoravia) said : #6

Thank you to share that Jérôme, it solved my question.

Marcus Moravia (mgmoravia) said : #7

Thank you very much, Bruno.

Marcus Moravia (mgmoravia) said : #8

Thanks Jérôme Duriez, that solved my question.