0022130: EDF 2579 SMESH: Issue with Viscous Layer

fix detection of the closed EDGE
This commit is contained in:
eap 2013-02-20 16:06:58 +00:00
parent f35cfb87a0
commit 469f938766

View File

@ -442,7 +442,7 @@ StdMeshers_ViscousLayers2D::Compute(SMESH_Mesh& theMesh,
theMesh.GetSubMesh( theFace )->GetComputeError() = error; theMesh.GetSubMesh( theFace )->GetComputeError() = error;
else if ( !pm ) else if ( !pm )
pm.reset( new SMESH_ProxyMesh( theMesh )); pm.reset( new SMESH_ProxyMesh( theMesh ));
if ( getenv("ONLY_VL2D")) if ( getenv("__ONLY__VL2D__"))
pm.reset(); pm.reset();
} }
else else
@ -1834,13 +1834,14 @@ bool _ViscousBuilder2D::refine()
normPar[ i - L._firstPntInd ] = ( points[i].normParam - normF ) / normDist; normPar[ i - L._firstPntInd ] = ( points[i].normParam - normF ) / normDist;
// Create layers of faces // Create layers of faces
bool hasLeftNode = ( !L._leftLine->_rightNodes.empty() && leftEdgeShared ); bool hasLeftNode = ( !L._leftLine->_rightNodes.empty() && leftEdgeShared );
bool hasRightNode = ( !L._rightLine->_leftNodes.empty() && rightEdgeShared ); bool hasRightNode = ( !L._rightLine->_leftNodes.empty() && rightEdgeShared );
bool hasOwnLeftNode = ( !L._leftNodes.empty() ); bool hasOwnLeftNode = ( !L._leftNodes.empty() );
bool hasOwnRightNode = ( !L._rightNodes.empty() ); bool hasOwnRightNode = ( !L._rightNodes.empty() );
bool isClosedEdge = ( outerNodes.front() == outerNodes.back() );
size_t iS, size_t iS,
iN0 = ( hasLeftNode || hasOwnLeftNode || _polyLineVec.size() == 1 ), iN0 = ( hasLeftNode || hasOwnLeftNode || isClosedEdge ),
nbN = innerNodes.size() - ( hasRightNode || hasOwnRightNode ); nbN = innerNodes.size() - ( hasRightNode || hasOwnRightNode );
L._leftNodes .reserve( _hyp->GetNumberLayers() ); L._leftNodes .reserve( _hyp->GetNumberLayers() );
L._rightNodes.reserve( _hyp->GetNumberLayers() ); L._rightNodes.reserve( _hyp->GetNumberLayers() );
@ -1872,7 +1873,7 @@ bool _ViscousBuilder2D::refine()
else if ( hasLeftNode ) innerNodes.front() = L._leftLine->_rightNodes[ iF ]; else if ( hasLeftNode ) innerNodes.front() = L._leftLine->_rightNodes[ iF ];
if ( hasOwnRightNode ) innerNodes.back() = L._rightNodes[ iF ]; if ( hasOwnRightNode ) innerNodes.back() = L._rightNodes[ iF ];
else if ( hasRightNode ) innerNodes.back() = L._rightLine->_leftNodes[ iF ]; else if ( hasRightNode ) innerNodes.back() = L._rightLine->_leftNodes[ iF ];
if ( _polyLineVec.size() == 1 ) innerNodes.front() = innerNodes.back(); // circle if ( isClosedEdge ) innerNodes.front() = innerNodes.back(); // circle
if ( !hasOwnLeftNode ) L._leftNodes.push_back( innerNodes.front() ); if ( !hasOwnLeftNode ) L._leftNodes.push_back( innerNodes.front() );
if ( !hasOwnRightNode ) L._rightNodes.push_back( innerNodes.back() ); if ( !hasOwnRightNode ) L._rightNodes.push_back( innerNodes.back() );