From 6cb56a9c4439a6de088e092c2cb67f3d86729a5c Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 23 Oct 2012 12:47:36 +0000 Subject: [PATCH] 0021543: EDF 1978 SMESH: Viscous layer for 2D meshes Fix UVPtStructVec on the shrinked EDGE --- src/StdMeshers/StdMeshers_ViscousLayers2D.cxx | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/StdMeshers/StdMeshers_ViscousLayers2D.cxx b/src/StdMeshers/StdMeshers_ViscousLayers2D.cxx index edbdf623d..2257104eb 100644 --- a/src/StdMeshers/StdMeshers_ViscousLayers2D.cxx +++ b/src/StdMeshers/StdMeshers_ViscousLayers2D.cxx @@ -1188,8 +1188,12 @@ bool _ViscousBuilder2D::shrink() // Get length of existing segments (from edge start to node) and their nodes const vector& points = L._wire->GetUVPtStruct(); - UVPtStructVec nodeDataVec( & points[ L._firstPntInd ], - & points[ L._lastPntInd + 1 ]); + UVPtStructVec nodeDataVec( & points[ L._firstPntInd ], + & points[ L._lastPntInd + 1 ]); + nodeDataVec.front().param = u1; // U on vertex is correct on only one of shared edges + nodeDataVec.back ().param = u2; + nodeDataVec.front().normParam = 0; + nodeDataVec.back ().normParam = 1; vector< double > segLengths( nodeDataVec.size() - 1 ); BRepAdaptor_Curve curve( E ); for ( size_t iP = 1; iP < nodeDataVec.size(); ++iP ) @@ -1493,13 +1497,15 @@ void _ViscousBuilder2D::removeMeshFaces(const TopoDS_Shape& face) { // we don't use SMESH_subMesh::ComputeStateEngine() because of a listener // which clears EDGEs together with _face. - if ( SMESHDS_SubMesh* sm = getMeshDS()->MeshElements( face )) + SMESH_subMesh* sm = _mesh->GetSubMesh( face ); + if ( SMESHDS_SubMesh* smDS = sm->GetSubMeshDS() ) { - SMDS_ElemIteratorPtr eIt = sm->GetElements(); - while ( eIt->more() ) getMeshDS()->RemoveFreeElement( eIt->next(), sm ); - SMDS_NodeIteratorPtr nIt = sm->GetNodes(); - while ( nIt->more() ) getMeshDS()->RemoveFreeNode( nIt->next(), sm ); + SMDS_ElemIteratorPtr eIt = smDS->GetElements(); + while ( eIt->more() ) getMeshDS()->RemoveFreeElement( eIt->next(), smDS ); + SMDS_NodeIteratorPtr nIt = smDS->GetNodes(); + while ( nIt->more() ) getMeshDS()->RemoveFreeNode( nIt->next(), smDS ); } + sm->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE ); } //================================================================================ -- 2.39.2