[Gmsh] Non constant element sizes on a BSpline

Christophe Geuzaine cgeuzaine at uliege.be
Wed Feb 7 18:22:15 CET 2018



> On 7 Feb 2018, at 09:42, Dorian Depriester <dorian.dep at gmail.com> wrote:
> 
> Hello dear Gmsh users,
>   I would like to mesh a BSpline using non constant element sizes. Here is a MWE:
> 
> Point(1) = {0  , 0  , 0, 0.2};
> Point(2) = {-0.1, 0.5, 0, 0.2};
> Point(3) = {-0.1, 0.8, 0, 0.1};
> Point(4) = {0  , 1  , 0, 0.1};
> Point(5) = {1  , 1  , 0, 0.2};
> Point(6) = {1  , 0  , 0, 0.2};
> BSpline(1) = {1, 2, 3, 4, 5, 6};
> 
> Line(2) = {6, 1};
> Line Loop(1) = {1, 2};
> Plane Surface(1) = {1};
> Mesh 2;
> 
> With the aforementioned code, Gmsh just linearly interpolates from 0.2 to 0.2 between Point 1 and Point 6, resulting in constant size along the BSpline. Yet, I would like to get an element size of 0.1 near points 2 and 3.
> 
> Any help would be highly appreciated!
> 
> 
> Note: actually, I would like to control the mesh size depending on the local curvature (Mesh.CharacteristicLengthFromCurvature). Alas, it appears this option does not work (yet?) on BSplines (Gmsh crashes when I try to mesh using this option).

Try the latest version (“automated snapshot”). This works fine here, with both the built-in and open cascade kernels, and allows to control the number of points based on the curvature (using as reference the number of points on a circle):

// SetFactory("OpenCASCADE");
Point(1) = {0  , 0  , 0, 0.2};
Point(2) = {-0.1, 0.5, 0, 0.2};
Point(3) = {-1, 0.8, 0, 0.2};
Point(4) = {0  , 1  , 0, 0.2};
Point(5) = {1  , 1  , 0, 0.2};
Point(6) = {1  , 0  , 0, 0.2};
Spline(1) = {1, 2, 3, 4, 5, 6};
//BSpline(1) = {1, 2, 3, 4, 5, 6};

Line(2) = {6, 1};
Line Loop(1) = {1, 2};
Plane Surface(1) = {1};
Mesh.CharacteristicLengthFromCurvature = 1;
Mesh.MinimumCirclePoints = 50; // points per 2*pi




> Thus, I have computed the local curvature by my own (using Matlab), but I am stuck on the above issue.
> 
> Best regards.
> _______________________________________________
> gmsh mailing list
> gmsh at onelab.info
> http://onelab.info/mailman/listinfo/gmsh

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

Free software: http://gmsh.info | http://getdp.info | http://onelab.info

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20180207/815dde61/attachment.html>


More information about the gmsh mailing list