From fe6540c51523a192f5d7bf5728591ef854d76001 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 16 Nov 2010 14:39:20 +0000 Subject: [PATCH] 0021074: EDF 1682 MESH: Bug with start and end length hypothesis fix compensateError() --- src/StdMeshers/StdMeshers_Regular_1D.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/StdMeshers/StdMeshers_Regular_1D.cxx b/src/StdMeshers/StdMeshers_Regular_1D.cxx index 6771e53ed..ce6742579 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.cxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.cxx @@ -377,10 +377,14 @@ static void compensateError(double a1, double an, } double q = dUn / ( nPar - 1 ); - if ( !adjustNeighbors2an ) { - for ( itU = theParams.rbegin(), i = 1; i < nPar; itU++, i++ ) { + if ( !adjustNeighbors2an ) + { + q = Abs( dUn / ( Utgt - Un )); // factor of segment length change + for ( itU = theParams.rbegin(), i = 1; i < nPar; i++ ) { + double prevU = *itU; (*itU) += dUn; - dUn -= q; + ++itU; + dUn = q * (*itU - prevU) * (prevU-U1)/(Un-U1); } } else { -- 2.39.2