[Gmsh] Doubts about Merge files

Bruno Correia da Silva bcs2 at cin.ufpe.br
Tue Mar 26 21:25:07 CET 2013


Hi everyone,

 I am using of GMSH  to make merge in meshes.
 I did this cpp:


#include <stdio.h>
#include "Gmsh.h"
#include "GModel.h"
#include "MElement.h"

#include <iostream>
using namespace std;
#include <stdio.h>
#include <string.h>

int main(int argc, char **argv)
{
  GmshInitialize(argc, argv);
  if(argc ==1){
       	GmshSetOption("General", "Terminal", 1.);
        char str[80];
        strcpy (str,argv[1]);
        strcat (str,".msh");
       	GModel *m = new GModel();
        m->readGEO(argv[1]);
        m->mesh(3);
        m->writeMSH(str, 1.0);
        delete m;
  }
  else if (argc >2){
    GmshSetOption("General", "Terminal", 1.);
    GModel *m = new GModel();
    m->readMSH(argv[1]);//mesh1.msh
    GmshMergeFile(argv[2]);//mesh2.msh
    m->writeMSH("test.msh", 1.0);
    delete m;
  }
  GmshFinalize();
}

The GMSH show me this error when i try open the test.msh:
Error  Wrong vertex index 0
Error Error loading 'test.msh'

The two input files are attached.

Some clues to correct this?

att.
Bruno Correia
-------------- next part --------------
A non-text attachment was scrubbed...
Name: M1.msh
Type: model/mesh
Size: 5746 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20130326/76597834/attachment.msh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: M2.msh
Type: model/mesh
Size: 5747 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20130326/76597834/attachment-0001.msh>