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

compatibility fix: numbering of points, etc. with Delete/Coherence

parent c3d16c9e
No related branches found
No related tags found
No related merge requests found
// $Id: CAD.cpp,v 1.33 2001-10-29 08:52:19 geuzaine Exp $ // $Id: CAD.cpp,v 1.34 2001-11-07 07:13:45 geuzaine Exp $
#include "Gmsh.h" #include "Gmsh.h"
#include "Numeric.h" #include "Numeric.h"
...@@ -1203,6 +1203,21 @@ int compareTwoSurfaces (const void *a, const void *b){ ...@@ -1203,6 +1203,21 @@ int compareTwoSurfaces (const void *a, const void *b){
/* Fonction eliminant les doublons dans une /* Fonction eliminant les doublons dans une
geometrie*/ geometrie*/
void MaxNumPoint(void *a, void *b){
Vertex *v = *(Vertex**)a;
THEM->MaxPointNum = MAX(THEM->MaxPointNum,v->Num);
}
void MaxNumCurve(void *a, void *b){
Curve *c = *(Curve**)a;
THEM->MaxLineNum = MAX(THEM->MaxLineNum,c->Num);
}
void MaxNumSurface(void *a, void *b){
Surface *s = *(Surface**)a;
THEM->MaxSurfaceNum = MAX(THEM->MaxSurfaceNum,s->Num);
}
void Coherence_PS(void){ void Coherence_PS(void){
ReplaceAllDuplicates (THEM); ReplaceAllDuplicates (THEM);
} }
...@@ -1239,8 +1254,12 @@ void ReplaceAllDuplicates ( Mesh *m ){ ...@@ -1239,8 +1254,12 @@ void ReplaceAllDuplicates ( Mesh *m ){
List_Delete(All); List_Delete(All);
end = Tree_Nbr(m->Points); end = Tree_Nbr(m->Points);
if(start-end) Msg(DEBUG, "Removed %d duplicate points", start-end); if(start-end) Msg(DEBUG, "Removed %d duplicate points", start-end);
if(CTX.geom.old_newreg){
m->MaxPointNum=0;
Tree_Action(m->Points,MaxNumPoint);
Tree_Action(m->Vertices,MaxNumPoint);
}
/* Replace old points in curves */ /* Replace old points in curves */
...@@ -1307,6 +1326,10 @@ void ReplaceAllDuplicates ( Mesh *m ){ ...@@ -1307,6 +1326,10 @@ void ReplaceAllDuplicates ( Mesh *m ){
end = Tree_Nbr(m->Curves); end = Tree_Nbr(m->Curves);
if(start-end) Msg(DEBUG, "Removed %d duplicate curves", start-end); if(start-end) Msg(DEBUG, "Removed %d duplicate curves", start-end);
if(CTX.geom.old_newreg){
m->MaxLineNum=0;
Tree_Action(m->Curves,MaxNumCurve);
}
/* Replace old curves in surfaces */ /* Replace old curves in surfaces */
...@@ -1345,6 +1368,10 @@ void ReplaceAllDuplicates ( Mesh *m ){ ...@@ -1345,6 +1368,10 @@ void ReplaceAllDuplicates ( Mesh *m ){
end = Tree_Nbr(m->Surfaces); end = Tree_Nbr(m->Surfaces);
if(start-end) Msg(DEBUG, "Removed %d duplicate surfaces", start-end); if(start-end) Msg(DEBUG, "Removed %d duplicate surfaces", start-end);
if(CTX.geom.old_newreg){
m->MaxSurfaceNum=0;
Tree_Action(m->Surfaces,MaxNumSurface);
}
/* Replace old surfaces in volumes */ /* Replace old surfaces in volumes */
...@@ -1522,6 +1549,7 @@ void DeletePoint(int ip){ ...@@ -1522,6 +1549,7 @@ void DeletePoint(int ip){
} }
} }
List_Delete(Curves); List_Delete(Curves);
if(v->Num == THEM->MaxPointNum) THEM->MaxPointNum--;
Tree_Suppress(THEM->Points,&v); Tree_Suppress(THEM->Points,&v);
} }
...@@ -1537,6 +1565,7 @@ void DeleteCurve(int ip){ ...@@ -1537,6 +1565,7 @@ void DeleteCurve(int ip){
} }
} }
List_Delete(Surfs); List_Delete(Surfs);
if(c->Num == THEM->MaxLineNum) THEM->MaxLineNum--;
Tree_Suppress(THEM->Curves,&c); Tree_Suppress(THEM->Curves,&c);
} }
...@@ -1555,12 +1584,11 @@ void DeleteSurf( int is ){ ...@@ -1555,12 +1584,11 @@ void DeleteSurf( int is ){
} }
} }
List_Delete(Vols); List_Delete(Vols);
if(s->Num == THEM->MaxSurfaceNum) THEM->MaxSurfaceNum--;
//s->Num = 1000000000; //s->Num = 1000000000;
Tree_Suppress(THEM->Surfaces,&s); Tree_Suppress(THEM->Surfaces,&s);
} }
void DeleteLine(int ip, int i){DeleteCurve(ip);}
void DeleteShape(int Type, int Num){ void DeleteShape(int Type, int Num){
switch(Type){ switch(Type){
......
...@@ -52,7 +52,7 @@ Extrude Surface { 11, {0, 0, h} } ; ...@@ -52,7 +52,7 @@ Extrude Surface { 11, {0, 0, h} } ;
// manually a characteristic length for some of the automatically // manually a characteristic length for some of the automatically
// created points: // created points:
Characteristic Length{6,2,52,3,16,12} = lc * 2 ; Characteristic Length{6,22,2,3,16,12} = lc * 2 ;
// If the transformation tools are handy to create complex geometries, // If the transformation tools are handy to create complex geometries,
// it is sometimes useful to generate the flat geometry, consisting // it is sometimes useful to generate the flat geometry, consisting
......
...@@ -2,7 +2,7 @@ Summary: A 3D mesh generator with pre- and post-processing facilities ...@@ -2,7 +2,7 @@ Summary: A 3D mesh generator with pre- and post-processing facilities
Name: gmsh Name: gmsh
Version: 1.28 Version: 1.28
Source: gmsh-1.28.tar.gz Source: gmsh-1.28.tar.gz
Release: 1 Release: 2
Copyright: distributable Copyright: distributable
Group: Applications/Engineering Group: Applications/Engineering
URL: http://www.geuz.org/gmsh/ URL: http://www.geuz.org/gmsh/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment