Salome HOME
52548: Set filter on standalone group of edges does't work
authoreap <eap@opencascade.com>
Thu, 23 Oct 2014 08:21:14 +0000 (12:21 +0400)
committereap <eap@opencascade.com>
Thu, 23 Oct 2014 08:21:14 +0000 (12:21 +0400)
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
src/SMESH_SWIG/smesh_algorithm.py
src/StdMeshers/StdMeshers_Adaptive1D.cxx

index 0293f51a3a6889e011931c5ff38b81e7f6f8c9b9..d0bb58cd26753f67b48d829fcd9bc06ddeccfea3 100644 (file)
@@ -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;
 
   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();
 
   for ( aPredIter = aPredicates.begin(), aBinaryIter = aBinaries.begin();
         aPredIter != aPredicates.end() && aBinaryIter != aBinaries.end();
index 46f2270c1d7b8d7f68ca9d8b65e02930cd792966..8ce382e179b8b5c93545682b58c1274fc6678b75 100644 (file)
@@ -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 ):
         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)
         hyp = self.Hypothesis("ViscousLayers",
                               [thickness, numberOfLayers, stretchFactor, faces, isFacesToIgnore],
                               toAdd=False)
index 62a2cf5a9f1706e34b34896276f4df040b3fc068..7bcfca77d6a8f71eadc62ab64c2a55a45c5955ff 100644 (file)
@@ -1179,6 +1179,7 @@ bool AdaptiveAlgo::Compute(SMESH_Mesh &         theMesh,
       eData.AddPoint( eData.myPoints.end(), eData.myC3d.LastParameter() );
     }
   }
       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
   if ( _computeCanceled ) return false;
 
   // Take into account size of already existing segments