<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 21 May 2018, at 18:54, Alejandro Pina <<a href="mailto:ajpina@gmail.com" class="">ajpina@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="caret-color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px; 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; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">Thanks Christophe for replying. I have attached a picture after adding the line you suggested. </div><div style="caret-color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px; 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; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">In the picture you can also see the API version I am using and built number. The size of triangles does not respond to any value set on ‘lc’.</div></div></blockquote><div><br class=""></div><div>By default gmsh.intialize() reads the Gmsh configuration files it finds on your system; my guess is that you have some options set in .gmshrc or .gmsh-options to change the default meshing algorithm (your log shows that you're using Frontal, which is not the default) and the mesh size.</div><div><br class=""></div><div>Try</div><div><br class=""></div><div><div> gmsh.initialize('', False)</div><div class=""><br class=""></div><div class="">which will disable reading of the config files.</div><div class=""><br class=""></div></div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div style="caret-color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px; 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; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">Best,</div><div style="caret-color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px; 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; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">Alejandro </div><div style="caret-color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px; 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; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class=""></div><span id="OLK_SRC_BODY_SECTION" style="caret-color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px; 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; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div style="font-family: Calibri; font-size: 11pt; text-align: left; border-width: 1pt medium medium; border-style: solid none none; padding: 3pt 0in 0in; border-top-color: rgb(181, 196, 223);" class=""><span style="font-weight: bold;" class="">From:<span class="Apple-converted-space"> </span></span>Christophe Geuzaine <<a href="mailto:geuzaine@gmail.com" class="">geuzaine@gmail.com</a>><br class=""><span style="font-weight: bold;" class="">Date:<span class="Apple-converted-space"> </span></span>Monday, May 21, 2018 at 7:36 AM<br class=""><span style="font-weight: bold;" class="">To:<span class="Apple-converted-space"> </span></span>Alejandro Pina <<a href="mailto:ajpina@gmail.com" class="">ajpina@gmail.com</a>><br class=""><span style="font-weight: bold;" class="">Cc:<span class="Apple-converted-space"> </span></span><<a href="mailto:gmsh@onelab.info" class="">gmsh@onelab.info</a>><br class=""><span style="font-weight: bold;" class="">Subject:<span class="Apple-converted-space"> </span></span>Re: [Gmsh] Gmsh Python API<br class=""></div><div class=""><br class=""></div><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div class=""><br class=""></div>It works fine over here: are you sure you are editing/examining the correct input/output files?<div class=""><br class=""></div><div class="">Add</div><div class=""><br class=""></div><div class=""> gmsh.fltk.run()</div><div class=""><br class=""></div><div class="">before gmsh.finalize() - it will launch the GUI so that you can inspect the model interactively.<br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On 20 May 2018, at 21:03, Alejandro Pina <<a href="mailto:ajpina@gmail.com" class="">ajpina@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space; font-size: 14px; font-family: Calibri, sans-serif;"><div class="">Dear List,</div><div class=""><br class=""></div><div class="">I have been trying to use the Python API but my meshing does not respond to the mesh size that I set when adding the points. I reproduced my problem in the following example. So no matter what value I set on ‘lc’, the surface always happens to have only four triangles.</div><div class=""><br class=""></div><div class="">Hope you can help me figure it out and be able to control the meshing. I am also attaching the resulting 'MyTest.msh’ file. </div><div class=""><br class=""></div><div class=""><div class="">import gmsh</div><div class=""><br class=""></div><div class="">gmsh.initialize()</div><div class="">gmsh.option.setNumber("General.Terminal", 1)</div><div class="">gmsh.model.add("MyTest")</div><div class="">lc = 1e-4</div><div class="">gmsh.model.geo.addPoint(0, 0, 0, lc, 1)</div><div class="">gmsh.model.geo.addPoint(.1, 0, 0, lc, 2)</div><div class="">gmsh.model.geo.addPoint(.1, .3, 0, lc, 3)</div><div class="">gmsh.model.geo.addPoint(0, .3, 0, lc, 4)</div><div class="">gmsh.model.geo.addLine(1, 2, 1)</div><div class="">gmsh.model.geo.addLine(3, 2, 2)</div><div class="">gmsh.model.geo.addLine(3, 4, 3)</div><div class="">gmsh.model.geo.addLine(4, 1, 4)</div><div class="">gmsh.model.geo.addCurveLoop([4, 1, -2, 3], 1)</div><div class="">gmsh.model.geo.addPlaneSurface([1], 1)</div><div class="">gmsh.model.addPhysicalGroup(2, [1], 1)</div><div class="">gmsh.model.setPhysicalName(2, 1, "My surface")</div><div class="">gmsh.model.geo.synchronize()</div><div class="">gmsh.model.mesh.generate(2)</div><div class="">gmsh.write("MyTest.msh")</div><div class="">gmsh.finalize()</div></div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Alejandro</div><div class=""><br class=""></div><div class=""><br class=""></div></div><span id="cid:9025B45E-9736-4A2E-844D-8A1022026F57@home" class=""><MyTest.msh></span>_______________________________________________<br class="">gmsh mailing list<br class=""><a href="mailto:gmsh@onelab.info" class="">gmsh@onelab.info</a><br class=""><a href="http://onelab.info/mailman/listinfo/gmsh" class="">http://onelab.info/mailman/listinfo/gmsh</a><br class=""></div></blockquote></div><br class=""></div></div></div></span><span style="caret-color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px; 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; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""></span><span id="cid:679E7E79-BB39-46E3-AC51-D1E4B4A6B8FD@home"><Screen Shot 2018-05-21 at 5.47.04 PM.png></span></div></blockquote></div><br class=""></body></html>