<div dir="ltr">Just rereading your latest message,<div><br></div><div>According to gmsh documentation, <a href="http://gmsh.info/doc/texinfo/gmsh.html#Specifying-mesh-element-sizes" target="_blank">there are several ways to specify mesh size</a>.</div><div>Global mesh, mesh size at a point/vertex/ curvature meshing (gives you more nodes in curves than in straight lines), and background mesh.</div><div><br></div><div>The boundary layer field you are using can only be properly implemented as a mesh size indicator if used as background mesh. My guess is that in your case is partially working, because gmsh creates and evaluates the field and use it as background due to the command "BoundaryLayer Field = 1". But if other field is evaluated, the previous is overwritten. That's why you can't get the combination of your boundary layers. You can only see the cylinder BL when you comment lines 53-61, which is where you create the 2nd BL.</div><div><br></div><div>I'm not sure if using a BoundaryLayer Field = {1,2} would work. In any case, you can create the 2 fields (BL1, BL2), and then create a 3rd field that takes the minimum of those other 2. And set the background mesh as these 3rd field. It will only take 3 extra lines on your .geo file. <a href="http://gmsh.info/doc/texinfo/gmsh.html#t10_002egeo" target="_blank">Check the example 10 to see some examples of fields and combinations</a>.</div><div><br></div><div>Comment lines 48, 61, and add this after line 62.</div><div><pre class="m_480754412962829228gmail-verbatim" style="line-height:1.2em;font-size:11.115px;padding:1em;border:1px dashed rgb(47,111,171);color:black;background-color:rgb(243,247,255);white-space:pre-wrap">Field[3] = Min;
Field[3].FieldsList = {1, 2};
Background Field = 3;</pre></div><div>Post the results if satisfied</div><div><br></div><div><br></div><div><br clear="all"><div><div dir="ltr" class="m_480754412962829228gmail_signature" data-smartmail="gmail_signature">------------------------------------<b><br>Félix Salazar<br></b><i><a href="mailto:felix.salazar@polymtl.ca" target="_blank"><span style="color:rgb(51,102,255)">felix.salazar@polymtl.ca</span></a></i><b><br></b><div><div><div><div>------------------------------------<br></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 20, 2019 at 8:58 PM Ziad Boutanios <<a href="mailto:ziad@binkz.ca" target="_blank">ziad@binkz.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<p>Don't worry about it. I'll take a look at background fields, but
off the bat it seems like a substantial detour for additional
boundary layers, assuming it works.<br>
</p>
<p>Maybe one of the developers can comment whether separate
instances of BoundaryLayer can be implemented in a mesh at all?<br>
</p>
<div class="gmail-m_480754412962829228gmail-m_4800151733738361626moz-cite-prefix">On 2019-05-20 3:29 p.m., Felix Salazar
wrote:<br>
</div>
<blockquote type="cite">
<div dir="auto">Sorry for not replying sooner. I'm using my phone
to read your messages and couldn't open gmsh. But you're right,
the extrusion lines were commented. My bad.
<div dir="auto"><br>
</div>
<div dir="auto">You need to specify a background field. That
field needs to somehow integrate the effect of your 3 boundary
layers. Take a look at this example <a href="http://gmsh.info/doc/texinfo/gmsh.html#t10_002egeo" target="_blank">http://gmsh.info/doc/texinfo/gmsh.html#t10_002egeo</a></div>
<div dir="auto"><br>
</div>
<div dir="auto">Several fields are computed, and the background
field used for meshing is the minimum of all of them</div>
<div dir="auto"><br>
</div>
<div dir="auto">Not sure if it will work on your version of gmsh</div>
<div dir="auto"><br>
</div>
<div dir="auto">Hope that helps</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Mon, May 20, 2019, 1:16 PM
Ziad Boutanios <<a href="mailto:ziad@binkz.ca" target="_blank">ziad@binkz.ca</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<p><br>
</p>
<div class="gmail-m_480754412962829228gmail-m_4800151733738361626m_-4502309868935582375moz-cite-prefix">On
2019-05-20 11:59 a.m., Ziad Boutanios wrote:<br>
</div>
<blockquote type="cite">
<p><br>
</p>
<div class="gmail-m_480754412962829228gmail-m_4800151733738361626m_-4502309868935582375moz-cite-prefix">On
2019-05-20 11:26 a.m., Felix Salazar wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Based on the .geo file, what you're
seeing on the top and bottom surfaces is due to the
extrusions. The combination of these plus the BL
fields creates more layers than the 5 specified in the
extrusions.
<div><br>
</div>
<div>Try disabling (commenting) either the extrude or
the BL field and remesh.</div>
<div><br>
</div>
</div>
</blockquote>
<p><br>
</p>
<p>The Extrude sections in the bottom of the provided geo
file are already commented. <br>
</p>
<p><br>
</p>
<blockquote type="cite">
<div dir="ltr">
<div>Around the cylinder, there's a BL. You have
smaller quads there. If you want finer control, try
using an <a href="https://www.researchgate.net/figure/O-grid-around-the-circular-cylinder_fig11_280028215" rel="noreferrer" target="_blank">O-grid mesh</a>, similar to
the one on the previous link.<br clear="all">
</div>
</div>
</blockquote>
<p>Thanks for the suggestion but it doesn't help me. I'm
looking for a way to implement different instances of
BoundaryLayer, each with its own settings. Any idea how
this can be done?<br>
</p>
<p>BTW, I have to use gmsh 3.0.6 for compatibility
reasons.<br>
</p>
</blockquote>
<p>Forgot to mention that what you see in the original
snapshot around the cylinder is not a BoundaryLayer.
That's just the unstructured quad result of Recombine. If
you comment lines 53-61 you can see what the cylinder BL
looks like. I attached a snapshot of it.</p>
<p>The problem is that when I use successive instances of
BoundaryLayer, only the last one in the geo file is
produced. I need to have them all work so I can customize
each with its own settings.<br>
</p>
<blockquote type="cite">
<p> </p>
<p><br>
</p>
<blockquote type="cite">
<div dir="ltr">
<div>
<div>
<div dir="ltr" class="gmail-m_480754412962829228gmail-m_4800151733738361626m_-4502309868935582375gmail_signature">------------------------------------<b><br>
Félix Salazar<br>
</b><i><a href="mailto:felix.salazar@polymtl.ca" rel="noreferrer" target="_blank"><span style="color:rgb(51,102,255)">felix.salazar@polymtl.ca</span></a></i><b><br>
</b>
<div>
<div>
<div>
<div>------------------------------------<br>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Sun, May 19, 2019
at 11:11 AM Ziad Boutanios <<a href="mailto:ziad@binkz.ca" rel="noreferrer" target="_blank">ziad@binkz.ca</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
The geometry I'm meshing is that of a cylinder in a
straight rectangular <br>
channel in 2D. The geo file is attached, as well as
a screenshot of the <br>
result. I would like to use separate settings for
the boundary layer <br>
around the cylinder and at the top and bottom
surfaces. To do this I <br>
implemented two BoundaryLayer Field sections (lines
40-48 and 53-61). <br>
Unfortunately only the boundary layer corresponding
to the last section <br>
is produced. Can that be fixed using BoundaryLayer?<br>
<br>
Thanks,<br>
<br>
Ziad<br>
<br>
<br>
_______________________________________________<br>
gmsh mailing list<br>
<a href="mailto:gmsh@onelab.info" rel="noreferrer" target="_blank">gmsh@onelab.info</a><br>
<a href="http://onelab.info/mailman/listinfo/gmsh" rel="noreferrer noreferrer" target="_blank">http://onelab.info/mailman/listinfo/gmsh</a><br>
</blockquote>
</div>
</blockquote>
</blockquote>
</div>
</blockquote>
</div>
</blockquote>
</div>
</blockquote></div>