Salome HOME
http://www.salome-platform.org/forum/forum_10/416888157: NetGen local mesh size in...
authoreap <eap@opencascade.com>
Mon, 5 Mar 2012 14:07:13 +0000 (14:07 +0000)
committereap <eap@opencascade.com>
Mon, 5 Mar 2012 14:07:13 +0000 (14:07 +0000)
   Move setting local size on faces after evaluation of global maxh

src/NETGENPlugin/NETGENPlugin_Mesher.cxx

index b4b7ce38deb0a926db7a62b7a0610a2270dd05e3..49f78e74efa0956efd967567e82faefee3dfc2c4 100644 (file)
@@ -1793,24 +1793,6 @@ bool NETGENPlugin_Mesher::Compute()
   NETGENPlugin_Internals internals( *_mesh, _shape, _isVolume );
   PrepareOCCgeometry( occgeo, _shape, *_mesh, meshedSM, &internals );
 
-  // -------------------------
-  // Local size on faces
-  // -------------------------
-  
-#ifdef NETGEN_NEW
-  if ( ! _simpleHyp )
-    {
-      for(std::map<int,double>::const_iterator it=FaceId2LocalSize.begin(); it!=FaceId2LocalSize.end(); it++)
-        {
-          int key = (*it).first;
-          double val = (*it).second;
-          const TopoDS_Shape& shape = ShapesWithLocalSize.FindKey(key);
-          int faceNgID = occgeo.fmap.FindIndex(shape);
-          occgeo.SetFaceMaxH(faceNgID, val);
-        }
-    }
-#endif
-  
   // -------------------------
   // Generate the mesh
   // -------------------------
@@ -1846,8 +1828,19 @@ bool NETGENPlugin_Mesher::Compute()
       mparams.maxh = occgeo.boundingbox.Diam();
     if ( _simpleHyp || ( mparams.minh == 0.0 && _fineness != NETGENPlugin_Hypothesis::UserDefined))
       mparams.minh = GetDefaultMinSize( _shape, mparams.maxh );
+
 #ifdef NETGEN_NEW
+    // Local size on faces
     occgeo.face_maxh = mparams.maxh;
+    for(map<int,double>::const_iterator it=FaceId2LocalSize.begin();
+        it!=FaceId2LocalSize.end(); it++)
+    {
+      int key = (*it).first;
+      double val = (*it).second;
+      const TopoDS_Shape& shape = ShapesWithLocalSize.FindKey(key);
+      int faceNgID = occgeo.fmap.FindIndex(shape);
+      occgeo.SetFaceMaxH(faceNgID, val);
+    }
 #endif
 
     // Let netgen create ngMesh and calculate element size on not meshed shapes