[Gmsh] background mesh

Christophe Geuzaine cgeuzaine at ulg.ac.be
Thu Sep 6 17:58:53 CEST 2007


Martin Genet wrote:
> Hello.
> 
> I am using the 'background mesh' way to generate a 3D mesh, wich is
> great. My problem is the size of the background mesh file, wich is
> getting bigger and bigger, which is a problem. Is there a way to solve
> this problem, for example by supplying an analytical function in gmsh or
> an external function written in python or C++ that return the requested
> value of the density of the mesh as a function of the position of the node?
> 

Hi Martin - It's still experimental, but if you download the latest 
nightly snapshot you can now use something like this:

lc = 1;
Point(1) = {0, 0, 0, lc};
Point(2) = {1, 0,  0, lc} ;
Point(3) = {1, 1, 0, lc} ;
Point(4) = {0, 1, 0, lc} ;
Line(1) = {1,2} ;
Line(2) = {3,2} ;
Line(3) = {3,4} ;
Line(4) = {4,1} ;
Line Loop(5) = {4,1,-2,3} ;
Plane Surface(6) = {5} ;

Function Field(1) = "Cos(2*3.14*x)/5 + 0.21";
Characteristic Length Field{1};


I think this should do what you want.

Take care,

Christophe


> Thank you for your help.
> Martin.
> 
> _______________________________________________
> gmsh mailing list
> gmsh at geuz.org
> http://www.geuz.org/mailman/listinfo/gmsh
> 
> 


-- 
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
http://www.montefiore.ulg.ac.be/~geuzaine