]> SALOME platform Git repositories - plugins/netgenplugin.git/blobdiff - src/NETGENPlugin/NETGENPlugin_Mesher.cxx
Salome HOME
Copyrights update 2015.
[plugins/netgenplugin.git] / src / NETGENPlugin / NETGENPlugin_Mesher.cxx
index ff2cc3f96cf5fb4cd81ad1f55500ab64b6e05f70..433c7bf7327528ffb9ba9447d5513ee16b2a6ca3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -103,10 +103,12 @@ using namespace std;
 
 #define NGPOINT_COORDS(p) p(0),p(1),p(2)
 
+#ifdef _DEBUG_
 // dump elements added to ng mesh
 //#define DUMP_SEGMENTS
 //#define DUMP_TRIANGLES
 //#define DUMP_TRIANGLES_SCRIPT "/tmp/trias.py" //!< debug AddIntVerticesInSolids()
+#endif
 
 TopTools_IndexedMapOfShape ShapesWithLocalSize;
 std::map<int,double> VertexId2LocalSize;
@@ -690,9 +692,12 @@ double NETGENPlugin_Mesher::GetDefaultMinSize(const TopoDS_Shape& geom,
  */
 //================================================================================
 
-void NETGENPlugin_Mesher::RestrictLocalSize(netgen::Mesh& ngMesh, const gp_XYZ& p, const double size)
+void NETGENPlugin_Mesher::RestrictLocalSize(netgen::Mesh& ngMesh,
+                                            const gp_XYZ& p,
+                                            const double  size,
+                                            const bool    overrideMinH)
 {
-  if ( netgen::mparam.minh > size )
+  if ( overrideMinH && netgen::mparam.minh > size )
   {
     ngMesh.SetMinimalH( size );
     netgen::mparam.minh = size;
@@ -932,8 +937,8 @@ bool NETGENPlugin_Mesher::FillNgMesh(netgen::OCCGeometry&           occgeom,
       while ( fID < faceNgID ) // geomFace is already in occgeom.fmap, add a copy
         fID = occgeom.fmap.Add( BRepBuilderAPI_Copy( geomFace, /*copyGeom=*/false ));
       // Problem with the second order in a quadrangular mesh remains.
-      // 1) All quadrangles geberated by NETGEN are moved to an inexistent face
-      //    by FillSMesh() (find AddFaceDescriptor)
+      // 1) All quadrangles generated by NETGEN are moved to an inexistent face
+      //    by FillSMesh() (find "AddFaceDescriptor")
       // 2) Temporary triangles generated by StdMeshers_QuadToTriaAdaptor
       //    are on faces where quadrangles were.
       // Due to these 2 points, wrong geom faces are used while conversion to qudratic
@@ -1230,7 +1235,7 @@ void NETGENPlugin_Mesher::AddIntVerticesInFaces(const netgen::OCCGeometry&     o
       nodeVec.push_back( nV );
 
       // get node UV
-      bool uvOK = false;
+      bool uvOK = true;
       vData.uv = helper.GetNodeUV( face, nV, 0, &uvOK );
       if ( !uvOK ) helper.CheckNodeUV( face, nV, vData.uv, BRep_Tool::Tolerance(V),/*force=*/1);
 
@@ -1594,7 +1599,8 @@ NETGENPlugin_Mesher::AddSegmentsToMesh(netgen::Mesh&                    ngMesh,
                                        netgen::OCCGeometry&             geom,
                                        const TSideVector&               wires,
                                        SMESH_MesherHelper&              helper,
-                                       vector< const SMDS_MeshNode* > & nodeVec)
+                                       vector< const SMDS_MeshNode* > & nodeVec,
+                                       const bool                       overrideMinH)
 {
   // ----------------------------
   // Check wires and count nodes
@@ -1755,7 +1761,7 @@ NETGENPlugin_Mesher::AddSegmentsToMesh(netgen::Mesh&                    ngMesh,
                         int( segLen[ i     ] > sumH / 100.)  +
                         int( segLen[ iNext ] > sumH / 100.));
         if ( nbSeg > 0 )
-          RestrictLocalSize( ngMesh, 0.5*(np1+np2), sumH / nbSeg );
+          RestrictLocalSize( ngMesh, 0.5*(np1+np2), sumH / nbSeg, overrideMinH );
       }
       if ( isInternalWire )
       {