Suggested workflow for multiple body meshes?

6 weeks ago by
I've been running some simulations of electrostatic problems in fenics successfully, and now I would like to move on to more complicated models. So far, I have been using meshes either scripted in gmsh or imported from stl files and then meshed in gmsh. This is working fine but I can't figure out how to efficiently define physical surfaces and volumes (clicking to select them is not practical - if multiple bodies are imported in the same stl file gmsh doesn't allow them to be selected individually, and it is impractical to handle stl files for each subcomponent).

What tools/file formats/workflows are popular in the community for these types of multiple-body meshes where both surfaces and volumes must be defined? At the very least I would like to export a single file from a CAD program, click on each body to tag its physical type in a meshing program and then export to doflin xml. Ideally, I could do the tagging within the CAD program itself.
Community: FEniCS Project

We do it with SALOME.
You can define the geometry there and then select domains as well as boundaries.
We then export it to MED, convert it with GMSH and use eventually dolfin-convert.
In the .msh file the indices you may use in FEniCS are given.
Have a look at the "Computational Reality" book of Abali.

Here the workflow is described (section Complicated Geometries in FEniCS).

Does that help you solving your problem?

written 6 weeks ago by Julius Zimmermann  
Seems promising, I'll report back once I've given it a go. Hmm I notice SALOME has python scripting and gmsh has a python API. I wonder if this could be smoothed out without too much work. The reference looks great and my uni has access, many thanks!
written 6 weeks ago by Meshy  

You're welcome!
The python interface is great. I use SALOME notebook and give certain input parameters for simple geometries. As one can summarize all steps in a single shell script, I rerun my studies in automated manner. However, I use the netgen interface in SALOME for generating the mesh and just convert it by calling gmsh in my shell script. 

written 6 weeks ago by Julius Zimmermann  
Please login to add an answer/comment or follow this question.

Similar posts:
Search »