<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#006fc9;font-family:Georgia,serif;" dir="ltr">
<p>Dear all,</p>
<p><br>
</p>
<p>I am using gmsh API to create a simple second order 2D mesh. The simplified codes are </p>
<p><br>
</p>
<p> </p>
<div>#include <stdio.h></div>
<div>#include "Gmsh.h"</div>
<div>#include "GModel.h"</div>
<div><br>
</div>
<div>int main(int argc, char **argv)</div>
<div>{</div>
<div> GmshInitialize(0, 0);</div>
<div> GModel *m = new GModel();</div>
<div><br>
</div>
<div> m->setFactory("Gmsh");</div>
<div><br>
</div>
<div> GVertex *v1 = m->addVertex(0, 1, 0, 0.1);</div>
<div> GVertex *v2 = m->addVertex(0, 2, 0, 0.1);</div>
<div> GVertex *v3 = m->addVertex(0, 3, 0, 0.1);</div>
<div> GVertex *v4 = m->addVertex(1, 3, 0, 0.1);</div>
<div> GVertex *v5 = m->addVertex(1, 2, 0, 0.1);</div>
<div> GVertex *v6 = m->addVertex(1, 1, 0, 0.1);</div>
<div> </div>
<div> std::vector<GEdge*> edges1;</div>
<div> edges1.push_back(m->addLine(v1, v2));</div>
<div> edges1.push_back(m->addLine(v2, v5));</div>
<div> edges1.push_back(m->addLine(v5, v6));</div>
<div> edges1.push_back(m->addLine(v6, v1));</div>
<div> </div>
<div> std::vector<GEdge*> edges2;</div>
<div> edges2.push_back(m->addLine(v2, v3));</div>
<div> edges2.push_back(m->addLine(v3, v4));</div>
<div> edges2.push_back(m->addLine(v4, v5));</div>
<div> edges2.push_back(m->addLine(v5, v2));</div>
<div><br>
</div>
<div> std::vector<std::vector<GEdge*> > loop1;</div>
<div> loop1.push_back(edges1);</div>
<div> </div>
<div> std::vector<std::vector<GEdge*> > loop2;</div>
<div> loop2.push_back(edges2);</div>
<div> </div>
<div> </div>
<div> GFace *f1 = m->addPlanarFace(loop1);</div>
<div> f1->addPhysicalEntity(1);</div>
<div> GFace *f2 = m->addPlanarFace(loop2);</div>
<div> f2->addPhysicalEntity(2);</div>
<div> </div>
<div> </div>
<div> m->mesh(2);</div>
<div> m->setOrderN(2, 0, 0);</div>
<div> m->writeSC("test.msh");</div>
<div> delete m;</div>
<div> GmshFinalize();</div>
<div>}</div>
<div><br>
</div>
<div>After running the codes, I opened the .msh file with Gmsh. Then, I found there are some repeated nodes at the interface of two surfaces (attachment1). However, if I use gmsh gui to create this model and mesh it, then this issue doesn't exist. Any suggestions
or comments are great appreciate.</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>Thanks</div>
<div>Lambert </div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<p></p>
</div>
</body>
</html>