[Gmsh] Non constant element sizes on a BSpline

Dorian Depriester dorian.dep at gmail.com
Tue Feb 27 14:31:14 CET 2018


Works like a charm!
Note : I have noticed that the Built-in kernel uses 2nd-ordered B-spline,
whereas the OpenCascade kernel use the 3rd-ordered approximation.
Thus, one may expect little changes depending on the used kernel.

2018-02-07 18:22 GMT+01:00 Christophe Geuzaine <cgeuzaine at uliege.be>:

>
>
> 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/20180227/a5aa1e29/attachment.html>


More information about the gmsh mailing list