← Back to team overview

yade-dev team mailing list archive

Re: periodic weighted voronoi tesselation library (c++, open-source)

 


Very good. On my laptop TW.triangulate() + TW.computeVolumes() need 2.7sec for 100k spheres. May be to add this script to a examples?
A script probably needs a few imports and other things, and I didn't take time to tune one. The example in docstring is quite clear I think, but If you feel like putting those lines in a script, feel free to commit.


Does TW.triangulate() need to do on each moment when I need to update a volumes?

I'd say yes, since any movement can invalidate the triangulation (and simultaneously, the dual tesselation). Defining Voronoi vertices in an invalid triangulation would be inconsistent.

It is possible to move(vertice) in CGAL::triangulation, i.e. update the triangulation locally, accounting for the displacement of one vertex (here vertex=sphere). In my experience, moving all spheres one by one will be way slower than simply erasing the current triangulation and building a new one. This is because move(vertex) is just a smart version of remove(vertex)+insert(vertex,some_info_from_remove). Even if insert(vertex,some_info_from_remove) is faster than insert(vertex), this is wasting some time for keeping the triangulation valid after the removal operation. Maybe if you update only 1 or 2 positions in 100k spheres, it can be worth a try. The function is actually already wrapped in TW, but not for python. You could add a python wrapper like I did for other functions.
move (double x, double y, double z, double rad, unsigned int id);

You still need to recompute voronoi vertices and volumes. For now they will be recomputed everywhere, not only in updated cells, which is not exactly optimal... It would not be very difficult to implement local update but it needs time.

Bruno



References