X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_QuadToTriaAdaptor.cxx;h=9259d2e1da78a081c93fa908e9e84da2e1154cd5;hb=1c1bbf6798782cb24bcab45d519817cff125ae5c;hp=f133994fa1d1041d097d51ad43a7dfe833175ff5;hpb=436097622c7cc733ec53a59be57de90a71825a39;p=modules%2Fsmesh.git diff --git a/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx b/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx index f133994fa..9259d2e1d 100644 --- a/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx +++ b/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx @@ -615,7 +615,7 @@ bool StdMeshers_QuadToTriaAdaptor::LimitHeight (gp_Pnt& } } } - if ( height < 1e-5 * idealHeight && intFace ) + if ( height < 1e-2 * idealHeight && intFace ) return overlapError( aMesh, NotCheckedFace, intFace, Shape ); } @@ -1012,6 +1012,8 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh) groupDS = 0; } + const bool toFindVolumes = aMesh.NbVolumes() > 0; + vector myPyramids; SMESH_MesherHelper helper(aMesh); helper.IsQuadraticSubMesh(aMesh.GetShapeToMesh()); @@ -1023,6 +1025,9 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh) if ( !myElemSearcher ) myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS ); SMESH_ElementSearcher* searcher = const_cast(myElemSearcher); + SMESHUtils::Deleter + volSearcher( SMESH_MeshAlgos::GetElementSearcher( *meshDS )); + vector< const SMDS_MeshElement* > suspectFaces, foundVolumes; TColgp_Array1OfPnt PN(1,5); TColgp_Array1OfVec VN(1,4); @@ -1042,7 +1047,7 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh) if ( what == NOT_QUAD ) continue; if ( volumes[0] && volumes[1] ) - continue; // face is shared by two volumes - no space for a pyramid + continue; // face is shared by two volumes - no room for a pyramid if ( what == DEGEN_QUAD ) { @@ -1143,6 +1148,7 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh) } // Restrict pyramid height by intersection with other faces + gp_Vec tmpDir(PC,PCbest); tmpDir.Normalize(); double tmp = PN(1).Distance(PN(3)) + PN(2).Distance(PN(4)); // far points: in (PC, PCbest) direction and vice-versa @@ -1154,8 +1160,24 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh) gp_Pnt intPnt [2]; int intFaceInd [2] = { 0, 0 }; + if ( toFindVolumes && 0 ) // non-conformal mesh is not suitable for any mesher so far + { + // there are volumes in the mesh, in a non-conformal mesh an neighbor + // volume can be not found yet + for ( int isRev = 0; isRev < 2; ++isRev ) + { + if ( volumes[isRev] ) continue; + gp_Pnt testPnt = PC.XYZ() + tmpDir.XYZ() * height * ( isRev ? -0.1: 0.1 ); + foundVolumes.clear(); + if ( volSearcher->FindElementsByPoint( testPnt, SMDSAbs_Volume, foundVolumes )) + volumes[isRev] = foundVolumes[0]; + } + if ( volumes[0] && volumes[1] ) + continue; // no room for a pyramid + } + gp_Ax1 line( PC, tmpDir ); - vector< const SMDS_MeshElement* > suspectFaces; + suspectFaces.clear(); searcher->GetElementsNearLine( line, SMDSAbs_Face, suspectFaces); for ( size_t iF = 0; iF < suspectFaces.size(); ++iF ) @@ -1208,7 +1230,7 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh) if ( !intersected[isRev] ) continue; double pyramidH = Min( height, dist2int[isRev]/3. ); gp_Pnt Papex = PC.XYZ() + tmpDir.XYZ() * (isRev ? -pyramidH : pyramidH); - if ( pyramidH < 1e-5 * height ) + if ( pyramidH < 1e-2 * height ) return overlapError( aMesh, face, suspectFaces[ intFaceInd[isRev] ] ); if ( !LimitHeight( Papex, PC, PN, FNodes, aMesh, face, /*UseApexRay=*/false ))