creating a predicate

Asked by bruna

Hello everyone!

I'm new in yade-dem and I would like to simulate a rockfill dam. For this, I've already created my body with facets but I can't fill it with spheres.
I noticed that there are some options but they all need a predicate. So I want to know if is it possible to create a predicate with the shape that I want (a truncated pyramid).

Thanks a lot

Bruna.

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Václav Šmilauer
Solved:
Last query:
Last reply:
Revision history for this message
Jérôme Duriez (jduriez) said :
#1

Hello,

Yes it is possible, especially using a "gts" (a CAD software, let's say, you may by the way use directly within Yade) definition of the surface.

See e.g. https://yade-dem.org/doc/yade.pack.html#yade.pack.inGtsSurface_py
and associated funny "horse" example (whose result appears in the doc section https://yade-dem.org/doc/yade.pack.html#yade.pack.inGtsSurface_py, which could be very useful for you, by the way)

Revision history for this message
Best Václav Šmilauer (eudoxos) said :
#2

You can also create your own predicate class in python and describe the geometry analytically. You can look in py/pack/pack.py, find "class inGtsSurface_py" (which is normally not used at all) and write something similar in your code. You need to inherit from the _packPredicates.Predicate base class and override all the methods (__init__, aabb, __call__) in python. HTH, Václav

Revision history for this message
bruna (brunamot) said :
#3

Thanks Václav Šmilauer, that solved my question.