Salome HOME
0022104: EDF 2550 SMESH: 2D viscous layer, allow specifying edges with viscous layer
[modules/smesh.git] / src / SMESH / SMESH_Mesh.cxx
index ecc9e60613231240439cde53590f232ade7213e5..9bf36fb1ff7b6aad47aae73802111b7a9d2dd6bf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -813,7 +813,8 @@ const SMESH_Hypothesis * SMESH_Mesh::GetHypothesis(const TopoDS_Shape &    aSubS
 int SMESH_Mesh::GetHypotheses(const TopoDS_Shape &                aSubShape,
                               const SMESH_HypoFilter&             aFilter,
                               list <const SMESHDS_Hypothesis * >& aHypList,
-                              const bool                          andAncestors) const
+                              const bool                          andAncestors,
+                              list< TopoDS_Shape > *              assignedTo/*=0*/) const
 {
   set<string> hypTypes; // to exclude same type hypos from the result list
   int nbHyps = 0;
@@ -842,6 +843,7 @@ int SMESH_Mesh::GetHypotheses(const TopoDS_Shape &                aSubShape,
         nbHyps++;
         if ( !cSMESH_Hyp(*hyp)->IsAuxiliary() )
           mainHypFound = true;
+        if ( assignedTo ) assignedTo->push_back( aSubShape );
       }
   }
 
@@ -868,6 +870,7 @@ int SMESH_Mesh::GetHypotheses(const TopoDS_Shape &                aSubShape,
           nbHyps++;
           if ( !cSMESH_Hyp(*hyp)->IsAuxiliary() )
             mainHypFound = true;
+          if ( assignedTo ) assignedTo->push_back( curSh );
         }
     }
   }
@@ -918,10 +921,9 @@ SMESH_subMesh *SMESH_Mesh::GetSubMesh(const TopoDS_Shape & aSubShape)
     if ( it.More() )
     {
       index = _myMeshDS->AddCompoundSubmesh( aSubShape, it.Value().ShapeType() );
-      if ( index > _nbSubShapes ) _nbSubShapes = index; // not to create sm for this group again
-
       // fill map of Ancestors
-      fillAncestorsMap(aSubShape);
+      while ( _nbSubShapes < index )
+        fillAncestorsMap( _myMeshDS->IndexToShape( ++_nbSubShapes ));
     }
   }
 //   if ( !index )
@@ -1502,6 +1504,18 @@ int SMESH_Mesh::NbTriangles(SMDSAbs_ElementOrder order) const throw(SALOME_Excep
   return _myMeshDS->GetMeshInfo().NbTriangles(order);
 }
 
+//================================================================================
+/*!
+ * \brief Return number of biquadratic triangles in the mesh
+ */
+//================================================================================
+
+int SMESH_Mesh::NbBiQuadTriangles() const throw(SALOME_Exception)
+{
+  Unexpect aCatch(SalomeException);
+  return _myMeshDS->GetMeshInfo().NbBiQuadTriangles();
+}
+
 //================================================================================
 /*!
  * \brief Return the number nodes faces in the mesh