X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_Hexa_3D.cxx;h=8c54ad4e801a676338b67a2c7bbb0c2fa9290daa;hb=65efd98e778a48079e58b3c73b85608d48bcb40a;hp=22b658de4e450c8ebb89adbe7cc693b719c1aa70;hpb=6aea23b893abc82fbeecf5924d0939370c110271;p=modules%2Fsmesh.git diff --git a/src/StdMeshers/StdMeshers_Hexa_3D.cxx b/src/StdMeshers/StdMeshers_Hexa_3D.cxx index 22b658de4..8c54ad4e8 100644 --- a/src/StdMeshers/StdMeshers_Hexa_3D.cxx +++ b/src/StdMeshers/StdMeshers_Hexa_3D.cxx @@ -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()); @@ -743,29 +738,35 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHelper //================================================================================ /*! - * \brief Return true if applied compute mesh on this shape + * \brief Return true if the algorithm can mesh this shape + * \param [in] aShape - shape to check + * \param [in] toCheckAll - if true, this check returns OK if all shapes are OK, + * else, returns OK if at least one shape is OK */ //================================================================================ bool StdMeshers_Hexa_3D::IsApplicable( const TopoDS_Shape & aShape, bool toCheckAll ) { - TopoDS_Vertex theVertex0, theVertex1; - TopTools_IndexedMapOfOrientedShape theShapeIDMap; - bool isCurShellApp; - int nbFoundShells = 0; - bool isEmpty = true; - for ( TopExp_Explorer exp0( aShape, TopAbs_SOLID ); exp0.More(); exp0.Next() ){ - nbFoundShells = 0; - for (TopExp_Explorer exp1( exp0.Current(), TopAbs_SHELL ); exp1.More(); exp1.Next(), ++nbFoundShells){ - TopoDS_Shell shell = TopoDS::Shell(exp1.Current()); - isCurShellApp = SMESH_Block::FindBlockShapes(shell, theVertex0, theVertex1, theShapeIDMap ); - if( ( toCheckAll && !isCurShellApp ) || nbFoundShells == 1 ) return false; - isEmpty = false; - } - if( !toCheckAll && isCurShellApp ) return true; + TopExp_Explorer exp0( aShape, TopAbs_SOLID ); + if ( !exp0.More() ) return false; + + for ( ; exp0.More(); exp0.Next() ) + { + int nbFoundShells = 0; + TopExp_Explorer exp1( exp0.Current(), TopAbs_SHELL ); + for ( ; exp1.More(); exp1.Next(), ++nbFoundShells) + if ( nbFoundShells == 2 ) break; + if ( nbFoundShells != 1 ) { + if ( toCheckAll ) return false; + continue; + } + exp1.Init( exp0.Current(), TopAbs_FACE ); + int nbEdges = SMESH_MesherHelper::Count( exp1.Current(), TopAbs_EDGE, /*ignoreSame=*/true ); + bool ok = ( nbEdges > 3 ); + if ( toCheckAll && !ok ) return false; + if ( !toCheckAll && ok ) return true; } - if( toCheckAll && !isEmpty) return true; - return false; + return toCheckAll; }; //=======================================================================