diff --git a/Mesh/1D_Mesh.cpp b/Mesh/1D_Mesh.cpp index 201bc5f201392ad8a76b70ec55db9aa5bc523ade..8dc909a503b4b9c7e2bc0ccda03363646b06f801 100644 --- a/Mesh/1D_Mesh.cpp +++ b/Mesh/1D_Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: 1D_Mesh.cpp,v 1.26 2002-05-18 07:56:49 geuzaine Exp $ +// $Id: 1D_Mesh.cpp,v 1.27 2002-05-20 02:15:36 geuzaine Exp $ // // Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle // @@ -27,7 +27,7 @@ extern Mesh *THEM; extern Context_T CTX; -Curve *THEC; +static Curve *THEC=NULL; // ipar[0] = nbpoints // abs(ipar[1]) = method @@ -115,7 +115,7 @@ double F_Lc (double t){ } void Maillage_Curve (void *data, void *dummy){ - Curve **pc, *c; + Curve *c; Simplex *s; double b, a, d, dt, dp, t; int i, N, count, NUMP; @@ -123,9 +123,7 @@ void Maillage_Curve (void *data, void *dummy){ List_T *Points; IntPoint P1, P2; - pc = (Curve **) data; - c = *pc; - THEC = c; + THEC = c = *(Curve **) data; if (c->Num < 0) return; diff --git a/Mesh/2D_Cylindrical.cpp b/Mesh/2D_Cylindrical.cpp index 4458696e28eab9c9725f08fbe209260f23231287..72150841cd1d2289b994e2686910bbcbf2f4e558 100644 --- a/Mesh/2D_Cylindrical.cpp +++ b/Mesh/2D_Cylindrical.cpp @@ -1,4 +1,4 @@ -// $Id: 2D_Cylindrical.cpp,v 1.10 2002-05-18 07:56:49 geuzaine Exp $ +// $Id: 2D_Cylindrical.cpp,v 1.11 2002-05-20 02:15:36 geuzaine Exp $ // // Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle // @@ -25,20 +25,20 @@ extern Mesh *THEM; extern Context_T CTX; static Surface *SURF; -double TETAMIN, TETAMAX, TETAFABSMIN; +static double THETAMIN, THETAMAX; void ChangePi (void *a, void *dum){ Vertex *v; v = *(Vertex **) a; - if ((v->Pos.X / SURF->Cyl.radius1) >= TETAMIN + .99999 * Pi){ + if ((v->Pos.X / SURF->Cyl.radius1) >= THETAMIN + .99999 * Pi){ Msg(INFO, "%g -> ", v->Pos.X / SURF->Cyl.radius1); v->Pos.X -= (2. * Pi) * SURF->Cyl.radius1; Msg(INFO, "%g -> ", v->Pos.X / SURF->Cyl.radius1); } } -void TETAMINMAX (void *a, void *dum){ +void THETAMINMAX (void *a, void *dum){ Vertex *v; double ZRepere, S, C, y[3], teta; double p[3], z[3], x[3], o[3]; @@ -70,8 +70,8 @@ void TETAMINMAX (void *a, void *dum){ prosca (o, x, &C); prosca (o, y, &S); teta = atan2 (S, C); - TETAMIN = DMIN (teta, TETAMIN); - TETAMAX = DMAX (teta, TETAMAX); + THETAMIN = DMIN (teta, THETAMIN); + THETAMAX = DMAX (teta, THETAMAX); } // Cylindrical surfaces @@ -182,7 +182,7 @@ void XYZtoCone (void *a, void *dum){ prosca (o, x, &C); prosca (o, y, &S); teta = atan2 (S, C); - if (teta >= TETAMIN + .99999 * Pi) + if (teta >= THETAMIN + .99999 * Pi) teta -= (2. * Pi); inclinaison = Pi * SURF->Cyl.radius2 / 180.; @@ -266,9 +266,9 @@ int MeshCylindricalSurface (Surface * s){ Tree_Insert (s->Vertices, List_Pointer (pC->Vertices, j)); } } - TETAMIN = 2. * Pi; - TETAMAX = -2. * Pi; - Tree_Action (s->Vertices, TETAMINMAX); + THETAMIN = 2. * Pi; + THETAMAX = -2. * Pi; + Tree_Action (s->Vertices, THETAMINMAX); Tree_Action (s->Vertices, Freeze_Vertex); if (s->Typ == MSH_SURF_CYLNDR) @@ -276,9 +276,9 @@ int MeshCylindricalSurface (Surface * s){ else if (s->Typ == MSH_SURF_CONE) Tree_Action (s->Vertices, XYZtoCone); - Msg(DEBUG, "%12.5E %12.5E", TETAMAX, TETAMIN); + Msg(DEBUG, "%12.5E %12.5E", THETAMAX, THETAMIN); - if ((s->Typ == MSH_SURF_CYLNDR) && (TETAMAX - TETAMIN > Pi * 1.01)) + if ((s->Typ == MSH_SURF_CYLNDR) && (THETAMAX - THETAMIN > Pi * 1.01)) Tree_Action (s->Vertices, ChangePi); ori = Calcule_Contours (s); diff --git a/Mesh/2D_DivAndConq.cpp b/Mesh/2D_DivAndConq.cpp index 0e5bdfc752d54d15b76f05d10a07e446911c9706..74ff0147e814b463c3351b28617d2b69ab753a67 100644 --- a/Mesh/2D_DivAndConq.cpp +++ b/Mesh/2D_DivAndConq.cpp @@ -1,4 +1,4 @@ -// $Id: 2D_DivAndConq.cpp,v 1.13 2002-05-18 07:56:49 geuzaine Exp $ +// $Id: 2D_DivAndConq.cpp,v 1.14 2002-05-20 02:15:36 geuzaine Exp $ // // Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle // @@ -41,8 +41,7 @@ extern double LC2D; -PointRecord *pPointArray; -DocPeek gDocTemp; +static PointRecord *pPointArray; int Insert(PointNumero a,PointNumero b); int Delete(PointNumero a,PointNumero b); @@ -339,7 +338,6 @@ int DelaunayAndVoronoi(DocPeek doc){ if (doc->numPoints < 2) return(1); qsort(doc->points,doc->numPoints,sizeof(PointRecord),comparePoints); - gDocTemp = doc; recur_trig(0,doc->numPoints - 1); return 1; diff --git a/Mesh/2D_Elliptic.cpp b/Mesh/2D_Elliptic.cpp index bbb1a824d04f739b8f6be4d03492ebca11de2259..1eb3f2d6f2c00f4168f8d168844934a9ba3371f9 100644 --- a/Mesh/2D_Elliptic.cpp +++ b/Mesh/2D_Elliptic.cpp @@ -1,4 +1,4 @@ -// $Id: 2D_Elliptic.cpp,v 1.10 2002-05-18 07:56:49 geuzaine Exp $ +// $Id: 2D_Elliptic.cpp,v 1.11 2002-05-20 02:15:36 geuzaine Exp $ // // Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle // @@ -54,7 +54,8 @@ int MeshEllipticSurface (Surface * sur){ if (!(S[3] = FindPoint (sur->ipar[3], THEM))) return 0; N1 = N2 = N3 = N4 = 0; - /*Remplissure de la premiere cuvee de merde */ + + // step 1 l1 = List_Create (20, 10, sizeof (Vertex *)); for (i = 0; i < nb; i++){ if (!compareVertex (&GG[i]->beg, &S[0])){ @@ -71,7 +72,8 @@ int MeshEllipticSurface (Surface * sur){ while (compareVertex (&GG[j]->beg, &S[1])); } } - /*Remplissure de la deuxieme cuvee de merde */ + + // step 2 l2 = List_Create (20, 10, sizeof (Vertex *)); for (i = 0; i < nb; i++){ if (!compareVertex (&GG[i]->beg, &S[1])){ @@ -88,7 +90,8 @@ int MeshEllipticSurface (Surface * sur){ while (compareVertex (&GG[j]->beg, &S[2])); } } - /*Remplissure de la TROISIEME cuvee de merde */ + + // step 3 l3 = List_Create (20, 10, sizeof (Vertex *)); for (i = 0; i < nb; i++){ if (!compareVertex (&GG[i]->beg, &S[2])){ @@ -105,7 +108,8 @@ int MeshEllipticSurface (Surface * sur){ while (compareVertex (&GG[j]->beg, &S[3])); } } - /*Remplissure de la quatrieme cuvee de merde */ + + // step 4 l4 = List_Create (20, 10, sizeof (Vertex *)); for (i = 0; i < nb; i++){ if (!compareVertex (&GG[i]->beg, &S[3])){ @@ -122,6 +126,7 @@ int MeshEllipticSurface (Surface * sur){ while (compareVertex (&GG[j]->beg, &S[0])); } } + N1 = List_Nbr (l1); N2 = List_Nbr (l2); N3 = List_Nbr (l3); @@ -134,7 +139,6 @@ int MeshEllipticSurface (Surface * sur){ return 0; } - sur->Nu = N1; sur->Nv = N2; list = (Vertex **) Malloc (N1 * N2 * sizeof (Vertex *)); diff --git a/Mesh/2D_InitMesh.cpp b/Mesh/2D_InitMesh.cpp index d813faf05519d73d4018ecd80bac60cd4a165ec6..8170cc5c6a66468628df4c434de24bcad8b7bf0a 100644 --- a/Mesh/2D_InitMesh.cpp +++ b/Mesh/2D_InitMesh.cpp @@ -1,4 +1,4 @@ -// $Id: 2D_InitMesh.cpp,v 1.13 2002-05-18 07:56:49 geuzaine Exp $ +// $Id: 2D_InitMesh.cpp,v 1.14 2002-05-20 02:15:36 geuzaine Exp $ // // Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle // @@ -75,12 +75,11 @@ #include "Mesh.h" #include "2D_Mesh.h" -static int pointA,pointB,Counter,Stagnant,StopNow; -static Tree_T *ETree=NULL,*EDToSwap=NULL; - extern PointRecord *gPointArray; -int *permut; +static Tree_T *ETree=NULL,*EDToSwap=NULL; +static int pointA,pointB,Counter,Stagnant,StopNow; +static int *permut; typedef struct { int from; diff --git a/Mesh/2D_Parametric.cpp b/Mesh/2D_Parametric.cpp index 5ba14b0f62116dbc4ca16f54a0d71d0972c2ecbe..176fef1f98e557f2100c4bc892f385ff8885d414 100644 --- a/Mesh/2D_Parametric.cpp +++ b/Mesh/2D_Parametric.cpp @@ -1,4 +1,4 @@ -// $Id: 2D_Parametric.cpp,v 1.8 2002-05-18 07:56:50 geuzaine Exp $ +// $Id: 2D_Parametric.cpp,v 1.9 2002-05-20 02:15:36 geuzaine Exp $ // // Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle // @@ -30,6 +30,7 @@ extern Mesh *THEM; extern Context_T CTX; static Surface *SURF; + Surface *PARAMETRIC; /* SURFACES CYLINDRIQUES */ diff --git a/Mesh/2D_Recombine.cpp b/Mesh/2D_Recombine.cpp index 81ad1777aca0e7f71683da243e2697d9035173a5..7b0734a1ef42ed0b40a9d7882fa5e3ac3701da88 100644 --- a/Mesh/2D_Recombine.cpp +++ b/Mesh/2D_Recombine.cpp @@ -1,4 +1,4 @@ -// $Id: 2D_Recombine.cpp,v 1.11 2002-05-18 07:56:50 geuzaine Exp $ +// $Id: 2D_Recombine.cpp,v 1.12 2002-05-20 02:15:36 geuzaine Exp $ // // Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle // @@ -26,10 +26,10 @@ extern Context_T CTX; -Tree_T *RecEdges,*Triangles; -Tree_T *RecSimplex,*TREEELM; -double ALPHA; -int RECNUM; +static Tree_T *RecEdges,*Triangles; +static Tree_T *RecSimplex,*TREEELM; +static double ALPHA; +static int RECNUM; void addTriangles(void *data, void *dum){ Simplex *S; diff --git a/Mesh/2D_Util.cpp b/Mesh/2D_Util.cpp index b9c9238f055b42c6eae46a341b0d1c3d23fa41e8..6dccfbec1a2630e3c31396ba2cbad8231372fa21 100644 --- a/Mesh/2D_Util.cpp +++ b/Mesh/2D_Util.cpp @@ -1,4 +1,4 @@ -// $Id: 2D_Util.cpp,v 1.14 2002-05-18 07:56:50 geuzaine Exp $ +// $Id: 2D_Util.cpp,v 1.15 2002-05-20 02:15:36 geuzaine Exp $ // // Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle // @@ -367,7 +367,6 @@ MPoint Localize (Delaunay * del , DocRecord *MESH) { } -/********************************************************************/ void alloue_Mai_Pts(maillage *mai , int Nballoc , int incrAlloc){ int i; diff --git a/Mesh/Generator.cpp b/Mesh/Generator.cpp index 43f8fcb0eb0f3ca4b124905efa326c8eb46f0165..2eb654c4e813b88fe7ada5f2761a07864611cb13 100644 --- a/Mesh/Generator.cpp +++ b/Mesh/Generator.cpp @@ -1,4 +1,4 @@ -// $Id: Generator.cpp,v 1.34 2002-05-18 07:56:50 geuzaine Exp $ +// $Id: Generator.cpp,v 1.35 2002-05-20 02:15:36 geuzaine Exp $ // // Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle // @@ -26,8 +26,6 @@ extern Mesh *THEM; extern Context_T CTX; -static List_T *Curves; - void GetStatistics (double s[50]){ int i; if(!THEM){ @@ -52,11 +50,13 @@ void ApplyLcFactor_Point(void *a, void *b){ } v->lc *= CTX.mesh.lc_factor; } + void ApplyLcFactor_Attractor(void *a, void *b){ Attractor *v = *(Attractor**)a; v->lc1 *= CTX.mesh.lc_factor; v->lc2 *= CTX.mesh.lc_factor; } + void ApplyLcFactor(Mesh *M){ Tree_Action(M->Points, ApplyLcFactor_Point); List_Action(M->Metric->Attractors, ApplyLcFactor_Attractor); @@ -74,6 +74,7 @@ void Maillage_Dimension_0 (Mesh * M){ // - FUNCTION Create_BgMesh (WITHPOINTS, .2, M); } + void Maillage_Dimension_1 (Mesh * M){ double t1, t2; t1 = Cpu(); @@ -89,9 +90,9 @@ void Maillage_Dimension_2 (Mesh * M){ t1 = Cpu(); - /* maillage 1-D inverses */ + // create reverse 1D meshes - Curves = Tree2List (M->Curves); + List_T *Curves = Tree2List (M->Curves); for (i = 0; i < List_Nbr (Curves); i++){ List_Read (Curves, i, &c); if (c->Num > 0){ @@ -107,6 +108,8 @@ void Maillage_Dimension_2 (Mesh * M){ Msg(DEBUG, "Shortest curve has length %g", shortest); + // mesh 2D + Tree_Action (M->Surfaces, Maillage_Surface); t2 = Cpu(); @@ -136,12 +139,12 @@ void Maillage_Dimension_3 (Mesh * M){ List_Delete (list); Tree_Insert (M->Volumes, &v); - if(CTX.mesh.oldxtrude){//old automatic extrusion algorithm - Extrude_Mesh_Old(M); + if(CTX.mesh.oldxtrude){ + Extrude_Mesh_Old(M); // old automatic extrusion algorithm } else{ - Extrude_Mesh(M->Volumes); - Tree_Action(M->Volumes, Maillage_Volume); + Extrude_Mesh(M->Volumes); // new extrusion + Tree_Action(M->Volumes, Maillage_Volume); // delaunay of remaining parts } t2 = Cpu(); @@ -173,8 +176,7 @@ void Init_Mesh (Mesh * M, int all){ Tree_Delete (M->VertexEdges); } if (M->Simplexes){ - // Tree_Action (M->Simplexes, Free_Simplex); - //produit des crashes innatendus... + // Tree_Action (M->Simplexes, Free_Simplex); //produit des crashes innatendus... // normal, cette memoire est dupliquee // dans les volumes. Je crois qu'on a besoin // des 2, ce truc ne provoque pas de leaks. @@ -201,7 +203,7 @@ void Init_Mesh (Mesh * M, int all){ Tree_Delete (M->Surfaces); } if (M->Volumes){ - Tree_Action (M->Volumes, Free_Volume);//produit des crashes innatendus... + Tree_Action (M->Volumes, Free_Volume); //produit des crashes innatendus... Tree_Delete (M->Volumes); } if (M->PhysicalGroups){ @@ -243,7 +245,7 @@ void mai3d (Mesh * M, int Asked){ oldstatus = M->status; - /* initialisations - Maillage 0-D */ + // re-read data if ((Asked > oldstatus && Asked >= 0 && oldstatus < 0) || (Asked < oldstatus)){ @@ -253,7 +255,7 @@ void mai3d (Mesh * M, int Asked){ CTX.threads_lock = 1 ; - /* Maillage 1-D */ + // 1D mesh if ((Asked > oldstatus && Asked > 0 && oldstatus < 1) || (Asked < oldstatus && Asked > 0)){ @@ -271,7 +273,7 @@ void mai3d (Mesh * M, int Asked){ M->status = 1; } - /* Maillage 2-D */ + // 2D mesh if ((Asked > oldstatus && Asked > 1 && oldstatus < 2) || (Asked < oldstatus && Asked > 1)){ @@ -290,7 +292,7 @@ void mai3d (Mesh * M, int Asked){ M->status = 2; } - /* Maillage 3-D */ + // 3D mesh if ((Asked > oldstatus && Asked > 2 && oldstatus < 3) || (Asked < oldstatus && Asked > 2)){