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

optimize netgen mesh import (much much faster now for large meshes)
parent 0b1705b7
No related branches found
No related tags found
No related merge requests found
// $Id: 3D_Mesh_Netgen.cpp,v 1.3 2004-06-27 00:20:25 geuzaine Exp $ // $Id: 3D_Mesh_Netgen.cpp,v 1.4 2004-06-28 00:56:07 geuzaine Exp $
// //
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
// //
...@@ -76,17 +76,15 @@ Netgen::Netgen(Volume *vol, int importVolumeMesh) ...@@ -76,17 +76,15 @@ Netgen::Netgen(Volume *vol, int importVolumeMesh)
_vertices = Tree2List(_vol->Vertices); _vertices = Tree2List(_vol->Vertices);
} }
else{ else{
// Transfert all surface vertices we must *not* add 2 times the // Transfer all surface vertices we must *not* add 2 times the
// same vertex (the same vertex can belong to several surfaces) // same vertex (the same vertex can belong to several surfaces)
_vertices = List_Create(100, 100, sizeof(Vertex*)); Tree_T *tree = Tree_Create(sizeof(Vertex*), compareVertex);
for(int i = 0; i < List_Nbr(_vol->Surfaces); i++) { for(int i = 0; i < List_Nbr(_vol->Surfaces); i++) {
Surface *s; Surface *s;
List_Read(_vol->Surfaces, i, &s); List_Read(_vol->Surfaces, i, &s);
List_T *vlist = Tree2List(s->Vertices); Tree_Unit(tree, s->Vertices);
for(int j = 0; j < List_Nbr(vlist); j++)
List_Insert(_vertices, List_Pointer(vlist, j), compareVertex);
List_Delete(vlist);
} }
_vertices = Tree2List(tree);
} }
List_Sort(_vertices, compareVertex); List_Sort(_vertices, compareVertex);
......
\input texinfo.tex @c -*-texinfo-*- \input texinfo.tex @c -*-texinfo-*-
@c $Id: gmsh.texi,v 1.120 2004-06-21 20:53:38 geuzaine Exp $ @c $Id: gmsh.texi,v 1.121 2004-06-28 00:56:07 geuzaine Exp $
@c @c
@c Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle @c Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
@c @c
...@@ -725,7 +725,9 @@ To see the practical use of such expressions, have a look at the first ...@@ -725,7 +725,9 @@ To see the practical use of such expressions, have a look at the first
couple of examples in @ref{Tutorial}. Note that, in order to lighten the couple of examples in @ref{Tutorial}. Note that, in order to lighten the
syntax, you can always omit the braces @code{@{@}} enclosing an syntax, you can always omit the braces @code{@{@}} enclosing an
@var{expression-list} if this @var{expression-list} only contains a single @var{expression-list} if this @var{expression-list} only contains a single
item. item. Also note that a braced @var{expression-list} can be preceded by a
minus sign in order to change the sign of all the
@var{expression-list-item}s.
@c ......................................................................... @c .........................................................................
@c Character expressions @c Character expressions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment