[Gmsh] Swiss Cheese in GMSH

Lorenzo Isella lorenzo.isella at gmail.com
Mon Mar 28 20:46:08 CEST 2011


Dear All,
I hope that the title of the email will not be misleading.
I have just started to learn how to use fipy, which in turns relies on 
Gmsh for non-trivial meshes.
My problem is the following: I am given a computational domain which 
looks like a cube having some spherical cavities in its interior.
That is why I was referring to Swiss cheese in the email title.
To be more precise the situation is the following: all the spherical 
cavities have the same radius R and I am given a simple text file like

x_1 y_1 z_1
x_2 y_2 z_2
..............
x_N y_N z_N

where
x_i y_i z_i
are the 3D coordinates of the i-th cavity.
Now, what I would like to do is to script Gmsh in such a way to
(1) generate a cube having side [-L/2, L/2] along x, y and z
(2) introduce the N cavities at the right positions
(3) mesh the resulting object being able in particular to refine the 
mesh around the cavities (which is where I need more accuracy).

Is anything like that doable with GMSH? According to what I read on the 
fipy mailing list and saw on the gmsh tutorials, the answer is a 
definite yes, but some help is needed.
Even a simple script which just a couple of cavities would help me a lot.
Any suggestion is appreciated

Lorenzo

PS: the overall shape of the computational domain is not essential for 
me, provided it is large enough. In other words: the cube can be 
replaced with a large sphere or a cylinder if it eases the numerical work.