diff --git a/Mesh/1D_Mesh.cpp b/Mesh/1D_Mesh.cpp index f111c62d010ae9b3c68a0b43010e392c0c4131b8..ea0c7bbee1c2609ff05f527704502f83f664dfca 100644 --- a/Mesh/1D_Mesh.cpp +++ b/Mesh/1D_Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: 1D_Mesh.cpp,v 1.46 2006-01-06 00:34:25 geuzaine Exp $ +// $Id: 1D_Mesh.cpp,v 1.47 2006-01-19 02:26:21 geuzaine Exp $ // // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle // @@ -59,7 +59,8 @@ double F_Transfini(double t) d = sqrt(der.Pos.X * der.Pos.X + der.Pos.Y * der.Pos.Y + der.Pos.Z * der.Pos.Z); - if(THEC->dpar[0] == 0.0 || THEC->dpar[0] == 1.0) { + if(THEC->dpar[0] <= 0.0 || THEC->dpar[0] == 1.0) { + // dpar[0] < 0 should never happen val = d * (double)THEC->ipar[0] / THEC->l; } else { @@ -70,10 +71,7 @@ double F_Transfini(double t) r = THEC->dpar[0]; else r = 1. / THEC->dpar[0]; - if(r == 1.) - a = THEC->l / (double)THEC->ipar[0]; - else - a = THEC->l * (r - 1.) / (pow(r, THEC->ipar[0]) - 1.); + a = THEC->l * (r - 1.) / (pow(r, THEC->ipar[0] - 1.) - 1.); i = (int)(log(t * THEC->l / a * (r - 1.) + 1.) / log(r)); val = d / (a * pow(r, (double)i)); break; diff --git a/benchmarks/1d/progression.geo b/benchmarks/1d/progression.geo new file mode 100644 index 0000000000000000000000000000000000000000..00031c6bb32162f42d6f3431f7bef061c72afbd2 --- /dev/null +++ b/benchmarks/1d/progression.geo @@ -0,0 +1,12 @@ +// the mesh nodes should match the points below + +Point(1) = {0,0,0,1}; +Point(2) = {1,0,0,1}; +Point(3) = {3,0,0,1}; +Point(4) = {7,0,0,1}; +Point(5) = {15,0,0,1}; + +Point(6) = {0,0.2,0,1}; +Point(7) = {15,0.2,0,1}; +Line(1) = {6,7}; +Transfinite Line {1} = 5 Using Progression 2; diff --git a/benchmarks/3d/periodic.geo b/benchmarks/3d/periodic.geo index 6196155fce7d2766b4758a57756fbfa2a84f0b74..c82d1eff26f9af355931c6f4d89b5003a2f8b3af 100644 --- a/benchmarks/3d/periodic.geo +++ b/benchmarks/3d/periodic.geo @@ -1,7 +1,7 @@ // original file from benarafa@alpes.cea.fr Lc = 0.003 ; -nb = 12; +nb_layers = 12; use_prisms = 1; Point(1) = {0.,0.,0.,Lc}; @@ -46,12 +46,12 @@ Physical Line(18) = {2,3}; Physical Surface(19) = {15}; If(use_prisms) - Extrude Surface {15, {0.,0.,2.*R}}{Layers{nb,83,1}; Recombine; }; + Extrude Surface {15, {0.,0.,2.*R}}{Layers{nb_layers,83,1}; Recombine; }; EndIf If(!use_prisms) Extrude Surface {15, {0.,0.,2.*R}}; - Transfinite Line {27,55,1,59,23,43,4,39,21,34,3,35,25,51,2,47} = nb Using Progression 1.; + Transfinite Line {27,55,1,59,23,43,4,39,21,34,3,35,25,51,2,47} = (nb_layers+1) Using Progression 1.; Transfinite Surface {52} = {16,14,33,37}; Transfinite Surface {36} = {11,15,19,18}; Transfinite Surface {44} = {13,17,24,28};