Content uploaded by Joachim Pouderoux
Author content
All content in this area was uploaded by Joachim Pouderoux on Sep 26, 2017
Content may be subject to copyright.
2D & 3D Voronoi Meshes
Generation with ShaPo
Joachim Pouderoux M. Charest, M. Kenamond, M. Shashkov
Kitware SAS, France Los Alamos National Laboratory
>
•ALE/ReALE context at LANL
•Need a trusted toolkit to create
2D & 3D Voronoi meshes
•Clean, reliable, robust, easy to build,
simple to use and interface, documented, etc.
•«Computing a Voronoi tessellation is
straightforward, I did it at high school!»
•Devil’s inside problem. Consider
Robustness
Efficiency
Reusability
MOTIVATION
Predicted density contours for sample ALE computation
2
>SHAPO
•Cross-platform library developed in C++ - based on VTK
to build Voronoi meshes from a set of generators/seeds in a
closed domain
•Developed at Kitware (France) for LANL since 2013
•Binding layers to use the tool in C, Fortran and Python
•Works in serial or in parallel (MPI)
•Use Shewchuck’s robust predicates
•Self-diagnostic (of I/O) & error management
•Documentation: doxygen & manuals, many examples
•Testing and dashboard reports –CMake/CDash
3
>MAIN FEATURES IN 2D
•Voronoi tessellation from a user provided or automatically
generated (random or regularly) set of generators within a
closed domain
•Domain boundary defined by a PLC that form a polygon
•Convex or non-convex
•Simply or multiply connected - with or without holes
•Rich API provides full connectivity of the generated mesh
along with other useful information
•Points, edges & cells connectivity
•Input boundary edge a mesh edge stands on,
point ids of points introduced on boundary edges, etc.
•Remote ids on neighbor nodes (parallel)
•Centroidal Voronoi - mesh relaxation
•Mesh export and visualization functions
4
>EXTRA FEATURES IN 2D
•Voronoi Remeshing
•Replace some regions of an existing unstructured
mesh with a Voronoi mesh
•Shape of non remeshed boundary cells do not
change but their connectivity does
5
>EXTRA FEATURES IN 2D
•Voronoi Remeshing
•Replace some regions of an existing unstructured
mesh with a Voronoi mesh
•Shape of non remeshed boundary cells do not
change but their connectivity does
•Robust small edges pruning
•Where can we collapse an edge to a point and
ensure cells stay non-convex?
•Post processing
•Local or global criterion
•Algorithm based on the « Feasible Set »1
1M. Berndt, M. Kucharik, M. J. Shashkov
Using the feasible set method for rezoning in ALE, In Procedia Computer Science, 2010
5
>2D TESSELLATORS
Constrained* Clipped* ConVorM
* Presented at MultiMat 2015
6
>CONFORMAL VORONOI MESH
•Problem
•Output tessellation must be conform to the input PLC
•Clipping has a cost and is difficult to make 100% robust
•Could we put generators in such a way that Voronoi edges stand on
the boundary edges?
7
>CONFORMAL VORONOI MESH
•Problem
•Output tessellation must be conform to the input PLC
•Clipping has a cost and is difficult to make 100% robust
•Could we put generators in such a way that Voronoi edges stand on
the boundary edges?
7
>CONFORMAL VORONOI MESH
•Problem
•Output tessellation must be conform to the input PLC
•Clipping has a cost and is difficult to make 100% robust
•Could we put generators in such a way that Voronoi edges stand on
the boundary edges?
7
>PREVIOUS WORK
1S. A. Mitchell, A. H. Mahmoud, A. A. Rushdi, A. A. Abdelrazek, C. L. Bajaj, J. D. Owens, M. S. Ebeida. 2015.
VoroCrust: Simultaneous Surface Reconstruction and Volume Meshing with Voronoi cells.
POEMS15 : Workshop on Polytopal Element Method in Mathematics and Engineering.
•Sandia’s VoroCrust [Mitchell et al.]
Algorithm(s) to place the generators and create
conformal Voronoi meshes in 2D & 3D
•Several workshop presentations1on the principle
•Core algorithm not fully described, no paper available yet
•Main idea: Sample circles on boundary points/edges
Put generators at circle-circle intersection points
8
>PREVIOUS WORK
1S. A. Mitchell, A. H. Mahmoud, A. A. Rushdi, A. A. Abdelrazek, C. L. Bajaj, J. D. Owens, M. S. Ebeida. 2015.
VoroCrust: Simultaneous Surface Reconstruction and Volume Meshing with Voronoi cells.
POEMS15 : Workshop on Polytopal Element Method in Mathematics and Engineering.
•Sandia’s VoroCrust [Mitchell et al.]
Algorithm(s) to place the generators and create
conformal Voronoi meshes in 2D & 3D
•Several workshop presentations1on the principle
•Core algorithm not fully described, no paper available yet
•Main idea: Sample circles on boundary points/edges
Put generators at circle-circle intersection points
8
>PREVIOUS WORK
1S. A. Mitchell, A. H. Mahmoud, A. A. Rushdi, A. A. Abdelrazek, C. L. Bajaj, J. D. Owens, M. S. Ebeida. 2015.
VoroCrust: Simultaneous Surface Reconstruction and Volume Meshing with Voronoi cells.
POEMS15 : Workshop on Polytopal Element Method in Mathematics and Engineering.
•Sandia’s VoroCrust [Mitchell et al.]
Algorithm(s) to place the generators and create
conformal Voronoi meshes in 2D & 3D
•Several workshop presentations1on the principle
•Core algorithm not fully described, no paper available yet
•Main idea: Sample circles on boundary points/edges
Put generators at circle-circle intersection points
8
>ConVorM ALGORITHM OVERVIEW
Input: PLC edges, Z: target cell size
1. Create circles at every PLC point of radius r
with r=0.45*min(Z, distance to nearest neighbor)
2. Until non covered edge e
•Randomly sample new circle Con empty space of e
with radius r = min(0.45 * Z, 0.9 * distance to nearest neighbor point on
edge e)
•If C of edge e intersects a circle C’ on edge e’ set radius of eand e’
to r = min(radius(C), radius(C’)
If they still intersect, set radius eand e’ to
r = 0.45 * distance(center(C), center(C’))
3. Create generators at circle-circle intersections
4. Insert user defined generators
or fill the interior of the domain using a MPS approach
5. Compute Voronoi cells for internal generators
9
>ConVorM ALGORITHM OVERVIEW
10
>EXAMPLES
11
>GOING 3D
•Voronoi tessellation from dual Delaunay
triangulation is quite straightforward
•A Voronoi face is created by connecting the
circumcenters of the tets adjacent to a dual edge
•We use TetGen library –robust & efficient
•Definition of the (explicit) data structures to
define and retrieve full connectivity of
output 3D meshes: edge/face/polyhedron
12
>3D CLIPPED VORONOI ALGORITHM
•Input: PLC, set of internal generators
13
>3D CLIPPED VORONOI ALGORITHM
•Input: PLC, set of internal generators
1. Add 8 bounding generators far enough from the input
generators (no need to deal with infinite edges/faces)
2. Compute the Delaunay triangulation of the generator set
13
>3D CLIPPED VORONOI ALGORITHM
•Input: PLC, set of internal generators
1. Add 8 bounding generators far enough from the input
generators (no need to deal with infinite edges/faces)
2. Compute the Delaunay triangulation of the generator set
3. Compute Voronoi faces around dual edges that involve
at least one internal generator
4. Create Voronoi polyhedron from faces
13
>3D CLIPPED VORONOI ALGORITHM
•Input: PLC, set of internal generators
1. Add 8 bounding generators far enough from the input
generators (no need to deal with infinite edges/faces)
2. Compute the Delaunay triangulation of the generator set
3. Compute Voronoi faces around dual edges that involve
at least one internal generator
4. Create Voronoi polyhedron from faces
5. Clip Voronoi faces against the PLC
13
>ROBUST POLYHEDRON CLIPPING
•Problem: just clip Voronoi polyhedrons against the PLC
•We experienced different libraries
•R3D: polyhedron clipping against set of planes
•Robust
•Cost to convert general purposes polyhedron to R3D’s model (3-connected points)
•No acceleration structure
•In some cases non-convex cells are not returned explicitly
•CSG.JS
•Not robust at all
•Return a triangle soup
•No acceleration structure
•GTS (GNU Triangle Surfaces, LGPL)
•Robust
•Pretty fast
•Return highly split cells
https://github.com/devonmpowell/r3d
https://github.com/dabroz/csgjs-cpp
http://gts.sourceforge.net
14
>CLIPPING REPAIR
•Once clipped, polyhedron surface mesh needs to be cleaned
•Merge triangles than were created by splitting same initial face (GTS patch)
•Remove points added on face boundary edges (adjacent to 2 edges)
15
>ORPHAN CELLS
•Clipping a convex polyhedron against a non convex PLC can lead
to multiple pieces
•«Orphan cell » is the piece that
does not contain its generator
•For now we no not “adopt” them
16
>3D CLIPPING RESULTS
Input meshes from Darren Engwirda’s JIGSAW zoo
17
>3D CLIPPING RESULTS
Input meshes from Darren Engwirda’s JIGSAW zoo
18
>3D CLIPPING RESULTS
Input meshes from Darren Engwirda’s JIGSAW zoo
18
>3D ConVorM
•Extension of the 2D concept to 3D
•Protect every triangle of the PLC with pairs of generators
•Generators are intersection points of 3 spheres
•Main rule: Generators must not be covered by a sphere
19
>3D ConVorM
•Extension of the 2D concept to 3D
•Protect every triangle of the PLC with pairs of generators
•Generators are intersection points of 3 spheres
•Main rule: Generators must not be covered by a sphere
19
>3D ConVorM
•Extension of the 2D concept to 3D
•Protect every triangle of the PLC with pairs of generators
•Generators are intersection points of 3 spheres
•Main rule: Generators must not be covered by a sphere
19
>3D ConVorM
•Extension of the 2D concept to 3D
•Protect every triangle of the PLC with pairs of generators
•Generators are intersection points of 3 spheres
•Main rule: Generators must not be covered by a sphere
19
>3D ConVorM
•Extension of the 2D concept to 3D
•Protect every triangle of the PLC with pairs of generators
•Generators are intersection points of 3 spheres
•Main rule: Generators must not be covered by a sphere
19
>3D ConVorM
•Extension of the 2D concept to 3D
•Protect every triangle of the PLC with pairs of generators
•Generators are intersection points of 3 spheres
•Main rule: Generators must not be covered by a sphere
19
>3D ConVorM
•Extension of the 2D concept to 3D
•Protect every triangle of the PLC with pairs of generators
•Generators are intersection points of 3 spheres
•Main rule: Generators must not be covered by a sphere
19
>WORK IN PROGRESS
•How to choose sphere radius?
•Big enough to ensure intersection and avoid gaps
•Small enough to not cover a generator
•What about sharp features?
20
>WORK IN PROGRESS
•How to choose sphere radius?
•Big enough to ensure intersection and avoid gaps
•Small enough to not cover a generator
•What about sharp features?
20
>ConVorM vs CLIPPED
21
>ConVorM vs CLIPPED
21
>PARALLEL TESSELLATION IN 3D
•Perform Clipped Voronoi tessellation in a
distributed memory context using MPI
•Each processor provides its generator set
and potentially some parts of the boundary
faces that define the whole domain
•Each processor obtains the Voronoi cells
corresponding to the generators it owns
•Based on Starinshak et al. 1algorithm
•Robust approach (no presumption on how
generators are distributed) but can lead to non
solvable problems –in worst case, one processor
may have to compute the whole problem
1D.P. Starinshak, J.M. Owen and J.N. Johnson,
Polytope: A New Parallel Framework for Computing Voronoi Meshes on Complex Boundaries »
Proc. SIAM Conf. on Parallel Processing and Scientific Computing, 2014
22
>PARALLEL ALGORITHM OVERVIEW
1. Compute the locally extended input
i. Compute and gather convex hull of local inputs
ii. Compute the DT of the global convex hull
iii. All gather boundary faces/edges/points
iv. Determine the neighbor processors
v. Insert neighbor generators to the local problem
2. Compute Voronoi tessellation with
serial algorithm for local generators
3. Compute communication information
23
>FIRST RESULTS
24
>FIRST RESULTS
24
>SUMMARY
•ShaPo aims to provide a complete reliable toolkit to generate
2D & 3D Voronoi meshes in serial and in parallel
•Ongoing & future work
•Make ConVorM robust in 3D
•Continue to explore Constrained algorithm in 3D
•Optimization of parallel tessellators
•Improve scalability
•Redistribute generators over processors
•Avoid reduction of the whole PLC
•Remeshing in 3D
25
>THANK YOU
26