[Gmsh] Mesh size definition referring to surface or volume numbers.

Geordie McBain gdmcbain at freeshell.org
Wed May 25 03:30:35 CEST 2011


2011/5/25 Mark Starnes <mark.starnes at fttech.co.uk>:
> Hi everyone,
>
> Can you please tell me if it is possible to
> specify the size of elements in a region based on, for example, the
> region number and a transition distance?  I usually define my
> element sizes during Point definitions and on
> occasion using Fields, but I have some geometries
> for which I would like to set the target element size by
> Surface number or Volume number.  The reason for
> this is that I'm coupling regions with requiring
> dissimilar mesh densities; these regions are
> complex enough for me to feel apprehension at the
> thought of attempting to define geometric objects
> inside the regions to define mesh fields.
>
> Is this approach possible?

Yes, use Restrict
<http://geuz.org/gmsh/doc/texinfo/gmsh.html#index-Restrict-309>.  For
example, to refine just Plane Surface (9), use:

  Field[1] = MathEval;
  Field[1].F = "0.1";

  Field[2] = Restrict;
  Field[2].IField = 1;
  Field[2].FacesList = {9};

  Background Field = 2;

I attach a complete example.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: refreg.geo
Type: application/octet-stream
Size: 440 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20110525/eee5e839/attachment.geo>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: refreg.png
Type: image/png
Size: 14128 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20110525/eee5e839/attachment.png>