Trying to pass on property from python to shape
Hi all,
I wasn't sure if it was best to ask this here or on the yade-dev launchpad. Anyway, the problem is the following:
I have given my level set particles two additional properties by modifying LevelSet.hpp. I found a way to use these properties to speed up the calculations for the LS-DEM method I'm working on. I now want to be able to define these properties in the input python scripts for YADE.
I would like to do this by, for example, saying the following when defining a new level set body:
levelSetBody(
Within YADE_CLASS_
((bool, useProperty, false,,"Flag whether to use property to speed up calculations."))
((Vector3r,
Within the file utils.py the function levelSetBody:
I added the arguments
`useProperty=
Inside the function, I added near the end:
b.shape.hasProperty = hasProperty
if hasProperty:
b.
This compiles successfully and runs without any error messages. However, the property turns out not to be defined when I run a simulation. How do I adjust my code such that the properties are correctly forwarded from Python to C++ level?
I already looked whether I had to add something in _utils.cpp, but can't find the problem.
Kind regards,
Danny
Question information
- Language:
- English Edit question
- Status:
- Expired
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: