X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_ViscousLayers2D.cxx;h=111ea47cb5a2a02dd870b91e10469dd5eed744b9;hp=585bcaf7164c2181e35fecb80b4cf8ca08f94f87;hb=bc95c31002da130977f9cdbb0a5482741c529104;hpb=f3e2b7fea2d36b7dbe2df39f3e08e9c4d9b30e6d diff --git a/src/StdMeshers/StdMeshers_ViscousLayers2D.cxx b/src/StdMeshers/StdMeshers_ViscousLayers2D.cxx index 585bcaf71..111ea47cb 100644 --- a/src/StdMeshers/StdMeshers_ViscousLayers2D.cxx +++ b/src/StdMeshers/StdMeshers_ViscousLayers2D.cxx @@ -113,6 +113,7 @@ namespace VISCOUS_2D //virtual int NbElements() const { return _elements.size()+1; } virtual int NbNodes() const { return Max( 0, _uvPtStructVec.size()-2 ); } void SetUVPtStructVec(UVPtStructVec& vec) { _uvPtStructVec.swap( vec ); } + UVPtStructVec& GetUVPtStructVec() { return _uvPtStructVec; } }; _ProxyMeshOfFace(const SMESH_Mesh& mesh): SMESH_ProxyMesh(mesh) {} _EdgeSubMesh* GetEdgeSubMesh(int ID) { return (_EdgeSubMesh*) getProxySubMesh(ID); } @@ -515,29 +516,53 @@ SMESH_ProxyMesh::Ptr StdMeshers_ViscousLayers2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Face& theFace) { - SMESH_ProxyMesh::Ptr pm; - + using namespace VISCOUS_2D; vector< const StdMeshers_ViscousLayers2D* > hyps; vector< TopoDS_Shape > hypShapes; - if ( VISCOUS_2D::findHyps( theMesh, theFace, hyps, hypShapes )) + + SMESH_ProxyMesh::Ptr pm = _ProxyMeshHolder::FindProxyMeshOfFace( theFace, theMesh ); + if ( !pm ) { - VISCOUS_2D::_ViscousBuilder2D builder( theMesh, theFace, hyps, hypShapes ); - pm = builder.Compute(); - SMESH_ComputeErrorPtr error = builder.GetError(); - if ( error && !error->IsOK() ) - theMesh.GetSubMesh( theFace )->GetComputeError() = error; - else if ( !pm ) + if ( findHyps( theMesh, theFace, hyps, hypShapes )) + { + VISCOUS_2D::_ViscousBuilder2D builder( theMesh, theFace, hyps, hypShapes ); + pm = builder.Compute(); + SMESH_ComputeErrorPtr error = builder.GetError(); + if ( error && !error->IsOK() ) + theMesh.GetSubMesh( theFace )->GetComputeError() = error; + else if ( !pm ) + pm.reset( new SMESH_ProxyMesh( theMesh )); + if ( getenv("__ONLY__VL2D__")) + pm.reset(); + } + else + { pm.reset( new SMESH_ProxyMesh( theMesh )); - if ( getenv("__ONLY__VL2D__")) - pm.reset(); - } - else - { - pm.reset( new SMESH_ProxyMesh( theMesh )); + } } return pm; } // -------------------------------------------------------------------------------- +void StdMeshers_ViscousLayers2D::SetProxyMeshOfEdge( const StdMeshers_FaceSide& edgeNodes ) +{ + using namespace VISCOUS_2D; + SMESH_ProxyMesh::Ptr pm = + _ProxyMeshHolder::FindProxyMeshOfFace( edgeNodes.Face(), *edgeNodes.GetMesh() ); + if ( !pm ) { + _ProxyMeshOfFace* proxyMeshOfFace = new _ProxyMeshOfFace( *edgeNodes.GetMesh() ); + pm.reset( proxyMeshOfFace ); + new _ProxyMeshHolder( edgeNodes.Face(), pm ); + } + _ProxyMeshOfFace* proxyMeshOfFace = static_cast<_ProxyMeshOfFace*>( pm.get() ); + _ProxyMeshOfFace::_EdgeSubMesh* sm = proxyMeshOfFace->GetEdgeSubMesh( edgeNodes.EdgeID(0) ); + sm->GetUVPtStructVec() = edgeNodes.GetUVPtStruct(); +} +// -------------------------------------------------------------------------------- +bool StdMeshers_ViscousLayers2D::HasProxyMesh( const TopoDS_Face& face, SMESH_Mesh& mesh ) +{ + return VISCOUS_2D::_ProxyMeshHolder::FindProxyMeshOfFace( face, mesh ); +} +// -------------------------------------------------------------------------------- SMESH_ComputeErrorPtr StdMeshers_ViscousLayers2D::CheckHypothesis(SMESH_Mesh& theMesh, const TopoDS_Shape& theShape,