<div dir="ltr">Hello,<div>I'm having a little trouble using GMSH in a loop. I don't know why, but when I load a .geo file and mesh it, using a background mesh, it works fine for the first time, but when the meshing process happens again, it looks like GMSH still holds some information about the last generated mesh, and the result is very similar to the previous one, when it shouldn't be.</div>
<div><br></div><div>Here's what the code looks like:</div><div><br></div><div>while(...) {</div><div><br></div><div><span style="white-space:pre"> </span>GModel *m = new GModel();</div><div><div><span class="" style="white-space:pre"> </span>m->setAsCurrent();</div>
<div><span class="" style="white-space:pre"> </span>m->readGEO("Geometry");</div><div><span class="" style="white-space:pre"> </span>m->mesh(2);</div><div><span class="" style="white-space:pre"> </span>m->writeMSH("Geometry.msh", 1.0);<span class="" style="white-space:pre"> </span></div>
<div><span class="" style="white-space:pre"> </span>delete m;</div></div><div><br></div><div><span style="white-space:pre"> //...</span><br></div><div><span style="white-space:pre"> //Do some work and modify the background mesh, etc...</span><br>
</div><div><span style="white-space:pre"> //so the next time the generated mesh should be very different from this one</span><span style="white-space:pre"><br></span></div><div><span style="white-space:pre"> //...</span><span style="white-space:pre"><br>
</span></div><div>}</div><div><br></div><div>I suspect that this output has something to do with this result:</div><div><br></div><div><div>Error : 'Geometry', line 2 : Point 162 already exists</div></div><div><div>
Error : 'Geometry', line 3 : Point 48 already exists</div></div><div><div>Error : 'Geometry', line 4 : Point 257 already exists</div><div>Error : 'Geometry', line 5 : Point 260 already exists</div>
</div><div>... (repeat many times)</div><div><br></div><div><br></div><div>Is there a solution for this, or I shouldn't be using GMSH iteratively like this? Is there some kind of turnaround for this (or maybe I'm using gmsh completly wrong...)?</div>
<div><br></div><div>Thanks in advance.</div><div><br></div><div>Regards.</div><div><br></div></div>