From: eap Date: Wed, 15 Sep 2010 10:19:55 +0000 (+0000) Subject: 0020968: EDF1545 SMESH: Problem in the creation of a mesh group on geometry X-Git-Tag: V5_1_5a1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=77a4b6964449dd0d4d1dcf146f9d6757c8bace96;p=plugins%2Fblsurfplugin.git 0020968: EDF1545 SMESH: Problem in the creation of a mesh group on geometry 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); --- diff --git a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx index a8bd70e..b4fb881 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx @@ -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; diff --git a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.hxx b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.hxx index 46ea895..e7f7d3f 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.hxx +++ b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.hxx @@ -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);