Skip to content
Snippets Groups Projects
Commit e90033d5 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

optional duplicate node detection

parent e00fbc4a
Branches
Tags
No related merge requests found
// $Id: Read_Mesh.cpp,v 1.19 2001-08-01 16:42:10 geuzaine Exp $ // $Id: Read_Mesh.cpp,v 1.20 2001-08-02 07:26:51 geuzaine Exp $
#include "Gmsh.h" #include "Gmsh.h"
#include "Geo.h" #include "Geo.h"
...@@ -78,11 +78,21 @@ void Read_Mesh_MSH (Mesh *M, FILE *File_GEO){ ...@@ -78,11 +78,21 @@ void Read_Mesh_MSH (Mesh *M, FILE *File_GEO){
fscanf(File_GEO, "%d", &Nbr_Nodes) ; fscanf(File_GEO, "%d", &Nbr_Nodes) ;
Msg(INFO, "%d Nodes", Nbr_Nodes); Msg(INFO, "%d Nodes", Nbr_Nodes);
//#define SEARCH_DUPLICATES
#ifdef SEARCH_DUPLICATES
Tree_T *Duplis = Tree_Create (sizeof (Vertex *), comparePosition);
#endif
for (i_Node = 0 ; i_Node < Nbr_Nodes ; i_Node++) { for (i_Node = 0 ; i_Node < Nbr_Nodes ; i_Node++) {
fscanf(File_GEO, "%d %lf %lf %lf", &Num, &x, &y, &z) ; fscanf(File_GEO, "%d %lf %lf %lf", &Num, &x, &y, &z) ;
vert = Create_Vertex (Num, x, y, z, 1.0 ,0.0); vert = Create_Vertex (Num, x, y, z, 1.0 ,0.0);
Tree_Replace(M->Vertices, &vert); Tree_Replace(M->Vertices, &vert);
#ifdef SEARCH_DUPLICATES
if(Tree_Replace(Duplis, &vert)) Msg(WARNING, "Node %g %g %g already exsists");
#endif
} }
#ifdef SEARCH_DUPLICATES
Tree_Delete(Duplis);
#endif
} }
/* ELEMENTS */ /* ELEMENTS */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment