diff --git a/Mesh/Read_Mesh.cpp b/Mesh/Read_Mesh.cpp index b89df5350dca81ea70aba0de386f3ae9e6620b03..4f83b8617bb27571910f97746e9a5b37ec1f3691 100644 --- a/Mesh/Read_Mesh.cpp +++ b/Mesh/Read_Mesh.cpp @@ -1,4 +1,4 @@ -// $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); diff --git a/Mesh/Simplex.cpp b/Mesh/Simplex.cpp index f819d0dfa046bac0d76b73587af72681132248d3..8d8c5783421e590e59c689fcf0112afbc5ef58d3 100644 --- a/Mesh/Simplex.cpp +++ b/Mesh/Simplex.cpp @@ -1,4 +1,4 @@ -// $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; } diff --git a/Mesh/Simplex.h b/Mesh/Simplex.h index 167e4ba8147cfdc55f5130efa82234b49b0a53a3..bc7baa00dcb744147094de2bd515c6ac4e6c2836 100644 --- a/Mesh/Simplex.h +++ b/Mesh/Simplex.h @@ -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);