<div>Dear Gmsh User,</div>
<div> </div>
<div>I cloud compile and link mainSimple.cpp using the MVC 2008 after some troubles.</div>
<div> </div>
<div>I could get the test.msh(3D Tetra mesh) using the T5.geo after the run mainSimple.exe.</div>
<div> </div>
<div>I know the operation to excute "Optimize" or Optimize_Tetgen" in Gmsh Windows menu.</div>
<div> </div>
<div>
<div>But, I would like to know how to write the program to optimize 3D Tetra mesh in the programming.</div></div>
<div> </div>
<div>mainSimple.cpp is shown under.</div>
<div> </div>
<div>Please let me know if some one know.</div>
<div> </div>
<div> </div>
<div> </div>
<div>#include <stdio.h><br>#include "Gmsh.h"<br>#include "GModel.h"<br>#include "MElement.h"</div>
<p>int main(int argc, char **argv)<br>{<br> GmshInitialize(argc, argv);<br> //GmshSetOption("Mesh", "Algorithm", 5);<br> GModel *m = new GModel();<br> m->readGEO("../../tutorial/t5.geo");<br>
//GmshMergeFile("../../tutorial/t5.geo"); // will also set the bbox<br> m->mesh(3);<br> for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); ++it){<br> GRegion *r = *it;<br> printf("volume %d contains %d elements:\n", r->tag(), r->getNumMeshElements());<br>
for(unsigned int i = 0; i < r->getNumMeshElements(); i++)<br> printf(" %d", r->getMeshElement(i)->getNum());<br> printf("\n");<br> }<br> m->writeMSH("test.msh");<br>
m->writeUNV("test.unv");<br> delete m;<br> GmshFinalize();<br>}<br></p>