Salome HOME
Cleanup of parallel meshing + documentation
[modules/smesh.git] / src / StdMeshers / StdMeshers_Cartesian_3D.cxx
index c847d9efb3a7fbc880b18337c5b1ae257221064d..1973209acc43ac9f3b6af19c15688095966678b4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022  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
@@ -977,10 +977,7 @@ namespace
     int         _origNodeInd; // index of _hexNodes[0] node within the _grid
     size_t      _i,_j,_k;
     bool        _hasTooSmall;
-
-#ifdef _DEBUG_
     int         _cellID;
-#endif
 
   public:
     Hexahedron(Grid* grid);
@@ -1243,7 +1240,7 @@ namespace
       if ( solids.size() == 2 )
       {
         if ( solids == solidsBef )
-          return theUndefID; //solids.contain( prevID ) ? solids.otherThan( prevID ) : theUndefID;
+          return solids.contain( prevID ) ? solids.otherThan( prevID ) : theUndefID; // bos #29212
       }
       return solids.oneCommon( solidsBef );
     }
@@ -2429,11 +2426,9 @@ namespace
         tgtLink._link    = _hexLinks + ( srcLink._link - other._hexLinks );
       }
     }
-#ifdef _DEBUG_
-    _cellID = cellID;
-#else
-    (void)cellID; // unused in release mode
-#endif
+    
+    if (SALOME::VerbosityActivated())
+      _cellID = cellID;
   }
 
   //================================================================================
@@ -2847,7 +2842,7 @@ namespace
       solid = _grid->GetSolid();
       if ( !_grid->_geometry.IsOneSolid() )
       {
-        TGeomID solidIDs[20];
+        TGeomID solidIDs[20] = { 0 };
         size_t nbSolids = getSolids( solidIDs );
         if ( nbSolids > 1 )
         {
@@ -4249,11 +4244,10 @@ namespace
         h->_eIntPoints.reserve(2);
         h->_eIntPoints.push_back( ip );
         added = true;
-#ifdef _DEBUG_
+
         // check if ip is really inside the hex
-        if ( h->isOutParam( ip->_uvw ))
+        if (SALOME::VerbosityActivated() && h->isOutParam( ip->_uvw ))
           throw SALOME_Exception("ip outside a hex");
-#endif
       }
     }
     return added;
@@ -4458,7 +4452,7 @@ namespace
 
     // connect pn2 (probably new, at _eIntNodes) with a split
 
-    int i, iConn;
+    int i, iConn = 0;
     size_t nbCommon;
     TGeomID commonFaces[20];
     _Node* nPrev = nullptr;
@@ -4816,11 +4810,13 @@ namespace
             helper.GetMeshDS()->RemoveFreeElement( v, /*sm=*/nullptr, /*fromGroups=*/false );
             v = nullptr;
             //_hasTooSmall = true;
-#ifdef _DEBUG_
-            std::cout << "Remove INVALID polyhedron, _cellID = " << _cellID
-                      << " ijk = ( " << _i << " " << _j << " " << _k << " ) "
-                      << " solid " << volDef->_solidID << std::endl;
-#endif
+
+            if (SALOME::VerbosityActivated())
+            {
+              std::cout << "Remove INVALID polyhedron, _cellID = " << _cellID
+                        << " ijk = ( " << _i << " " << _j << " " << _k << " ) "
+                        << " solid " << volDef->_solidID << std::endl;
+            }
           }
         }
       }
@@ -5253,14 +5249,14 @@ namespace
    */
   bool Hexahedron::debugDumpLink( Hexahedron::_Link* link )
   {
-#ifdef _DEBUG_
-    gp_Pnt p1 = link->_nodes[0]->Point(), p2 = link->_nodes[1]->Point();
-    cout << "BUG: not shared link. IKJ = ( "<< _i << " " << _j << " " << _k << " )" << endl
-         << "n1 (" << p1.X() << ", "<< p1.Y() << ", "<< p1.Z() << " )" << endl
-         << "n2 (" << p2.X() << ", "<< p2.Y() << ", "<< p2.Z() << " )" << endl;
-#else
-    (void)link; // unused in release mode
-#endif
+    if (SALOME::VerbosityActivated())
+    {
+      gp_Pnt p1 = link->_nodes[0]->Point(), p2 = link->_nodes[1]->Point();
+      cout << "BUG: not shared link. IKJ = ( "<< _i << " " << _j << " " << _k << " )" << endl
+          << "n1 (" << p1.X() << ", "<< p1.Y() << ", "<< p1.Z() << " )" << endl
+          << "n2 (" << p2.X() << ", "<< p2.Y() << ", "<< p2.Z() << " )" << endl;
+    }
+
     return false;
   }
   //================================================================================