From e6d55e756c58774d708fb1c8d8109107d7a47dcc Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Tue, 28 Nov 2000 17:18:34 +0000 Subject: [PATCH] *** empty log message *** --- Geo/Geo.cpp | 4 ++-- Mesh/2D_Mesh.cpp | 8 +++++--- Mesh/3D_Mesh.cpp | 28 ++++++++++++++++------------ Mesh/Simplex.cpp | 8 +++++--- demos/demo-10.geo | 16 ++++++++++------ 5 files changed, 38 insertions(+), 26 deletions(-) diff --git a/Geo/Geo.cpp b/Geo/Geo.cpp index dee690c8ea..d58e939da0 100644 --- a/Geo/Geo.cpp +++ b/Geo/Geo.cpp @@ -1,4 +1,4 @@ -/* $Id: Geo.cpp,v 1.5 2000-11-28 14:42:42 geuzaine Exp $ */ +/* $Id: Geo.cpp,v 1.6 2000-11-28 17:18:30 geuzaine Exp $ */ #include "Gmsh.h" #include "Const.h" @@ -394,7 +394,7 @@ void add_multvol(List_T *list, char *fich){ if((i= recognize_zone(MSH_VOLUME,list)))return; - sprintf(text,"Complex Volume(%d) = {",NEWREG()); + sprintf(text,"Volume(%d) = {",NEWREG()); for(i=0;i<List_Nbr(list);i++){ List_Read(list,i,&seg); if(i != List_Nbr(list)-1) diff --git a/Mesh/2D_Mesh.cpp b/Mesh/2D_Mesh.cpp index e5cb6f0039..0544552ddb 100644 --- a/Mesh/2D_Mesh.cpp +++ b/Mesh/2D_Mesh.cpp @@ -1,4 +1,4 @@ -/* $Id: 2D_Mesh.cpp,v 1.8 2000-11-26 18:43:48 geuzaine Exp $ */ +/* $Id: 2D_Mesh.cpp,v 1.9 2000-11-28 17:18:33 geuzaine Exp $ */ /* Maillage Delaunay d'une surface (Point insertion Technique) @@ -868,8 +868,10 @@ void Maillage_Automatique_VieuxCode (Surface * pS, Mesh * m, int ori){ cp->oriented_points[j].where.h = v->Pos.X; cp->oriented_points[j].where.v = v->Pos.Y; - cp->perturbations[j].h = CTX.mesh.rand_factor * LC2D * rand()/RAND_MAX; - cp->perturbations[j].v = CTX.mesh.rand_factor * LC2D * rand()/RAND_MAX; + cp->perturbations[j].h = CTX.mesh.rand_factor * LC2D * + (double)rand()/(double)RAND_MAX; + cp->perturbations[j].v = CTX.mesh.rand_factor * LC2D * + (double)rand()/(double)RAND_MAX; cp->oriented_points[j].numcontour = i; cp->oriented_points[j].quality = v->lc; diff --git a/Mesh/3D_Mesh.cpp b/Mesh/3D_Mesh.cpp index 6fd0ba042c..417c737d3e 100644 --- a/Mesh/3D_Mesh.cpp +++ b/Mesh/3D_Mesh.cpp @@ -1,4 +1,4 @@ -/* $Id: 3D_Mesh.cpp,v 1.9 2000-11-28 12:59:24 geuzaine Exp $ */ +/* $Id: 3D_Mesh.cpp,v 1.10 2000-11-28 17:18:33 geuzaine Exp $ */ /* J-F Remacle 1995 @@ -158,7 +158,7 @@ int Pt_In_Circum (Simplex * s, Vertex * v){ eps = fabs (d1 - d2) / (d1 + d2); if (eps < 1.e-12){ - return (1); + return (0); // return 1 ? 0 ? } if (d2 < d1) @@ -535,7 +535,7 @@ bool Bowyer_Watson (Mesh * m, Vertex * v, Simplex * S, int force){ List_Reset (Simplexes_New); Tree_Delete (Sim_Sur_Le_Bord); Tree_Delete (Tsd); - printf(" Aie Aie Aie volume changed %g -> %g\n",volumeold,volumenew); + //printf(" Aie Aie Aie volume changed %g -> %g\n",volumeold,volumenew); return false; } } @@ -566,7 +566,8 @@ bool Bowyer_Watson (Mesh * m, Vertex * v, Simplex * S, int force){ } double rand_sign(){ - return (rand()/RAND_MAX < 0.5)?-1.0:1.0; + double d = ((double)rand()/(double)RAND_MAX) ; + return (d < 0.5)?-1.0:1.0; } void Convex_Hull_Mesh (List_T * Points, Mesh * m){ @@ -606,20 +607,23 @@ void Convex_Hull_Mesh (List_T * Points, Mesh * m){ if (!THES){ Msg(WARNING, "Vertex (%g,%g,%g) in no Simplex", THEV->Pos.X,THEV->Pos.Y,THEV->Pos.Z); - THEV->Pos.X += 10 * CTX.mesh.rand_factor * LC3D * rand()/RAND_MAX; - THEV->Pos.Y += 10 * CTX.mesh.rand_factor * LC3D * rand()/RAND_MAX; - THEV->Pos.Z += 10 * CTX.mesh.rand_factor * LC3D * rand()/RAND_MAX; + THEV->Pos.X += 10 * CTX.mesh.rand_factor * LC3D * (double)rand()/(double)RAND_MAX; + THEV->Pos.Y += 10 * CTX.mesh.rand_factor * LC3D * (double)rand()/(double)RAND_MAX; + THEV->Pos.Z += 10 * CTX.mesh.rand_factor * LC3D * (double)rand()/(double)RAND_MAX; Tree_Action (m->Simplexes, Action_First_Simplexes); } bool ca_marche = Bowyer_Watson (m, THEV, THES, 1); int count = 0; while(!ca_marche){ - Msg(INFOS, "Unable to Add Point %d (%g,%g,%g)", - THEV->Num, THEV->Pos.X,THEV->Pos.Y,THEV->Pos.Z ); + //Msg(INFOS, "Unable to Add Point %d (%g,%g,%g)", + // THEV->Num, THEV->Pos.X,THEV->Pos.Y,THEV->Pos.Z ); count ++; - double dx = rand_sign() * 10 * CTX.mesh.rand_factor * LC3D * rand()/RAND_MAX; - double dy = rand_sign() * 10 * CTX.mesh.rand_factor * LC3D * rand()/RAND_MAX; - double dz = rand_sign() * 10 * CTX.mesh.rand_factor * LC3D * rand()/RAND_MAX; + double dx = rand_sign() * 1000 * CTX.mesh.rand_factor * LC3D * + (double)rand()/(double)RAND_MAX; + double dy = rand_sign() * 1000 * CTX.mesh.rand_factor * LC3D * + (double)rand()/(double)RAND_MAX; + double dz = rand_sign() * 1000 * CTX.mesh.rand_factor * LC3D * + (double)rand()/(double)RAND_MAX; THEV->Pos.X += dx; THEV->Pos.Y += dy; THEV->Pos.Z += dz; diff --git a/Mesh/Simplex.cpp b/Mesh/Simplex.cpp index c95ebb9264..863798ff44 100644 --- a/Mesh/Simplex.cpp +++ b/Mesh/Simplex.cpp @@ -1,4 +1,4 @@ -/* $Id: Simplex.cpp,v 1.8 2000-11-28 12:59:24 geuzaine Exp $ */ +/* $Id: Simplex.cpp,v 1.9 2000-11-28 17:18:33 geuzaine Exp $ */ #include "Gmsh.h" #include "Const.h" @@ -120,7 +120,7 @@ int Simplex::Pt_In_Ellipsis (Vertex * v, double Metric[3][3]){ eps = fabs (d1 - d2) / (d1 + d2); if (eps < 1.e-12) { - return (1); + return (1); // Ou Zero ??? } if (d2 < d1) return 1; @@ -162,7 +162,9 @@ void Simplex::center_tet (double X[4], double Y[4], double Z[4], double res[3]){ mat[2][2] = Z[3] - Z[2]; if (!sys3x3 (mat, b, res, &dum)){ - Msg(WARNING, "Coplanar Points in CircumCircle"); + Msg(WARNING, "Coplanar Points in Circum Sphere"); + Msg(WARNING, "(%g,%g,%g) (%g,%g,%g) (%g,%g,%g) (%g,%g,%g)", + X[0],Y[0],Z[0], X[1],Y[1],Z[1], X[2],Y[2],Z[2], X[3],Y[3],Z[3] ); res[0] = res[1] = res[2] = 10.0e10; } diff --git a/demos/demo-10.geo b/demos/demo-10.geo index 2bf456b0cd..9c17fefedf 100644 --- a/demos/demo-10.geo +++ b/demos/demo-10.geo @@ -111,15 +111,19 @@ Circle(42) = {126,1,120}; Circle(43) = {120,1,124}; Line Loop(44) = {36,37,38,39}; -Plane Surface(45) = {44}; Line Loop(46) = {43,40,41,42}; -Plane Surface(47) = {46,44}; Line Loop(48) = {-26,-25,29,30,28,27,35,-20,-19,23,24,22,21,34, -14,-13,17,18,16,15,33,-8,-7,11,12,10,9,32,-2, -1,5,6,4,3,31}; Plane Surface(49) = {48,46}; -Extrude Surface {45, {0,0,0.2}}; -Coherence; -Surface Loop(72) = {45,58,62,66,70,71}; -Complex Volume(73) = {72}; +//Extrude Surface {45, {0,0,0.2}}; +//Surface Loop(72) = {45,58,62,66,70,71}; +//Volume(73) = {72}; + +Extrude Surface {49, {0,0,0.2}}; + +Surface Loop(247) = {246,93,49,97,101,105,109,113,117,121,125,129,133, + 137,141,145,149,153,157,161,165,169,173,177,181,185,189,193,197, + 201,205,209,213,217,221,225,229,233,237,241,245}; +Volume(248) = {247}; -- GitLab