[Gmsh] [Fwd: Adaptive mesh refinement with getDP and gmsh]

Christophe Geuzaine Christophe.Geuzaine at ulg.ac.be
Wed Apr 25 19:20:46 CEST 2001

Jehudi Maes wrote:
> Dear Mr. Dular and Mr. Geuzaine,
>  I have been working with GetDP and gmsh for the FE calculations of a
> switched reluctance motor (magnetostatic calculations). For these
> calculations I have had a lot of help from one of your collegues Johan
> Gyselinck. From the websites and the documentation I concluded that it is
> possible to use GetDP and gmsh for adaptive mesh generation. Could you be as
> kind as to point out how I have to use the combination of GetDP and gmsh for
> adaptive mesh generation.

For h-type adaptation (i.e. modification of element sizes), you should
output a post-processing view which contains the target characteristic
lengths. Thus, you should

1) generate a first (coarse) mesh
2) compute target mesh sizes on this mesh, and output the results as a
   Gmsh post-processing view
3) load this view in Gmsh, and apply it as the current background mesh
   (with 'View->Apply as Background Mesh'), or load the view on the
   command line, with the option '-bgm file'
4) re-mesh

Step 2) is of course the difficult part, and depends on your problem.
GetDP can help to generate the target size view if you have a mean to
compute an error field, i.e. some 'volumic' field on the mesh
representing (an approximation of) the error. If you can compute such a
field, then you can use 'Adapt H1' in a GetDP PostOperation on this
field, and you will obtain a valid background mesh for Gmsh.

WARNING: if you plan to use background meshes, you need the very latest
version (1.18) of Gmsh. This version fixes a serious bug in the
of adapted 1D meshes.

For p-type adaptation (i.e. local modification of interpolation order),
you should output an adaptation file, and give it to GetDP on the
command line with the '-adapt file' option. The adaptation file can be
generated by GetDP by using 'Adapt P1' and by specifying 'Adaptation' in
the Format of a PostOperation.

> Regarding the gmsh software I have some problems with the post processing
> (generating smooth surface maps), are there any examples (besides t8.geo in
> the tutorial) on how to use gmsh for post processing ?

What do you mean by a 'smooth surface map' ? 

The simplest example of post-processing with gmsh is 'gmsh t1
view1.pos'. All post-processing options in Gmsh are available by
right-clicking on the view button.

> Kind regards,
> Jehudi

I have forwarded your mail to the gmsh mailing list. If you reply to
this message, please reply to the mailing list.


Christophe Geuzaine

Tel: 32 (0) 4 366 37 10    http://geuz.org
Fax: 32 (0) 4 366 29 10    mailto:Christophe.Geuzaine at ulg.ac.be