Hey Salome devs, it’d be awesome if you could add a polyDualMesh feature to generate a dual mesh that can be exported in VTK or another format that supports polyhedra. This would make it way easier to work with polyhedral meshes in CFD and other simulations, similar to how OpenFOAM’s polyDualMesh
works. Right now, getting a clean dual mesh out of Salome takes extra steps, and having it built-in would be a huge time saver. Hope you’ll consider it!
the poly dual of salome right now generates way too many ‘extra faces’ as it does not fuse them (similar to what happens in polyDualMesh in OF on the boundary cells), i would not recommend this meshes for CFD, as you losse one of the main benefits of this kind of mesh. I would recommend instead this tool (wich has its own disadvantages but generates more suited CFD meshes) developed by @MRousseau great developper.
@cbourcier any input into how one would import this to newer versions of salome?
I followed the guide on the github but it did not show up in tools/plugings
thanks in advance
Sneaking into this thread. The README about the installation of the tool seems still valid to me. But here is how you can proceed.
I gave it a try with latest SALOME-9.14 on Ubuntu 22.04 - and I believe it should apply to other platforms as well.
- Install this plugin in a given directory, e.g.
/home/salome
.
cd /home/salome
git clone https://github.com/MoiseRousseau/SALOME-Voronoi.git
cd SALOME-Voronoi
# ensure that mentioned prerequisites in README are installed!
./install_vorpalite.sh
- Apply a minor modification to the plugin, to make it portable, namely edit file:
Voronoi_converter.py
and replace:
path = '/home/%s/.config/salome/Plugins/SALOME-Voronoi/' %(os.getlogin())
with:
path= os.getenv('SALOME_VORONOI_ROOT_DIR', '/tmp')
if not path.endswith('/'): path+='/'
- Expose Voronoi plugin environment to SALOME. To do this, extract the attached
extra.env.d
directory inSALOME-9.14.0-native-UB22.04-SRC/extra.env.d
. Edit fileextra.env.d/9000_voronoiPlugin.py
and fix path to SALOME-Voronoi plugin:
context.setVariable(r'SALOME_VORONOI_ROOT_DIR', r'/home/salome/SALOME-Voronoi', overwrite=True)
- Edit file:
SALOME-9.14.0-native-UB22.04-SRC/BINARIES-UB22.04/SMESH/share/salome/plugins/smesh/smesh_plugins.py
and right after meshboolean plugin, add:
try:
import Voronoi_converter
from Voronoi_converter import convertForCVTCalculation
salome_pluginsmanager.AddFunction('Interface between Salome and Vorpalite', 'polyhedral mesh generation.', convertForCVTCalculation)
except Exception as e:
salome_pluginsmanager.logger.info('ERROR: voronoi plug-in is unavailable: {}'.format(e))
pass
- Launch SALOME and activate SMESH, the plugin will show up in list of SMESH plugins.
Enclosed:
- modified converter which implements the mentioned minor modification.
extra.env.d.tar.gz
which contains the environment file of this plugin. Fix path in this file.
@cbourcier : approach based on SMESH_PYPLUGIN_DIR
environment variable does not seem to work here.
Voronoi_converter.py (6.2 KB)
extra.env.d.tar.gz (410 Bytes)
smesh_plugins.py (6.1 KB)
Hello Nabil,
thanks for the help.
I am still having troubles to make it show in salome.
for info, I am using the universal linux distribution.
the steps I followed are:
#go to path of installation of salome
cd $salomeFolderPath/SALOME-9.14.0
#extract the tar file
tar sxzf ~/Desktop/extra.env.d.tar.gz
#replace the necessary things on the extracted file
sed -i "s|context.setVariable(r'SALOME_VORONOI_ROOT_DIR', r'/home/salome/SALOME-Voronoi', overwrite=True)|context.setVariable(r'SALOME_VORONOI_ROOT_DIR', r'$salomeFolderPath/SALOME-Voronoi', overwrite=True)|" extra.env.d/9000_voronoiPlugin.py
#add extra lines to BINARIES-CO7/SMESH/share/salome/plugins/smesh/smesh_plugins.py
sed -i "s|^\(\s*\)salome_pluginsmanager.logger.info('ERROR: MeshBoolean plug-in is unavailable: {}'.format(e))|\1salome_pluginsmanager.logger.info('ERROR: MeshBoolean plug-in is unavailable: {}'.format(e))\n\1pass\n\ntry:\n import Voronoi_converter\n from Voronoi_converter import convertForCVTCalculation\n salome_pluginsmanager.AddFunction('Interface between Salome and Vorpalite', 'polyhedral mesh generation.', convertForCVTCalculation)\nexcept Exception as e:\n salome_pluginsmanager.logger.info('ERROR: voronoi plug-in is unavailable: {}'.format(e))|" BINARIES-CO7/SMESH/share/salome/plugins/smesh/smesh_plugins.py
# go to root of salome installation path
cd $salomeFolderPath
#clone the git
git clone https://github.com/MoiseRousseau/SALOME-Voronoi.git
#enter created folder
cd SALOME-Voronoi
#make executable the .sh
chmod +x ./install_vorpalite.sh
#run the .sh
./install_vorpalite.sh #the compilation went ok
# replace/add the lines to Voronoi_converter.py
sed -i "s|^\(\s*\)path = '/home/%s/.config/salome/Plugins/SALOME-Voronoi/' %(os.getlogin())|\1path= os.getenv('SALOME_VORONOI_ROOT_DIR', '/tmp')\n\1if not path.endswith('/'): path+='/'|" Voronoi_converter.py
when I open salome it prints ‘Setting SALOME-Voronoi environment’ but it is not shown on the SMESH plugings
also I double checked the results of the sed commands in case there were some errors but the result is okey
To launch the plugin interface, once SMESH activated, in the main menu bar, select Mesh, then click SMESH Plugins and finally select : Interface between Salome and Vorpalite.
I just tried your commands and it’s OK.
sorry i was looking in tools/plugings instead of mesh/SMESH plugings