]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
22222: [CEA 820] GHS3D in salome 7.2.0 ten times slower than in salome 6.6.0
authoreap <eap@opencascade.com>
Wed, 29 May 2013 15:29:19 +0000 (15:29 +0000)
committereap <eap@opencascade.com>
Wed, 29 May 2013 15:29:19 +0000 (15:29 +0000)
Choose a compute event (COMPUTE or COMPUTE_SUBMESH) depending on an
explicit parameter aShapeOnly.

   bool Compute(::SMESH_Mesh &        aMesh,
                const TopoDS_Shape &  aShape,
+               const bool            aShapeOnly=false,
                const bool            anUpward=false,
                const ::MeshDimension aDim=::MeshDim_3D,
                TSetOfInt*            aShapesId=0);

src/SMESH/SMESH_Gen.cxx
src/SMESH/SMESH_Gen.hxx

index fa720985a628456aa85823ac0e988fdddda7a372..d515351393d12d2ad617c0f2e3be0162697c2e38 100644 (file)
@@ -120,16 +120,17 @@ SMESH_Mesh* SMESH_Gen::CreateMesh(int theStudyId, bool theIsEmbeddedMode)
 }
 
 //=============================================================================
-/*!
+/*
  * Compute a mesh
  */
 //=============================================================================
 
 bool SMESH_Gen::Compute(SMESH_Mesh &          aMesh,
                         const TopoDS_Shape &  aShape,
-                        const bool            anUpward,
-                        const ::MeshDimension aDim,
-                        TSetOfInt*            aShapesId)
+                        const bool            aShapeOnly /*=false*/,
+                        const bool            anUpward /*=false*/,
+                        const ::MeshDimension aDim /*=::MeshDim_3D*/,
+                        TSetOfInt*            aShapesId /*=0*/)
 {
   MESSAGE("SMESH_Gen::Compute");
   MEMOSTAT;
@@ -143,11 +144,12 @@ bool SMESH_Gen::Compute(SMESH_Mesh &          aMesh,
   const int  globalAlgoDim = 100;
 
   SMESH_subMeshIteratorPtr smIt;
-  SMESH_subMesh::compute_event computeEvent;
-  if ( !anUpward && aShape.IsSame( aMesh.GetShapeToMesh() ))
-    computeEvent = SMESH_subMesh::COMPUTE;
-  else
-    computeEvent = SMESH_subMesh::COMPUTE_SUBMESH;
+
+  // Fix of Issue 22150. Due to !BLSURF->OnlyUnaryInput(), BLSURF computes edges
+  // that must be computed by Projection 1D-2D when Projection asks to compute
+  // one face only.
+  SMESH_subMesh::compute_event computeEvent =
+    aShapeOnly ? SMESH_subMesh::COMPUTE_SUBMESH : SMESH_subMesh::COMPUTE;
 
   if ( anUpward ) // is called from the below code in this method
   {
@@ -331,7 +333,7 @@ bool SMESH_Gen::Compute(SMESH_Mesh &          aMesh,
             SMESH_Hypothesis::Hypothesis_Status status;
             if ( subAlgo->CheckHypothesis( aMesh, aSubShape, status ))
               // mesh a lower smToCompute starting from vertices
-              Compute( aMesh, aSubShape, /*anUpward=*/true, aDim, aShapesId );
+              Compute( aMesh, aSubShape, aShapeOnly, /*anUpward=*/true, aDim, aShapesId );
           }
         }
       }
@@ -363,7 +365,7 @@ bool SMESH_Gen::Compute(SMESH_Mesh &          aMesh,
     // -----------------------------------------------
     // mesh the rest sub-shapes starting from vertices
     // -----------------------------------------------
-    ret = Compute( aMesh, aShape, /*anUpward=*/true, aDim, aShapesId );
+    ret = Compute( aMesh, aShape, aShapeOnly, /*anUpward=*/true, aDim, aShapesId );
   }
 
   MESSAGE( "VSR - SMESH_Gen::Compute() finished, OK = " << ret);
index 496ca9b69649318482e09495d139510698c6a4c5..cb81415e1012ce14fdfd002f9e7cf359b0dabf6e 100644 (file)
@@ -70,6 +70,8 @@ public:
 
   /*!
    * \brief Computes aMesh on aShape 
+   *  \param aShapeOnly - if true, algo->OnlyUnaryInput() feature is ignored and
+   *                      only \a aShape is computed.
    *  \param anUpward - compute from vertices up to more complex shape (internal usage)
    *  \param aDim - upper level dimension of the mesh computation
    *  \param aShapesId - list of shapes with computed mesh entities (elements or nodes)
@@ -77,6 +79,7 @@ public:
    */
   bool Compute(::SMESH_Mesh &        aMesh,
                const TopoDS_Shape &  aShape,
+               const bool            aShapeOnly=false,
                const bool            anUpward=false,
                const ::MeshDimension aDim=::MeshDim_3D,
                TSetOfInt*            aShapesId=0);