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

fix Progression to actually do what we claim in the doc (missing -1 in
the formula: confusion between num_points and num_intervals)
parent 8c4ca944
No related branches found
No related tags found
No related merge requests found
// $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;
......
// 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;
// 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};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment