From: mbs Date: Wed, 13 Nov 2024 15:50:59 +0000 (+0000) Subject: compute arithmetic increment dependend on number of intervals for ARITHMETIC_1D X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fmbs%2F43494_regular1d_issue;p=modules%2Fsmesh.git compute arithmetic increment dependend on number of intervals for ARITHMETIC_1D --- diff --git a/src/StdMeshers/StdMeshers_Regular_1D.cxx b/src/StdMeshers/StdMeshers_Regular_1D.cxx index 13b63bcc6..258f73705 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.cxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.cxx @@ -1042,8 +1042,13 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, return error ( SMESH_Comment("Invalid segment lengths (")< numeric_limits::min() ? ( 1+( an-a1 )/q ) : ( 1+theLength/a1 )); + // double q = ( an - a1 ) / ( 2 *theLength/( a1 + an ) - 1 ); + // int n = int(fabs(q) > numeric_limits::min() ? ( 1+( an-a1 )/q ) : ( 1+theLength/a1 )); + int n = int(2 * theLength / ( a1 + an ) + 0.5); + double q = (n > 1 ? ( an - a1 ) / (n - 1) : 0.0); + + std::cout << "a1 = " << a1 << ", an = " << an << ", len = " << theLength << std::endl; + std::cout << "n = " << n << ", q = " << q << std::endl; double U1 = theReverse ? l : f; double Un = theReverse ? f : l;