Salome HOME
23118: EDF 11115 SMESH: Hexahedric mesh produces degenerate elements in quadratic...
[modules/smesh.git] / src / StdMeshers / StdMeshers_Hexa_3D.cxx
index 0271fc41ce80197d965c1425b2d1ef587339a42d..1ad459448f597df5017c01702262aefa2abc70ff 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  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
@@ -124,23 +124,17 @@ bool StdMeshers_Hexa_3D::CheckHypothesis
     return true;
   }
 
+  // only StdMeshers_ViscousLayers can be used
   aStatus = HYP_OK;
   for ( ; h != hyps.end(); ++h )
   {
-    string hypName = (*h)->GetName();
-    if ( find( _compatibleHypothesis.begin(),_compatibleHypothesis.end(),hypName )
-         != _compatibleHypothesis.end() )
-    {
-      _viscousLayersHyp = dynamic_cast< const StdMeshers_ViscousLayers*> ( *h );
-    }
-    else
-    {
-      aStatus = HYP_INCOMPATIBLE;
-    }
+    if ( !(_viscousLayersHyp = dynamic_cast< const StdMeshers_ViscousLayers*> ( *h )))
+      break;
   }
-
   if ( !_viscousLayersHyp )
     aStatus = HYP_INCOMPATIBLE;
+  else
+    error( _viscousLayersHyp->CheckHypothesis( aMesh, aShape, aStatus ));
 
   return aStatus == HYP_OK;
 }
@@ -371,8 +365,9 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
     for ( int i = 0; i < 6; ++i )
     {
       const TopoDS_Face& sideF = aCubeSide[i]._quad->face;
-      if ( !SMESH_MesherHelper::IsSameElemGeometry( meshDS->MeshElements( sideF ),
-                                                    SMDSGeom_QUADRANGLE,
+      const SMESHDS_SubMesh* smDS =
+        proxymesh ? proxymesh->GetSubMesh( sideF ) : meshDS->MeshElements( sideF );
+      if ( !SMESH_MesherHelper::IsSameElemGeometry( smDS, SMDSGeom_QUADRANGLE,
                                                     /*nullSubMeshRes=*/false ))
       {
         SMESH_ComputeErrorPtr err = ComputePentahedralMesh(aMesh, aShape, proxymesh.get());