<div dir="ltr">Works like a charm!<div>Note : I have noticed that the Built-in kernel uses 2nd-ordered B-spline, whereas the OpenCascade kernel use the 3rd-ordered approximation.</div><div>Thus, one may expect little changes depending on the used kernel.</div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-02-07 18:22 GMT+01:00 Christophe Geuzaine <span dir="ltr"><<a href="mailto:cgeuzaine@uliege.be" target="_blank">cgeuzaine@uliege.be</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><br><div><span class=""><br><blockquote type="cite"><div>On 7 Feb 2018, at 09:42, Dorian Depriester <<a href="mailto:dorian.dep@gmail.com" target="_blank">dorian.dep@gmail.com</a>> wrote:</div><br class="m_3395985036517685486Apple-interchange-newline"><div><div dir="ltr">Hello dear Gmsh users,<br>  I would like to mesh a BSpline using non constant element sizes. Here is a MWE:<div><br></div><div><div><font face="times new roman, serif">Point(1) = {0  , 0  , 0, 0.2};</font></div><div><font face="times new roman, serif">Point(2) = {-0.1, 0.5, 0, 0.2};</font></div><div><font face="times new roman, serif">Point(3) = {-0.1, 0.8, 0, 0.1};</font></div><div><font face="times new roman, serif">Point(4) = {0  , 1  , 0, 0.1};</font></div><div><font face="times new roman, serif">Point(5) = {1  , 1  , 0, 0.2};</font></div><div><font face="times new roman, serif">Point(6) = {1  , 0  , 0, 0.2};</font></div><div><font face="times new roman, serif">BSpline(1) = {1, 2, 3, 4, 5, 6};</font></div><div><font face="times new roman, serif"><br></font></div><div><font face="times new roman, serif">Line(2) = {6, 1};</font></div><div><font face="times new roman, serif">Line Loop(1) = {1, 2};</font></div><div><font face="times new roman, serif">Plane Surface(1) = {1};</font></div><div><font face="times new roman, serif">Mesh 2;</font></div></div><div><br></div><div><font face="arial, helvetica, sans-serif">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.</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div>

<pre style="font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px"><font face="arial, helvetica, sans-serif">Any help would be highly appreciated!</font></pre><pre style="text-align:start;text-indent:0px;text-decoration-style:initial;text-decoration-color:initial"><font face="arial, helvetica, sans-serif" style="font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-transform:none;word-spacing:0px">

Note: actually, I would like to control the mesh size depending on the local curvature (</font><font face="times new roman, serif">Mesh.<wbr>CharacteristicLengthFromCurvat<wbr>ure</font><font face="arial, helvetica, sans-serif">)</font><span style="font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-transform:none;word-spacing:0px">. <font face="arial, helvetica, sans-serif">Alas, it appears this option does not work (yet?) on BSplines (Gmsh crashes when I try to mesh using this option).
</font></span></pre></div></div></div></blockquote><div><br></div></span><div>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):</div><div><br></div><div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">// SetFactory("OpenCASCADE");</span></div><span class=""><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">Point(1) = {0  , 0  , 0, 0.2};</span></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">Point(2) = {-0.1, 0.5, 0, 0.2};</span></div></span><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">Point(3) = {-1, 0.8, 0, 0.2};</span></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">Point(4) = {0  , 1  , 0, 0.2};</span></div><span class=""><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">Point(5) = {1  , 1  , 0, 0.2};</span></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">Point(6) = {1  , 0  , 0, 0.2};</span></div></span><span class=""><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">Spline(1) = {1, 2, 3, 4, 5, 6};</span></div></span><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">//BSpline(1) = {1, 2, 3, 4, 5, 6};</span></div><span class=""><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255);min-height:14px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">Line(2) = {6, 1};</span></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">Line Loop(1) = {1, 2};</span></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">Plane Surface(1) = {1};</span></div></span><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">Mesh.<wbr>CharacteristicLengthFromCurvat<wbr>ure = 1;</span></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">Mesh.MinimumCirclePoints = 50; // points per 2*pi</span></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></div></div><div><br></div><br><blockquote type="cite"><div><span class=""><div dir="ltr"><div><pre style="text-align:start;text-indent:0px;text-decoration-style:initial;text-decoration-color:initial"><span style="font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-transform:none;word-spacing:0px"><font face="arial, helvetica, sans-serif">Thus, I have computed the local curvature by my own (using Matlab), but I am stuck on the above issue.</font></span></pre><pre style="text-align:start;text-indent:0px;text-decoration-style:initial;text-decoration-color:initial"><span style="font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-transform:none;word-spacing:0px"><font face="arial, helvetica, sans-serif"><br></font></span></pre><pre style="text-align:start;text-indent:0px;text-decoration-style:initial;text-decoration-color:initial"><span style="font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-transform:none;word-spacing:0px"><font face="arial, helvetica, sans-serif">Best regards.</font></span></pre></div></div></span>
______________________________<wbr>_________________<br>gmsh mailing list<br><a href="mailto:gmsh@onelab.info" target="_blank">gmsh@onelab.info</a><br><a href="http://onelab.info/mailman/listinfo/gmsh" target="_blank">http://onelab.info/mailman/<wbr>listinfo/gmsh</a><br></div></blockquote></div><br><div>
<div dir="auto" style="word-wrap:break-word;line-break:after-white-space"><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">— </div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Prof. Christophe Geuzaine<br>University of Liege, Electrical Engineering and Computer Science <br><a href="http://www.montefiore.ulg.ac.be/~geuzaine" target="_blank">http://www.montefiore.ulg.ac.<wbr>be/~geuzaine</a><br><br>Free software: <a href="http://gmsh.info" target="_blank">http://gmsh.info</a> | <a href="http://getdp.info" target="_blank">h<wbr>ttp://getdp.info</a> | <a href="http://onelab.info" target="_blank">http://<wbr>onelab.info</a></div></div>
</div>
<br></div></blockquote></div><br></div>