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

*** empty log message ***

parent d7ad3f68
No related branches found
No related tags found
No related merge requests found
/* $Id: 1D_Mesh.cpp,v 1.6 2000-11-26 15:43:46 geuzaine Exp $ */
/* $Id: 1D_Mesh.cpp,v 1.7 2000-11-28 11:28:31 geuzaine Exp $ */
#include "Gmsh.h"
#include "Const.h"
......@@ -14,6 +14,11 @@ extern int CurrentNodeNumber;
Curve *THEC;
// ipar[0] = nbpoints
// abs(ipar[1]) = method
// sign(ipar[1]) = orientation
// dpar[0] = parameter
double F_One (double t){
Vertex der;
double d;
......@@ -22,6 +27,7 @@ double F_One (double t){
return (d);
}
double F_Transfini (double t){
Vertex der;
double d, a, b, val, ZePauwer;
......@@ -36,7 +42,7 @@ double F_Transfini (double t){
else{
switch (abs (THEC->ipar[1])){
case 2:
case 1: // progression
if (sign (THEC->ipar[1]) == -1)
ZePauwer = 1. / THEC->dpar[0];
else
......@@ -46,7 +52,7 @@ double F_Transfini (double t){
val = d / (a * exp (b * (t * THEC->l))) ;
break ;
case 1:
case 2: //bump
if (THEC->dpar[0] > 1.0){
a = -4. * sqrt (THEC->dpar[0] - 1.) *
atan2 (1., sqrt (THEC->dpar[0] - 1.)) /
......@@ -66,7 +72,6 @@ double F_Transfini (double t){
Msg(WARNING, "Unknown Case in Transfinite Mesh Line");
val = 1. ;
}
}
return val ;
......@@ -96,16 +101,11 @@ void Maillage_Curve (void *data, void *dummy){
Msg(STATUS, "Meshing Curve %d", c->Num);
if (c->Method != TRANSFINI && Extrude_Mesh (c)){
Points = List_Create (10, 10, sizeof (IntPoint));
c->l = Integration (c->ubeg, c->uend, F_One, Points, 1.e-5);
List_Delete (Points);
}
else{
Points = List_Create (10, 10, sizeof (IntPoint));
c->l = Integration (c->ubeg, c->uend, F_One, Points, 1.e-5);
List_Delete (Points);
if (c->Method == TRANSFINI || !Extrude_Mesh (c)){
if (c->Method == TRANSFINI){
Points = List_Create (10, 10, sizeof (IntPoint));
a = Integration (c->ubeg, c->uend, F_Transfini, Points, 1.e-7);
......@@ -115,6 +115,7 @@ void Maillage_Curve (void *data, void *dummy){
Points = List_Create (10, 10, sizeof (IntPoint));
a = Integration (c->ubeg, c->uend, F_Lc, Points, 1.e-5);
N = IMAX (2, (int) (a + 1.));
if (c->Typ == MSH_SEGM_CIRC ||
c->Typ == MSH_SEGM_CIRC_INV ||
c->Typ == MSH_SEGM_ELLI ||
......@@ -151,6 +152,7 @@ void Maillage_Curve (void *data, void *dummy){
List_Read (Points, count - 1, &P1);
List_Read (Points, count, &P2);
d = (double) NUMP *b;
if ((fabs (P2.p) >= fabs (d)) && (fabs (P1.p) < fabs (d))){
dt = P2.t - P1.t;
dp = P2.p - P1.p;
......@@ -187,6 +189,7 @@ void Maillage_Curve (void *data, void *dummy){
List_Add (c->Vertices, &pV);
}
}
for (i = 0; i < List_Nbr (c->Vertices) - 1; i++){
List_Read (c->Vertices, i, &v1);
List_Read (c->Vertices, i + 1, &v2);
......
/* $Id: 2D_DivAndConq.cpp,v 1.5 2000-11-26 15:43:46 geuzaine Exp $ */
/* $Id: 2D_DivAndConq.cpp,v 1.6 2000-11-28 11:28:31 geuzaine Exp $ */
/*
A L G O R I T H M E D I V I D E A N D C O N Q U E R
......@@ -352,7 +352,7 @@ int CircumCircle(double x1,double y1,double x2,double y2,double x3,double y3,
*xc = (double) ((a1*(y3-y2) + a2*(y1-y3) + a3*(y2-y1)) / d);
*yc = (double) ((a1*(x2-x3) + a2*(x3-x1) + a3*(x1-x2)) / d);
if(fabs(d) < 1.e-12 * LC2D)
if(fabs(d) < 1.e-12 * DSQR(LC2D))
Msg(WARNING, "Points Almost Colinear in CircumCircle (d = %g)", d);
return(1);
......
/* $Id: Metric.cpp,v 1.3 2000-11-26 15:43:47 geuzaine Exp $ */
/* $Id: Metric.cpp,v 1.4 2000-11-28 11:28:32 geuzaine Exp $ */
#include "Gmsh.h"
#include "Const.h"
......@@ -314,6 +314,9 @@ double GMSHMetric::getLc (double u, Curve * c){
Vertex du = InterpolateCurve (c, u, 1);
Local_Metric_Of_Attractors (v.Pos.X, v.Pos.Y, v.Pos.Z, NULL);
l = LengthVector (&du);
//printf("GetLC : u = %g l=%g lc=%g return=%g ", u, l, v.lc, l/v.lc);
return l / v.lc;
}
......
/* $Id: Numeric.cpp,v 1.6 2000-11-26 15:43:47 geuzaine Exp $ */
/* $Id: Numeric.cpp,v 1.7 2000-11-28 11:28:32 geuzaine Exp $ */
#include "Gmsh.h"
#include "Const.h"
......@@ -469,22 +469,19 @@ void RecursiveIntegration (IntPoint * from, IntPoint * to, double (*f) (double X
double Integration (double t1, double t2, double (*f) (double X),
List_T * pPoints, double Prec){
int depth, i;
int depth;
IntPoint from, to;
depth = 0;
from.t = t1;
from.lc = f(from.t);
from.p = 0.0;
List_Add (pPoints, &from);
to.t = t2;
to.lc = f(to.t);
List_Add (pPoints, &from);
RecursiveIntegration (&from, &to, f, pPoints, Prec, &depth);
for (i = 0; i < List_Nbr (pPoints); i++){
List_Read (pPoints, i, &to);
}
List_Read (pPoints, List_Nbr (pPoints) - 1, &to);
return (to.p);
......
%{ /* $Id: Gmsh.l,v 1.4 2000-11-25 15:26:11 geuzaine Exp $ */
%{ /* $Id: Gmsh.l,v 1.5 2000-11-28 11:28:35 geuzaine Exp $ */
#include <stdio.h>
#include <stdlib.h>
......@@ -139,7 +139,7 @@ Physical return tPhysical;
Pi return tPi;
Plane return tPlane;
Point return tPoint;
Power return tPower;
Power return tProgression;
Progression return tProgression;
Parametric return tParametric;
......
This diff is collapsed.
......@@ -6,145 +6,145 @@ typedef union {
Shape s;
List_T *l;
} YYSTYPE;
#define tDOUBLE 257
#define tSTRING 258
#define tBIGSTR 259
#define tEND 260
#define tAFFECT 261
#define tDOTS 262
#define tPi 263
#define tExp 264
#define tLog 265
#define tLog10 266
#define tSqrt 267
#define tSin 268
#define tAsin 269
#define tCos 270
#define tAcos 271
#define tTan 272
#define tAtan 273
#define tAtan2 274
#define tSinh 275
#define tCosh 276
#define tTanh 277
#define tFabs 278
#define tFloor 279
#define tCeil 280
#define tFmod 281
#define tModulo 282
#define tHypot 283
#define tPoint 284
#define tCircle 285
#define tEllipsis 286
#define tLine 287
#define tSurface 288
#define tSpline 289
#define tVolume 290
#define tCharacteristic 291
#define tLength 292
#define tParametric 293
#define tElliptic 294
#define tPlane 295
#define tRuled 296
#define tTransfinite 297
#define tComplex 298
#define tPhysical 299
#define tUsing 300
#define tPower 301
#define tBump 302
#define tProgression 303
#define tAssociation 304
#define tRotate 305
#define tTranslate 306
#define tSymmetry 307
#define tDilate 308
#define tExtrude 309
#define tDuplicata 310
#define tLoop 311
#define tInclude 312
#define tRecombine 313
#define tDelete 314
#define tCoherence 315
#define tView 316
#define tOffset 317
#define tAttractor 318
#define tLayers 319
#define tScalarTetrahedron 320
#define tVectorTetrahedron 321
#define tTensorTetrahedron 322
#define tScalarTriangle 323
#define tVectorTriangle 324
#define tTensorTriangle 325
#define tScalarLine 326
#define tVectorLine 327
#define tTensorLine 328
#define tScalarPoint 329
#define tVectorPoint 330
#define tTensorPoint 331
#define tBSpline 332
#define tNurbs 333
#define tOrder 334
#define tWith 335
#define tBounds 336
#define tKnots 337
#define tColor 338
#define tGeneral 339
#define tGeometry 340
#define tMesh 341
#define tB_SPLINE_SURFACE_WITH_KNOTS 342
#define tB_SPLINE_CURVE_WITH_KNOTS 343
#define tCARTESIAN_POINT 344
#define tTRUE 345
#define tFALSE 346
#define tUNSPECIFIED 347
#define tU 348
#define tV 349
#define tEDGE_CURVE 350
#define tVERTEX_POINT 351
#define tORIENTED_EDGE 352
#define tPLANE 353
#define tFACE_OUTER_BOUND 354
#define tEDGE_LOOP 355
#define tADVANCED_FACE 356
#define tVECTOR 357
#define tDIRECTION 358
#define tAXIS2_PLACEMENT_3D 359
#define tISO 360
#define tENDISO 361
#define tENDSEC 362
#define tDATA 363
#define tHEADER 364
#define tFILE_DESCRIPTION 365
#define tFILE_SCHEMA 366
#define tFILE_NAME 367
#define tMANIFOLD_SOLID_BREP 368
#define tCLOSED_SHELL 369
#define tADVANCED_BREP_SHAPE_REPRESENTATION 370
#define tFACE_BOUND 371
#define tCYLINDRICAL_SURFACE 372
#define tCONICAL_SURFACE 373
#define tCIRCLE 374
#define tTRIMMED_CURVE 375
#define tGEOMETRIC_SET 376
#define tCOMPOSITE_CURVE_SEGMENT 377
#define tCONTINUOUS 378
#define tCOMPOSITE_CURVE 379
#define tTOROIDAL_SURFACE 380
#define tPRODUCT_DEFINITION 381
#define tPRODUCT_DEFINITION_SHAPE 382
#define tSHAPE_DEFINITION_REPRESENTATION 383
#define tELLIPSE 384
#define tTrimmed 385
#define tSolid 386
#define tEndSolid 387
#define tVertex 388
#define tFacet 389
#define tNormal 390
#define tOuter 391
#define tLoopSTL 392
#define tEndLoop 393
#define tEndFacet 394
#define UMINUS 395
#define tDOUBLE 258
#define tSTRING 259
#define tBIGSTR 260
#define tEND 261
#define tAFFECT 262
#define tDOTS 263
#define tPi 264
#define tExp 265
#define tLog 266
#define tLog10 267
#define tSqrt 268
#define tSin 269
#define tAsin 270
#define tCos 271
#define tAcos 272
#define tTan 273
#define tAtan 274
#define tAtan2 275
#define tSinh 276
#define tCosh 277
#define tTanh 278
#define tFabs 279
#define tFloor 280
#define tCeil 281
#define tFmod 282
#define tModulo 283
#define tHypot 284
#define tPoint 285
#define tCircle 286
#define tEllipsis 287
#define tLine 288
#define tSurface 289
#define tSpline 290
#define tVolume 291
#define tCharacteristic 292
#define tLength 293
#define tParametric 294
#define tElliptic 295
#define tPlane 296
#define tRuled 297
#define tTransfinite 298
#define tComplex 299
#define tPhysical 300
#define tUsing 301
#define tPower 302
#define tBump 303
#define tProgression 304
#define tAssociation 305
#define tRotate 306
#define tTranslate 307
#define tSymmetry 308
#define tDilate 309
#define tExtrude 310
#define tDuplicata 311
#define tLoop 312
#define tInclude 313
#define tRecombine 314
#define tDelete 315
#define tCoherence 316
#define tView 317
#define tOffset 318
#define tAttractor 319
#define tLayers 320
#define tScalarTetrahedron 321
#define tVectorTetrahedron 322
#define tTensorTetrahedron 323
#define tScalarTriangle 324
#define tVectorTriangle 325
#define tTensorTriangle 326
#define tScalarLine 327
#define tVectorLine 328
#define tTensorLine 329
#define tScalarPoint 330
#define tVectorPoint 331
#define tTensorPoint 332
#define tBSpline 333
#define tNurbs 334
#define tOrder 335
#define tWith 336
#define tBounds 337
#define tKnots 338
#define tColor 339
#define tGeneral 340
#define tGeometry 341
#define tMesh 342
#define tB_SPLINE_SURFACE_WITH_KNOTS 343
#define tB_SPLINE_CURVE_WITH_KNOTS 344
#define tCARTESIAN_POINT 345
#define tTRUE 346
#define tFALSE 347
#define tUNSPECIFIED 348
#define tU 349
#define tV 350
#define tEDGE_CURVE 351
#define tVERTEX_POINT 352
#define tORIENTED_EDGE 353
#define tPLANE 354
#define tFACE_OUTER_BOUND 355
#define tEDGE_LOOP 356
#define tADVANCED_FACE 357
#define tVECTOR 358
#define tDIRECTION 359
#define tAXIS2_PLACEMENT_3D 360
#define tISO 361
#define tENDISO 362
#define tENDSEC 363
#define tDATA 364
#define tHEADER 365
#define tFILE_DESCRIPTION 366
#define tFILE_SCHEMA 367
#define tFILE_NAME 368
#define tMANIFOLD_SOLID_BREP 369
#define tCLOSED_SHELL 370
#define tADVANCED_BREP_SHAPE_REPRESENTATION 371
#define tFACE_BOUND 372
#define tCYLINDRICAL_SURFACE 373
#define tCONICAL_SURFACE 374
#define tCIRCLE 375
#define tTRIMMED_CURVE 376
#define tGEOMETRIC_SET 377
#define tCOMPOSITE_CURVE_SEGMENT 378
#define tCONTINUOUS 379
#define tCOMPOSITE_CURVE 380
#define tTOROIDAL_SURFACE 381
#define tPRODUCT_DEFINITION 382
#define tPRODUCT_DEFINITION_SHAPE 383
#define tSHAPE_DEFINITION_REPRESENTATION 384
#define tELLIPSE 385
#define tTrimmed 386
#define tSolid 387
#define tEndSolid 388
#define tVertex 389
#define tFacet 390
#define tNormal 391
#define tOuter 392
#define tLoopSTL 393
#define tEndLoop 394
#define tEndFacet 395
#define UMINUS 396
extern YYSTYPE yylval;
%{ /* $Id: Gmsh.y,v 1.7 2000-11-25 15:26:11 geuzaine Exp $ */
%{ /* $Id: Gmsh.y,v 1.8 2000-11-28 11:28:35 geuzaine Exp $ */
#include <stdarg.h>
......@@ -1171,7 +1171,7 @@ Transfini :
}
}
}
| tTransfinite tLine ListOfDouble tAFFECT FExpr tUsing tPower FExpr tEND
| tTransfinite tLine ListOfDouble tAFFECT FExpr tUsing tProgression FExpr tEND
{
Curve *c;
for(i=0;i<List_Nbr($3);i++){
......@@ -1183,8 +1183,8 @@ Transfini :
else{
c->Method = TRANSFINI;
c->ipar[0] = (int)$5;
c->ipar[1] = sign(d); /* Power : code 1 ou -1 */
c->dpar[0] = $8;
c->ipar[1] = sign(d); /* Progresion : code 1 ou -1 */
c->dpar[0] = fabs($8);
}
}
}
......@@ -1201,24 +1201,7 @@ Transfini :
c->Method = TRANSFINI;
c->ipar[0] = (int)$5;
c->ipar[1] = 2*sign(d); /* Bump : code 2 ou -2 */
c->dpar[0] = $8;
}
}
}
| tTransfinite tLine ListOfDouble tAFFECT FExpr tUsing tProgression FExpr tEND
{
Curve *c;
for(i=0;i<List_Nbr($3);i++){
List_Read($3,i,&d);
j = (int)fabs(d);
c = FindCurve(j,THEM);
if(!c)
vyyerror("Unkown Curve %d", j);
else{
c->Method = TRANSFINI;
c->ipar[0] = (int)$5;
c->ipar[1] = 3*sign(d); /* Progresion : code 3 ou -3 */
c->dpar[0] = $8;
c->dpar[0] = fabs($8);
}
}
}
......@@ -1290,8 +1273,10 @@ Transfini :
List_Read($3,i,&d);
j = (int)d;
s = FindSurface(j,THEM);
if(!s)
vyyerror("Unkown Surface %d", j);
if(!s){
/* Allow generic lists, even if the surfaces don't exist
vyyerror("Unkown Surface %d", j); */
}
else{
s->Recombine = 1;
s->RecombineAngle = $5;
......@@ -1305,8 +1290,10 @@ Transfini :
List_Read($3,i,&d);
j = (int)d;
s = FindSurface(j,THEM);
if(!s)
vyyerror("Unkown Surface %d", j);
if(!s){
/* Allow generic lists, even if the surfaces don't exist
vyyerror("Unkown Surface %d", j); */
}
else{
s->Recombine = 1;
s->RecombineAngle = 30.;
......
......@@ -2,7 +2,7 @@
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
* $Header: /cvsroot/gmsh/Parser/Gmsh.yy.cpp,v 1.9 2000-11-26 15:43:47 geuzaine Exp $
* $Header: /cvsroot/gmsh/Parser/Gmsh.yy.cpp,v 1.10 2000-11-28 11:28:35 geuzaine Exp $
*/
#define FLEX_SCANNER
......@@ -1135,7 +1135,7 @@ YY_MALLOC_DECL
YY_DECL
{
register yy_state_type yy_current_state;
register char *yy_cp = NULL, *yy_bp = NULL;
register char *yy_cp, *yy_bp;
register int yy_act;
#line 60 "Gmsh.l"
......@@ -1542,7 +1542,7 @@ return tPoint;
case 64:
YY_RULE_SETUP
#line 142 "Gmsh.l"
return tPower;
return tProgression;
YY_BREAK
case 65:
YY_RULE_SETUP
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment