export salome mesh to FeNICS mesh

copyright (C) 2011-2017 iesensor.com

Salome installation

  1. download

Salome platform 8.5 binary for Ubuntu 16.04 (64bit)

Salome-meca is the combination of salome and code_aster (FEA), it is also possible to manually add the Code_saturne plugin for CFD

  1. installation

extract this compressed file to a position like /opt, it has its own python2.7 and most not-so-common dependent packages Do read the readme to check if you have installed all the essential packages.

  1. run the program

run the program in a terminal (to catch output/error message) /path_to/salome.py which set env var.

to fix this error on my machine, I need unset PYTHONPATH in my “~/.bashrc”

BTW, 3D The hardware acceleration is disable in my virtualbox,

“~/.bashrc”

#3D window is not working if 3D accel is turned on for vbox

export LIBGL_ALWAYS_SOFTWARE=1

  1. macro recording function

The operation within GUI can be recorded into python script by “File-> dump study”, this saved python script can be loaded later, or adapted for used in batch mode.

  1. NoteBook variables

variale can only be simple math expression, math.pi math.sin() are not supported.

  1. partition, group and save multi-zone mesh

submesh is used

=============================================================

mesh conversion from salome to Fenics

meshio-convert (from meshio package) can translate the salome Med format into dolfin format, however, it seems boundary and subdomains are not converted.

Here is another route: Salome>Gmsh>Fenics, inspired by [I was finally able to import an assembly mesh into OpenFOAM format with the following Salome>Gmsh>OpenFOAM process]https://www.cfd-online.com/Forums/openfoam-meshing/82210-importing-multiple-meshes.html

 

To export dolfin meshing, using dolfin-convert your_gmsh.msh your_dolfin.xml

Extra notes:

  1. In Salome-mesh export, Med version should select the lowest, however, gmsh may still complain the med lib version is too high. I use the gmsh 4 to read the med mesh sucessfully.

2. Make sure the gmsh “expert mode” is enabled in preference, so “gmsh v2 ASCII” option can be selected in gmsh export dialog.   It seems quad mesh cells are not supported in dolfin-convert

BSD documentation licensed Free for non-commercial usage only
Author: Qingfeng XIA
copyright (C) 2011-2017
http://www.iesensor.com
please keep the original link in your reference.
http://www.iesensor.com/blog/2018/09/24/export-salome-mesh-to-fenics-mesh/
This entry was posted in Programming. Bookmark the permalink.