]> SALOME platform Git repositories - plugins/blsurfplugin.git/commitdiff
Salome HOME
0020968: EDF1545 SMESH: Problem in the creation of a mesh group on geometry
authoreap <eap@opencascade.com>
Wed, 15 Sep 2010 10:19:55 +0000 (10:19 +0000)
committereap <eap@opencascade.com>
Wed, 15 Sep 2010 10:19:55 +0000 (10:19 +0000)
  Correct a default _phySize

BLSURFPlugin_BLSURF.cxx
+    // GetDefaultPhySize() sometimes leads to computation failure
+    _phySize = mesh.GetShapeDiagonalSize() / _gen->GetBoundaryBoxSegmentation();

BLSURFPlugin_BLSURF.hxx
-    void SetParameters(const BLSURFPlugin_Hypothesis* hyp, blsurf_session_t *bls);
+    void SetParameters(const BLSURFPlugin_Hypothesis* hyp, blsurf_session_t *bls,SMESH_Mesh& aMesh);

src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx
src/BLSURFPlugin/BLSURFPlugin_BLSURF.hxx

index a8bd70ea6782e1dc61c342d698e364e21c36eb5d..b4fb881858e533a44e0bad9a4a549e9ffb424daa 100644 (file)
@@ -576,7 +576,9 @@ void createAttractorOnFace(TopoDS_Shape GeomShape, std::string AttractorFunction
 
 /////////////////////////////////////////////////////////
 
-void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp, blsurf_session_t *bls)
+void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp,
+                                        blsurf_session_t *             bls,
+                                        SMESH_Mesh&                   mesh)
 {
   int    _topology      = BLSURFPlugin_Hypothesis::GetDefaultTopology();
   int    _physicalMesh  = BLSURFPlugin_Hypothesis::GetDefaultPhysicalMesh();
@@ -620,6 +622,9 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp, blsu
       }
 
   } else {
+    //0020968: EDF1545 SMESH: Problem in the creation of a mesh group on geometry
+    // GetDefaultPhySize() sometimes leads to computation failure
+    _phySize = mesh.GetShapeDiagonalSize() / _gen->GetBoundaryBoxSegmentation();
     MESSAGE("BLSURFPlugin_BLSURF::SetParameters using defaults");
   }
   _smp_phy_size = _phySize;
@@ -877,7 +882,7 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape)
   VertexId2SizeMap.clear();
 
   MESSAGE("BEGIN SetParameters");
-  SetParameters(_hypothesis, bls);
+  SetParameters(_hypothesis, bls, aMesh);
   MESSAGE("END SetParameters");
 
   /* Now fill the CAD object with data from your CAD
@@ -1073,7 +1078,7 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape)
       if (HasSizeMapOnEdge){
         edgeKey = EdgesWithSizeMap.FindIndex(e);
         if (EdgeId2SizeMap.find(edgeKey)!=EdgeId2SizeMap.end()) {
-         MESSAGE("Sizemap defined on edge with index " << edgeKey);
+          MESSAGE("Sizemap defined on edge with index " << edgeKey);
           theSizeMapStr = EdgeId2SizeMap[edgeKey];
           if (theSizeMapStr.find(bad_end) == (theSizeMapStr.size()-bad_end.size()-1))
             continue;
index 46ea895085a2695413c71533827599b7b5aab2ec..e7f7d3f823dfd00cbf39e8d547b4f188c5d73bcf 100644 (file)
@@ -71,7 +71,7 @@ class BLSURFPlugin_BLSURF: public SMESH_2D_Algo {
                                  const TopoDS_Shape&                  aShape,
                                  SMESH_Hypothesis::Hypothesis_Status& aStatus);
 
-    void SetParameters(const BLSURFPlugin_Hypothesis* hyp, blsurf_session_t *bls);
+    void SetParameters(const BLSURFPlugin_Hypothesis* hyp, blsurf_session_t *bls,SMESH_Mesh& aMesh);
 
     virtual bool Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape);