]> SALOME platform Git repositories - plugins/ghs3dplugin.git/commitdiff
Salome HOME
0020832: EDF 1359 SMESH : Automatic meshing of boundary layers
authoreap <eap@opencascade.com>
Thu, 30 Dec 2010 07:53:30 +0000 (07:53 +0000)
committereap <eap@opencascade.com>
Thu, 30 Dec 2010 07:53:30 +0000 (07:53 +0000)
   make proxy mesh die as soon as ghs3d input file has been created

src/GHS3DPlugin_GHS3D.cxx

index f8b54659570fb363ae55486f6cdb18fb2fe726c1..c2467d3ddc192367534508caa07bee82f64b8d80 100644 (file)
@@ -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<StdMeshers_ProxyMesh::Ptr> 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<StdMeshers_ProxyMesh::Ptr> 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;