[Gmsh] Refine mesh via Gaussian rim inside disk

Lars Hubatsch hubatsch at pks.mpg.de
Thu Apr 23 17:54:40 CEST 2020


Hi all,

I’m trying to create a disk mesh with a given background and, within a rim around the center, a local decrease of the characteristic length that follows a Gaussian (see attached image 1).

Code:

SetFactory("OpenCASCADE");
Disk(1) = {0, 0, 0, 4};
Physical Surface("surfacedomain") = {1};

Field[3] = MathEval;
Field[3].F = ".5 - (.5-0.01)*exp(-(1./0.1) *((sqrt(x*x+y*y)-1))*((sqrt(x*x+y*y)-1)))";

Background Field = 3;

However, for the parameters above the rim is not closed, what am I getting wrong?
If I change parameters slightly, e.g. 0.1 to 0.2 or 0.01 to 0.005 I get the correct representation. My problem is, that I eventually would like to do this in 3D within a sphere instead of a disk. However, this is visually harder to inspect (or is there a good way to do this?), so I would like to make sure that things work in principle in 2D.

Thanks,
Lars

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20200423/7691b00d/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot 2020-04-23 at 17.54.29.png
Type: image/png
Size: 178800 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20200423/7691b00d/attachment-0001.png>


More information about the gmsh mailing list