]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
0020918: EDF 1447 SMESH: Mesh common borders
authoreap <eap@opencascade.com>
Tue, 30 Nov 2010 15:26:42 +0000 (15:26 +0000)
committereap <eap@opencascade.com>
Tue, 30 Nov 2010 15:26:42 +0000 (15:26 +0000)
   improve code readability

src/StdMeshers/StdMeshers_Regular_1D.cxx

index 8273990301c52a873bf4ec4360b8aa5fac8dc166..985fb70d8e8f2428913cdd11ae9b15697e29aed0 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 {