Skip to content

MoiseRousseau/SALOME-Voronoi

Repository files navigation

SALOME-Voronoi

Interface between Salome and Vorpalite from the Geogram programming library for polyhedral mesh generation. Note the Vorpalite program has many features (such as parallel tetrahedral meshing among other), but this script is primary intented for Centroidal Voronoi diagram computation.

Installation

Below instructions were tested using Ubuntu 22.04 and Salome 9.9 They should work for other Linux distributions without so much modifications.

  1. Clone this repository inside your Salome plugin directory $HOME/.config/salome/Plugins/. If this folder does not exist, create it.

  2. Install Vorpalite dependencies:

sudo apt install libboost-dev libcgal-dev libglu1-mesa-dev libxxf86vm-dev libxtst-dev libxrandr-dev libxinerama-dev libxcursor-dev doxygen cmake g++
  1. Compile Vorpalite executable using the dedicated script install_vorpalite.sh.

  2. Create or add the following line to the smesh_plugin.py file:

import sys
import os
import salome_pluginsmanager

try:
  pathVoronoi = os.getenv("HOME") + "/.config/salome/Plugins/SALOME-Voronoi"
  if not pathVoronoi in sys.path:
      sys.path.append(pathVoronoi)
 
  import Voronoi_converter

  salome_pluginsmanager.AddFunction('Voronoi/Convert to Voronoi', '', Voronoi_converter.convertForCVTCalculation)
  
except Exception as e:

  print("Failed to import SALOME-Voronoi plugin:", e)

  1. Your plugin is operational. You can now start converting meshes with Mesh/Plugins/Voronoi/Convert to Voronoi.

Use the plugin

  1. Launch plugin GUI with Mesh/Plugins/Voronoi/Convert to Voronoi.

  2. (Mandatory) Select the boundary mesh. This mesh will define the boundary of the Voronoi diagram. Only the 2D elements will be used.

  3. (Optional) Select the seeds mesh. This mesh will define the seeds from where the Voronoi cell will be computed. Only the node will be used. If no mesh is specified, Vorpalite will create and optimize the seeds and their locations to create a Centroidal Voronoi Diagram.

  4. Type the parameter to pass to Vorpalite. By default, Vorpalite is set to polygonal meshing mode (profile=poly), generate unique ids for the vertices (generate_ids=true) and will merge the boundary the with same normal (simplify=tets_voronoi_boundary). If no seeds mesh is specified, you should add the command nb_pts=X to create X seeds. A description of available parameter can be found by running in a terminal vorpalite -h

  5. Check "Create groups from seeds mesh nodes group" to create groups of volume based on the existing nodes groups in your seed mesh.

  6. Click OK to launch the Voronoi Diagram computation.

Examples

Subsurface flow simulation in backfilled open-pits

Comparison of a 50K elements tetrahedral and polyhedral meshes. Polyhedral mesh was generated in nearly 60 seconds on a i7-6820HQ machine given the domain boundary and argument n_pts=50000 to Vorpalite.

If you make beautiful meshes with my script, please send me picture of it so I can add it here!

Authors

  • Moïse Rousseau - Initial work

Getting involved

Feel free to contact me if you have problems or comments, it will help me to improve the plugin.

Further reading

License

File in this repository are licensed under the GPL version 3 License - see the LICENSE.md file for details. About the Vorpalite program and Geogram library, please see this page.

About

Interface between Salome and Vorpalite for polyhedral mesh generation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published