Salome HOME
0022103: EDF 2550 SMESH : Allow viscous layer with 3D extrusion
authoreap <eap@opencascade.com>
Tue, 4 Jun 2013 15:00:45 +0000 (15:00 +0000)
committereap <eap@opencascade.com>
Tue, 4 Jun 2013 15:00:45 +0000 (15:00 +0000)
 = Allow viscous layers on boundary EDGEs of a 2D sub-mesh

In ComputeParameters(), more attempts to get a correct result

src/SMESHUtils/SMESH_Block.cxx
src/SMESHUtils/SMESH_Block.hxx

index 084c491463331e7d2c247c3de7f1d3b581c77a72..f0838270efc55477f09a0b75e28c7a4254fabbba 100644 (file)
@@ -694,12 +694,12 @@ bool SMESH_Block::ComputeParameters(const gp_Pnt& thePoint,
       start.SetCoord( iParam, sumParam / 4.);
     }
     if ( needGrid ) {
-      // compute nodes of 3 x 3 x 3 grid
+      // compute nodes of 10 x 10 x 10 grid
       int iNode = 0;
       Bnd_Box box;
-      for ( double x = 0.25; x < 0.9; x += 0.25 )
-        for ( double y = 0.25; y < 0.9; y += 0.25 )
-          for ( double z = 0.25; z < 0.9; z += 0.25 ) {
+      for ( double x = 0.05; x < 1.; x += 0.1 )
+        for ( double y = 0.05; y < 1.; y += 0.1 )
+          for ( double z = 0.05; z < 1.; z += 0.1 ) {
             TxyzPair & prmPtn = my3x3x3GridNodes[ iNode++ ];
             prmPtn.first.SetCoord( x, y, z );
             ShellPoint( prmPtn.first, prmPtn.second );
@@ -718,7 +718,7 @@ bool SMESH_Block::ComputeParameters(const gp_Pnt& thePoint,
   {
     double minDist = DBL_MAX;
     gp_XYZ* bestParam = 0;
-    for ( int iNode = 0; iNode < 27; iNode++ ) {
+    for ( int iNode = 0; iNode < 1000; iNode++ ) {
       TxyzPair & prmPtn = my3x3x3GridNodes[ iNode ];
       double dist = ( thePoint.XYZ() - prmPtn.second ).SquareModulus();
       if ( dist < minDist ) {
@@ -819,6 +819,12 @@ bool SMESH_Block::ComputeParameters(const gp_Pnt& thePoint,
          << " ------ NB IT: " << myNbIterations << ",  SUM DIST: " << mySumDist );
 #endif
 
+  const double reachedDist = sqrt( sqDistance );
+  if ( reachedDist > 1000 * myTolerance &&
+       computeParameters( thePoint, theParams, solution ) &&
+       reachedDist > distance() )
+    return true;
+
   theParams = solution;
 
   if ( myFaceIndex > 0 )
index 427cc94de67f35631c5448da14fa03f38a5e2fa2..4f0a60db9855243b4e9170e99c0fb65916a22423 100644 (file)
@@ -383,7 +383,7 @@ public:
   double   myValues[ 4 ]; // values computed at myParam: square distance and 3 derivatives
 
   typedef std::pair<gp_XYZ,gp_XYZ> TxyzPair;
-  TxyzPair my3x3x3GridNodes[ 27 ]; // to compute the first param guess
+  TxyzPair my3x3x3GridNodes[ 1000 ]; // to compute the first param guess
   bool     myGridComputed;
 };