[Gmsh] mesh size in openCascade units
Lukas van de Wiel
lukas.drinkt.thee at gmail.com
Thu Apr 25 15:32:00 CEST 2019
Hi Jeremy,
thanks for the help!
With your pointer I managed to make a beautiful smooth transition of
element sizes, by essentially following tutorial 10 :)
I ended up with:
//------------------------------------------------------------------------------------------------------
SetFactory("OpenCASCADE");
lc = 310;
chamberCenterDepth = -2000.0;
chamberMaxRadius = 1000.0;
domainLength = 15000.0;
// start with a sphere
Sphere(1) = {0, 0, -chamberCenterDepth, chamberMaxRadius};
// flatten it {centerx, centery, centerz} {scale x, scale y, scale z}
Dilate {{0, 0, -chamberCenterDepth}, {1,1,0.1}} { Volume{1}; }
// quarter cylinder
Cylinder(2) = {0,0,0,0,0,domainLength,domainLength,0.5*Pi};
// remove the cavity
BooleanDifference(10) = { Volume{2}; Delete; }{ Volume{1}; Delete; };
Field[1] = Distance;
Field[1].NodesList = {7,8};
Field[1].NNodesByEdge = 10;
Field[1].EdgesList = {8,9};
Field[2] = Threshold;
Field[2].IField = 1;
Field[2].LcMin = lc / 5;
Field[2].LcMax = lc;
Field[2].DistMin = 3000;
Field[2].DistMax = 10000;
Background Field = 2;
Mesh.CharacteristicLengthExtendFromBoundary = 0;
Mesh.CharacteristicLengthFromPoints = 0;
Mesh.CharacteristicLengthFromCurvature = 0;
//------------------------------------------------------------------------------------------------------
I still have to figure out how to mesh the outer curved surface of the
cylinder, as gmsh does not respond well to RemeshParametrization which I
tried following discussion:
http://onelab.info/pipermail/gmsh/2017/011597.html
But that is something for me to figure out :-)
Best wishes and thanks again
Lukas
On Wed, Apr 24, 2019 at 11:19 PM Jeremy Theler <jeremy at seamplex.com> wrote:
> Hello Lukas
>
> On Wed, 2019-04-24 at 10:46 +0200, Lukas van de Wiel wrote:
> >
> > So far, the geo file looks great.
> > However, I want a mesh that is really fine around the chamber, and
> > that gradually becomes coarser toward the edge of the cylinder.
> >
> > I have of course read
> > http://gmsh.info/doc/texinfo/gmsh.html#Specifying-mesh-element-sizes
> > prior to using this mailing list, which resulted in failed attempts
> > such as:
> >
> > Characteristic Length {Volume{2};} = 500;
> > Characteristic Length {Volume{1};} = 50;
> >
> > How should I go about this?
>
> Read further an use Distance + Threshold fields.
>
> --
> jeremy theler
> www.seamplex.com
>
>
> _______________________________________________
> gmsh mailing list
> gmsh at onelab.info
> http://onelab.info/mailman/listinfo/gmsh
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20190425/a26c726e/attachment.html>
More information about the gmsh
mailing list