Salome HOME
23566: EDF 17146 - Problem with viscous layer
authoreap <eap@opencascade.com>
Tue, 17 Jul 2018 13:21:24 +0000 (16:21 +0300)
committerrnv <rnv@opencascade.com>
Tue, 21 Aug 2018 13:51:00 +0000 (16:51 +0300)
src/Controls/SMESH_ControlsDef.hxx
src/SMESH/SMESH_MesherHelper.cxx
src/SMESH_I/SMESH_DumpPython.cxx
src/StdMeshers/StdMeshers_ViscousLayers.cxx

index 452b27a39216186bc307386159484f824f34b9ca..34c3453efd9b6e894df193ba9f7807e2be317530 100644 (file)
@@ -291,7 +291,7 @@ namespace SMESH{
 
     /*
       Class       : Length2D
-      Description : Functor for calculating length of edge
+      Description : Functor for calculating minimal length of edge
     */
     class SMESHCONTROLS_EXPORT Length2D: public virtual NumericalFunctor{
     public:
index ad48bd49d1bdb8a90e740ac56b004ef0086318ec..6f664225d3b87fcfa5fbadd07141427c232aee1a 100644 (file)
@@ -804,33 +804,20 @@ bool SMESH_MesherHelper::CheckNodeUV(const TopoDS_Face&   F,
     // check that uv is correct
     TopLoc_Location loc;
     Handle(Geom_Surface) surface = BRep_Tool::Surface( F,loc );
-    gp_Pnt nodePnt = XYZ( n ), surfPnt(0,0,0);
+    SMESH_NodeXYZ nXYZ( n );
+    gp_Pnt nodePnt = nXYZ, surfPnt(0,0,0);
     double dist = 0;
     if ( !loc.IsIdentity() ) nodePnt.Transform( loc.Transformation().Inverted() );
     if ( infinit ||
          (dist = nodePnt.Distance( surfPnt = surface->Value( uv.X(), uv.Y() ))) > tol )
     {
       setPosOnShapeValidity( shapeID, false );
-      if ( !infinit && distXYZ ) {
-        surfPnt.Transform( loc );
-        distXYZ[0] = dist;
-        distXYZ[1] = surfPnt.X(); distXYZ[2] = surfPnt.Y(); distXYZ[3]=surfPnt.Z();
-      }
       // uv incorrect, project the node to surface
-      GeomAPI_ProjectPointOnSurf& projector = GetProjector( F, loc, tol );
-      projector.Perform( nodePnt );
-      if ( !projector.IsDone() || projector.NbPoints() < 1 )
-      {
-        MESSAGE( "SMESH_MesherHelper::CheckNodeUV() failed to project" );
-        return false;
-      }
-      Standard_Real U,V;
-      projector.LowerDistanceParameters(U,V);
-      uv.SetCoord( U,V );
-      surfPnt = surface->Value( U, V );
-      dist = nodePnt.Distance( surfPnt );
+      Handle(ShapeAnalysis_Surface) sprojector = GetSurface( F );
+      uv = sprojector->ValueOfUV( nXYZ, tol ).XY();
+      surfPnt = sprojector->Value( uv );
+      dist = surfPnt.Distance( nXYZ );
       if ( distXYZ ) {
-        surfPnt.Transform( loc );
         distXYZ[0] = dist;
         distXYZ[1] = surfPnt.X(); distXYZ[2] = surfPnt.Y(); distXYZ[3]=surfPnt.Z();
       }
@@ -842,7 +829,7 @@ bool SMESH_MesherHelper::CheckNodeUV(const TopoDS_Face&   F,
       // store the fixed UV on the face
       if ( myShape.IsSame(F) && shapeID == myShapeID && myFixNodeParameters )
         const_cast<SMDS_MeshNode*>(n)->SetPosition
-          ( SMDS_PositionPtr( new SMDS_FacePosition( U, V )));
+          ( SMDS_PositionPtr( new SMDS_FacePosition( uv.X(), uv.Y() )));
     }
     else if ( myShape.IsSame(F) && uv.Modulus() > numeric_limits<double>::min() )
     {
index 7ca8be9be0cba1b1d31f1371a0b73d7628a58ef3..f2eff5b288c083a20b89ed0d68b93fb90a3888fe 100644 (file)
@@ -1208,26 +1208,28 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
   }
   // import python files corresponding to plugins if they are used in anUpdatedScript
   {
-    TCollection_AsciiString importStr;
+    //TCollection_AsciiString importStr;
     std::vector<std::string> pluginNames = getPluginNames();
     for ( size_t i = 0; i < pluginNames.size(); ++i )
     {
       // Convert access to plugin members:
-      // e.g. StdMeshers.QUAD_REDUCED -> StdMeshersBuilder.QUAD_REDUCED
+      // e.g. StdMeshers.QUAD_REDUCED -> smeshBuilder.QUAD_REDUCED
       TCollection_AsciiString pluginAccess = (pluginNames[i] + ".").c_str() ;
       int iFrom = 1, iPos;
       while (( iPos = anUpdatedScript.Location( pluginAccess, iFrom, anUpdatedScript.Length() )))
       {
-        anUpdatedScript.Insert( iPos + pluginNames[i].size(), "Builder" );
-        iFrom = iPos + pluginNames[i].size() + 8;
+        //anUpdatedScript.Insert( iPos + pluginNames[i].size(), "Builder" );
+        anUpdatedScript.Remove( iPos, pluginNames[i].size() );
+        anUpdatedScript.Insert( iPos, "smeshBuilder" );
+        iFrom = iPos - pluginNames[i].size() + 12;
       }
       // if any plugin member is used, import the plugin
-      if ( iFrom > 1 )
-        importStr += ( helper + "\n" "from salome." + pluginNames[i].c_str() +
-                       " import " + pluginNames[i].c_str() +"Builder" );
+      // if ( iFrom > 1 )
+      //   importStr += ( helper + "\n" "from salome." + pluginNames[i].c_str() +
+      //                  " import " + pluginNames[i].c_str() +"Builder" );
     }
-    if ( !importStr.IsEmpty() )
-      initPart += importStr + "\n";
+    // if ( !importStr.IsEmpty() )
+    //   initPart += importStr + "\n";
   }
 
   if ( isMultiFile )
index 72cdff35f606d09c861ff43f409bcac402f22ddf..feec0022cb986c816c1e4c3aae46e880f6f0e920 100644 (file)
@@ -6680,6 +6680,7 @@ void _ViscousBuilder::findCollisionEdges( _SolidData& data, SMESH_MesherHelper&
     _EdgesOnShape& eos = data._edgesOnShape[iS];
     if ( eos._edges.empty() ) continue;
     if ( eos.ShapeType() != TopAbs_EDGE && eos.ShapeType() != TopAbs_VERTEX ) continue;
+    if ( !eos._sWOL.IsNull() ) continue; // PAL23566
 
     for ( size_t i = 0; i < eos._edges.size(); ++i )
     {