]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
0021074: EDF 1682 MESH: Bug with start and end length hypothesis
authoreap <eap@opencascade.com>
Tue, 16 Nov 2010 14:39:20 +0000 (14:39 +0000)
committereap <eap@opencascade.com>
Tue, 16 Nov 2010 14:39:20 +0000 (14:39 +0000)
  fix compensateError()

src/StdMeshers/StdMeshers_Regular_1D.cxx

index 6771e53edc90f14dbdcba2d5e0d7ca8b2dd159be..ce67425795859996372f2df21ffb39dc6909bfba 100644 (file)
@@ -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 {