From 3ba242025de908077c7407f8eb75e1fe328dfc0b Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 23 Oct 2014 12:21:14 +0400 Subject: [PATCH] 52548: Set filter on standalone group of edges does't work 2) Allow passing a geom group as faces arg of ViscousLayers() 3) Prevent crash of Adaptive hyp when only degenerated EDGEs leave not meshed --- src/SMESH_I/SMESH_Filter_i.cxx | 3 ++- src/SMESH_SWIG/smesh_algorithm.py | 9 ++++++++- src/StdMeshers/StdMeshers_Adaptive1D.cxx | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/SMESH_I/SMESH_Filter_i.cxx b/src/SMESH_I/SMESH_Filter_i.cxx index 0293f51a3..d0bb58cd2 100644 --- a/src/SMESH_I/SMESH_Filter_i.cxx +++ b/src/SMESH_I/SMESH_Filter_i.cxx @@ -3020,7 +3020,8 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria SMESH::Predicate_ptr aPrevPredicate = SMESH::Predicate::_nil(); int aPrevBinary = SMESH::FT_Undefined; - aBinaries.back() = SMESH::FT_Undefined; + if ( !aBinaries.empty() ) + aBinaries.back() = SMESH::FT_Undefined; for ( aPredIter = aPredicates.begin(), aBinaryIter = aBinaries.begin(); aPredIter != aPredicates.end() && aBinaryIter != aBinaries.end(); diff --git a/src/SMESH_SWIG/smesh_algorithm.py b/src/SMESH_SWIG/smesh_algorithm.py index 46f2270c1..8ce382e17 100644 --- a/src/SMESH_SWIG/smesh_algorithm.py +++ b/src/SMESH_SWIG/smesh_algorithm.py @@ -274,7 +274,14 @@ class Mesh_Algorithm: if not "ViscousLayers" in self.GetCompatibleHypothesis(): raise TypeError, "ViscousLayers are not supported by %s"%self.algo.GetName() if faces and isinstance( faces[0], geomBuilder.GEOM._objref_GEOM_Object ): - faces = [ self.mesh.geompyD.GetSubShapeID(self.mesh.geom, f) for f in faces ] + import GEOM + faceIDs = [] + for f in faces: + if self.mesh.geompyD.ShapeIdToType( f.GetType() ) == "GROUP": + faceIDs += f.GetSubShapeIndices() + else: + faceIDs += [self.mesh.geompyD.GetSubShapeID(self.mesh.geom, f)] + faces = faceIDs hyp = self.Hypothesis("ViscousLayers", [thickness, numberOfLayers, stretchFactor, faces, isFacesToIgnore], toAdd=False) diff --git a/src/StdMeshers/StdMeshers_Adaptive1D.cxx b/src/StdMeshers/StdMeshers_Adaptive1D.cxx index 62a2cf5a9..7bcfca77d 100644 --- a/src/StdMeshers/StdMeshers_Adaptive1D.cxx +++ b/src/StdMeshers/StdMeshers_Adaptive1D.cxx @@ -1179,6 +1179,7 @@ bool AdaptiveAlgo::Compute(SMESH_Mesh & theMesh, eData.AddPoint( eData.myPoints.end(), eData.myC3d.LastParameter() ); } } + if ( myEdges.empty() ) return true; if ( _computeCanceled ) return false; // Take into account size of already existing segments -- 2.39.2