← Back to team overview

yade-users team mailing list archive

[Question #680569]: How to export the edges of a Voronoi tessellation? (no fluid case)

 

New question #680569 on Yade:
https://answers.launchpad.net/yade/+question/680569

Hi all,

I've seen a picture of a Voronoi Tesselation obtained with Yade on the wiki [1, Fig.2] where the edges of the Voronoi cells are visible. I want to do that (visualizing the Voronoi cells), but I don't really see how to obtain such a result with Yade…

What I've seen:
  - The example code [3] for `TesselationWrapper` does not present explicit calculation and exporting of the tesselation (tesselation is calculated implicitly through call to `computeVolume()`, exporting this information is not mentioned at all).
  - This answered question [4] seems to be very similar to what I am looking for, except that it concerns a Fluid-Particles interaction, whereas I only work with particles (no fluid). The solution of [4] uses the `saveVtk()` function of class `TwoPhaseFlowEngine`. The implementation of the logic seems to be in member function `saveVtk()` of class `DFNBoundingSphere` [7]. In other words, the logic is not whithin the `Tesselation` or `TesselationWrapper` classes but within a module for Fluid-particles interaction. Also note that `TwoPhaseFlowEngine::saveVtk()` has now been commented out in the source code [5] although it can still be found in the documentation [6].
  - Python class `TesselationWrapper` [2] does not seem to propose a function for explicit calculation of Voronoi tesselation.
  - C++ class `TesselationWrapper` contains `computeTesselation()` member function which does perform an explicit calculation of Voronoi tesselation, but it is not part of the `YADE_CLASS_BASE_DOC_*()` macro of the class `TesselationWrapper`, so it is not accessible from the Python interface.
  - The only way to compute the tesselation from Python that I have seen is to call the `TesselationWrapper.computeVolumes()` member function, but it does not output the shape of the cells, only their volume (from what I understand). Moreover (and still from what I understand) volumes can only be obtained one-by-one through successive calls to `TesselationWrapper.volume(sphereId)` for each sphere of the simulation.

Is the feature of exporting the geometry of Voronoi Tesselation cells implemented/supported by Yade?
If not, what would be the best way for me to achieve the result that I want?

Thanks for your answers ;)

Gaël

PS: what is the mysterious "Alpha" in the `getAlpha*()` functions? (for instance `getAlphaFaces()`)

[1] https://www.yade-dem.org/wiki/Triangulation
https://www.yade-dem.org/wiki/File:Cell_volume.png

[2] 
https://yade-dev.gitlab.io/trunk/yade.wrapper.html#yade.wrapper.TesselationWrapper

[3]
https://yade-dev.gitlab.io/trunk/tutorial-more-examples-fast.html#tesselationwrapper

[4]
https://answers.launchpad.net/yade/+question/656046

[5]
./pkg/pfv/TwoPhaseFlowEngine.hpp:438
./pkg/pfv/TwoPhaseFlowEngine.hpp:613

[6]
https://yade-dev.gitlab.io/trunk/yade.wrapper.html#yade.wrapper.FlowEngine.saveVtk

[7]
./pkg/pfv/DFNFlow.cpp


-- 
You received this question notification because your team yade-users is
an answer contact for Yade.