From: eap Date: Thu, 30 Dec 2010 07:53:30 +0000 (+0000) Subject: 0020832: EDF 1359 SMESH : Automatic meshing of boundary layers X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ffd9eeb06274fe662354a013be89450279798313;p=plugins%2Fghs3dplugin.git 0020832: EDF 1359 SMESH : Automatic meshing of boundary layers make proxy mesh die as soon as ghs3d input file has been created --- diff --git a/src/GHS3DPlugin_GHS3D.cxx b/src/GHS3DPlugin_GHS3D.cxx index f8b5465..c2467d3 100644 --- a/src/GHS3DPlugin_GHS3D.cxx +++ b/src/GHS3DPlugin_GHS3D.cxx @@ -1283,40 +1283,43 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh& theMesh, } catch(...) { } - + SMESH_MesherHelper helper( theMesh ); helper.SetSubShape( theShape ); - StdMeshers_ProxyMesh::Ptr proxyMesh( new StdMeshers_ProxyMesh( theMesh )); - - // make prisms on quadrangles - if ( theMesh.NbQuadrangles() > 0 ) { - vector components; - for (expBox.ReInit(); expBox.More(); expBox.Next()) + StdMeshers_ProxyMesh::Ptr proxyMesh( new StdMeshers_ProxyMesh( theMesh )); + + // make prisms on quadrangles + if ( theMesh.NbQuadrangles() > 0 ) { - if ( _viscousLayersHyp ) + vector components; + for (expBox.ReInit(); expBox.More(); expBox.Next()) { - proxyMesh = _viscousLayersHyp->Compute( theMesh, expBox.Current() ); - if ( !proxyMesh ) - return false; + if ( _viscousLayersHyp ) + { + proxyMesh = _viscousLayersHyp->Compute( theMesh, expBox.Current() ); + if ( !proxyMesh ) + return false; + } + StdMeshers_QuadToTriaAdaptor* q2t = new StdMeshers_QuadToTriaAdaptor; + q2t->Compute( theMesh, expBox.Current(), proxyMesh.get() ); + components.push_back( StdMeshers_ProxyMesh::Ptr( q2t )); } - StdMeshers_QuadToTriaAdaptor* q2t = new StdMeshers_QuadToTriaAdaptor; - q2t->Compute( theMesh, expBox.Current(), proxyMesh.get() ); - components.push_back( StdMeshers_ProxyMesh::Ptr( q2t )); + proxyMesh.reset( new StdMeshers_ProxyMesh( components )); + } + // build viscous layers + else if ( _viscousLayersHyp ) + { + proxyMesh = _viscousLayersHyp->Compute( theMesh, theShape ); + if ( !proxyMesh ) + return false; } - proxyMesh.reset( new StdMeshers_ProxyMesh( components )); - } - // build viscous layers - else if ( _viscousLayersHyp ) - { - proxyMesh = _viscousLayersHyp->Compute( theMesh, theShape ); - if ( !proxyMesh ) - return false; - } - Ok = (writePoints( aPointsFile, helper, aSmdsToGhs3dIdMap, aGhs3dIdToNodeMap, enforcedVertices) && - writeFaces ( aFacesFile, *proxyMesh, theShape, aSmdsToGhs3dIdMap )); + Ok = (writePoints( aPointsFile, helper, aSmdsToGhs3dIdMap, aGhs3dIdToNodeMap, enforcedVertices) + && + writeFaces ( aFacesFile, *proxyMesh, theShape, aSmdsToGhs3dIdMap )); + } // Write aSmdsToGhs3dIdMap to temp file TCollection_AsciiString aSmdsToGhs3dIdMapFileName;