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

New "fast" routine to create simplices used only for
visualization. This speeds up the load time of large tetrahedral
(volume) meshes by roughly 50%, and brings Read_Mesh.cpp pretty close
to mshsort.cpp performance-wise. Since Read_Mesh does many more things
(all the Tree/List queries to create elementary/physical entites +
partitions), this is actually pretty good.

Loading a 1.4 million tets mesh file on my 1.5 GHz Linux machine now
takes about 17 seconds.
parent e66bc1a0
No related branches found
No related tags found
No related merge requests found
// $Id: Read_Mesh.cpp,v 1.78 2004-10-08 02:41:20 geuzaine Exp $
// $Id: Read_Mesh.cpp,v 1.79 2004-11-18 23:42:19 geuzaine Exp $
//
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
//
......@@ -306,7 +306,7 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
case LGN2:
c = addElementaryCurve(M, abs(Elementary));
addPhysicalGroup(M, MSH_PHYSICAL_LINE, Physical, abs(Elementary));
simp = Create_Simplex(vertsp[0], vertsp[1], NULL, NULL);
simp = Create_Simplex_Fast(vertsp[0], vertsp[1], NULL, NULL);
simp->Num = Num;
simp->iEnt = Elementary;
simp->iPart = Add_MeshPartition(Partition, M);
......@@ -324,7 +324,7 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
case TRI2:
s = addElementarySurface(M, Elementary);
addPhysicalGroup(M, MSH_PHYSICAL_SURFACE, Physical, Elementary);
simp = Create_Simplex(vertsp[0], vertsp[1], vertsp[2], NULL);
simp = Create_Simplex_Fast(vertsp[0], vertsp[1], vertsp[2], NULL);
simp->Num = Num;
simp->iEnt = Elementary;
simp->iPart = Add_MeshPartition(Partition, M);
......@@ -364,7 +364,7 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
case TET2:
v = addElementaryVolume(M, Elementary);
addPhysicalGroup(M, MSH_PHYSICAL_VOLUME, Physical, Elementary);
simp = Create_Simplex(vertsp[0], vertsp[1], vertsp[2], vertsp[3]);
simp = Create_Simplex_Fast(vertsp[0], vertsp[1], vertsp[2], vertsp[3]);
simp->Num = Num;
simp->iEnt = Elementary;
simp->iPart = Add_MeshPartition(Partition, M);
......
// $Id: Simplex.cpp,v 1.34 2004-07-21 22:19:56 geuzaine Exp $
// $Id: Simplex.cpp,v 1.35 2004-11-18 23:42:19 geuzaine Exp $
//
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
//
......@@ -357,9 +357,18 @@ void Simplex::Fourre_Simplexe(Vertex * v1, Vertex * v2, Vertex * v3,
Simplex *Create_Simplex(Vertex * v1, Vertex * v2, Vertex * v3, Vertex * v4)
{
Simplex *s;
return new Simplex(v1, v2, v3, v4);
}
s = new Simplex(v1, v2, v3, v4);
Simplex *Create_Simplex_Fast(Vertex * v1, Vertex * v2, Vertex * v3, Vertex * v4)
{
// bypasses Fourre_Simplex (use for visualization only!)
Simplex *s = new Simplex();
s->V[0] = v1;
s->V[1] = v2;
s->V[2] = v3;
s->V[3] = v4;
s->VSUP = NULL;
return s;
}
......
......@@ -68,6 +68,7 @@ int compareSimplex(const void *a, const void *b);
int compareFace (const void *a, const void *b);
Simplex *Create_Simplex (Vertex *v1, Vertex *v2, Vertex *v3, Vertex *v4);
Simplex *Create_Simplex_Fast (Vertex *v1, Vertex *v2, Vertex *v3, Vertex *v4);
void Free_Simplex (void *a, void *b);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment