Using Triangulation Data in a Yade Script

Asked by Gary Pekmezi

I aim to implement the Uniform Stress micro-scale boundary condition in Yade using the approach described in [1]. Eventually my goal is to implement an engine that does this seamlessly, along the lines of TriaxialStressController().

However, in the short term I was hoping to use PyRunner in a Yade script to demonstrate how this could work. I could use the triangulation done with TesselationWrapper() or FlowEngine(), to extract the surface boundary. The area vector for each boundary particle could then be calculated from the triangulated boundary surface.

The hiccup for this short-term implementation is that I cannot seem to find a way to access the triangulation data in a Yade script. One approach I tried was to use TW.defToVtk() to write the data to a file, then read it and use vtkDataSetSurfaceFilter() to extract the surface. This approach was not only cumbersome, but stripped out any relationship the triangulation has with the DEM model since the particle numbers are not preserved by the VTK surface filter.

My question is whether the triangulation data can be used in a Yade script, or is the triangulation only implemented internally for analysis and post-processing?

Thanks,
Gary

[1] https://link.springer.com/article/10.1007/s10035-017-0757-y

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#1

Hello Gary,
At the bottom level of the triangulation code there is CGAL library. On the top of CGAL, Yade has mainly C++ function to glue the particles positions of DEM together with CGAL's triangulation (besides calculating derived quantities such as deformations). And finally some python binding on the top of the C++ glue for some user-level functions.

What is needed in you case, it seems, is to access the CGAL data structure directly to work efficiently. It is not anticipated in yade that someone needs full access to CGAL data since it would involve developing our own python wrapping for the whole triangulation package of CGAL, not a small task.
The solution to your problem could be to add a few additional python wrappers to TesselationWrapper in order to access just what you need (not so clearly defined in your question). Implementation of these needs a good understanding of CGAL internals and c++/python binding.
Actually it could be that what you need is already accessible somehow but you did not notice. The list of spheres adjacent to external boundaries, for instance, can be retrieved.
So, let us know more precisely what data is needed for better advices.
Cheers
Bruno

Can you help with this problem?

Provide an answer of your own, or ask Gary Pekmezi for more information if necessary.

To post a message you must log in.