Salome HOME
- Modifing Geometry and Mesh Python scripts from SALOME 6 and before
[modules/smesh.git] / src / StdMeshers / StdMeshers_ViscousLayers.cxx
index 5fb3736b05536d083c82379ef827d62b571e757f..6a6d871c43d65d25128c00a3f466aa903662e998 100644 (file)
@@ -801,10 +801,10 @@ namespace
         double u1 = intervals( i );
         double u2 = intervals( i+1 );
         curve.D2( 0.5*( u1+u2 ), p, drv1, drv2 );
-        double cross = drv2 ^ drv1;
+        double cross = drv2 * drv1; //drv2 ^ drv1;
         if ( E.Orientation() == TopAbs_REVERSED )
           cross = -cross;
-        isConvex = ( cross 1e-9 );
+        isConvex = ( cross > -1e-9 );
       }
       // check if concavity is strong enough to care about it
       //const double maxAngle = 5 * Standard_PI180;
@@ -865,9 +865,11 @@ namespace
       const char* fname = "/tmp/viscous.py";
       cout << "execfile('"<<fname<<"')"<<endl;
       py = new ofstream(fname);
-      *py << "from smesh import *" << endl
-          << "meshSO = GetCurrentStudy().FindObjectID('0:1:2:3')" << endl
-          << "mesh = Mesh( meshSO.GetObject() )"<<endl;
+      *py << "import SMESH" << endl
+          << "from salome.smesh import smeshBuilder" << endl
+          << "smesh = smeshBuilder.New(salome.myStudy)" << endl
+          << "meshSO = smesh.GetCurrentStudy().FindObjectID('0:1:2:3')" << endl
+          << "mesh = smesh.Mesh( meshSO.GetObject() )"<<endl;
     }
     void Finish() {
       if (py)
@@ -3720,7 +3722,7 @@ bool _ViscousBuilder::shrink()
       }
       if ( badNb > 0 )
         return error(SMESH_Comment("Can't shrink 2D mesh on face ") << f2sd->first );
-      if ( shriStep > 20 )
+      if ( shriStep > 200 )
         return error(SMESH_Comment("Infinite loop at shrinking 2D mesh on face ") << f2sd->first );
     }