Salome HOME
Copyright update 2021
[modules/smesh.git] / src / SMDS / SMDS_Downward.cxx
index d6049c0bd198a319d4a3b15bc20e35fb38d4570b..76c71911e5cc52fd42c41ab4b46f2cb0b80fa7cf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2010-2021  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -61,6 +61,7 @@ int SMDS_Downward::getCellDimension(unsigned char cellType)
       _cellDimension[VTK_TRIQUADRATIC_HEXAHEDRON] = 3;
       _cellDimension[VTK_WEDGE] = 3;
       _cellDimension[VTK_QUADRATIC_WEDGE] = 3;
+      _cellDimension[VTK_BIQUADRATIC_QUADRATIC_WEDGE] = 3;
       _cellDimension[VTK_PYRAMID] = 3;
       _cellDimension[VTK_QUADRATIC_PYRAMID] = 3;
       _cellDimension[VTK_HEXAGONAL_PRISM] = 3;
@@ -121,7 +122,7 @@ int SMDS_Downward::addCell(int vtkId)
  *
  * @param cellId
  */
-void SMDS_Downward::initCell(int cellId)
+void SMDS_Downward::initCell(int /*cellId*/)
 {
 }
 
@@ -130,7 +131,7 @@ void SMDS_Downward::initCell(int cellId)
  * @param cellId not used here.
  * @return
  */
-int SMDS_Downward::getNumberOfDownCells(int cellId)
+int SMDS_Downward::getNumberOfDownCells(int /*cellId*/)
 {
   return _nbDownCells;
 }
@@ -153,7 +154,7 @@ const int* SMDS_Downward::getDownCells(int cellId)
  * @param cellId index of the cell in the downward structure relative to a vtk cell type.
  * @return table of downward entities types.
  */
-const unsigned char* SMDS_Downward::getDownTypes(int cellId)
+const unsigned char* SMDS_Downward::getDownTypes(int /*cellId*/)
 {
   return &_cellTypes[0];
 }
@@ -164,7 +165,7 @@ const unsigned char* SMDS_Downward::getDownTypes(int cellId)
  * @param lowCellId index of the children cell to add (dimension n-1)
  * @param aType vtk cell type of the cell to add (needed to find the SMDS_Downward structure containing the cell to add).
  */
-void SMDS_Downward::addDownCell(int cellId, int lowCellId, unsigned char aType)
+void SMDS_Downward::addDownCell(int /*cellId*/, int /*lowCellId*/, unsigned char /*aType*/)
 {
   ASSERT(0); // must be re-implemented in derived class
 }
@@ -175,12 +176,12 @@ void SMDS_Downward::addDownCell(int cellId, int lowCellId, unsigned char aType)
  * @param upCellId index of the parent cell to add (dimension n+1)
  * @param aType vtk cell type of the cell to add (needed to find the SMDS_Downward structure containing the cell to add).
  */
-void SMDS_Downward::addUpCell(int cellId, int upCellId, unsigned char aType)
+void SMDS_Downward::addUpCell(int /*cellId*/, int /*upCellId*/, unsigned char /*aType*/)
 {
   ASSERT(0); // must be re-implemented in derived class
 }
 
-int SMDS_Downward::getNodeSet(int cellId, int* nodeSet)
+int SMDS_Downward::getNodeSet(int /*cellId*/, int* /*nodeSet*/)
 {
   return 0;
 }
@@ -217,13 +218,13 @@ void SMDS_Down1D::initCell(int cellId)
  */
 void SMDS_Down1D::allocate(int nbElems)
 {
-  if (nbElems >= _vtkCellIds.size())
-    {
-      _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1);
-      _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
-      _upCellIdsVector.resize(nbElems + SMDS_Mesh::chunkSize);
-      _upCellTypesVector.resize(nbElems + SMDS_Mesh::chunkSize);
-    }
+  if (nbElems >= (int)_vtkCellIds.size())
+  {
+    _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1);
+    _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
+    _upCellIdsVector.resize(nbElems + SMDS_Mesh::chunkSize);
+    _upCellTypesVector.resize(nbElems + SMDS_Mesh::chunkSize);
+  }
 }
 
 void SMDS_Down1D::compactStorage()
@@ -239,15 +240,15 @@ void SMDS_Down1D::compactStorage()
   _upCellIndex.resize(_maxId + 1, -1); // id and types of rank i correspond to [ _upCellIndex[i], _upCellIndex[i+1] [
   int current = 0;
   for (int i = 0; i < _maxId; i++)
+  {
+    _upCellIndex[i] = current;
+    for (size_t j = 0; j < _upCellIdsVector[i].size(); j++)
     {
-      _upCellIndex[i] = current;
-      for (int j = 0; j < _upCellIdsVector[i].size(); j++)
-        {
-          _upCellIds[current] = _upCellIdsVector[i][j];
-          _upCellTypes[current] = _upCellTypesVector[i][j];
-          current++;
-        }
+      _upCellIds[current] = _upCellIdsVector[i][j];
+      _upCellTypes[current] = _upCellTypesVector[i][j];
+      current++;
     }
+  }
   _upCellIndex[_maxId] = current;
 
   _upCellIdsVector.clear();
@@ -303,7 +304,7 @@ int SMDS_Down1D::getNodeSet(int cellId, int* nodeSet)
 void SMDS_Down1D::setNodes(int cellId, int vtkId)
 {
   vtkIdType npts = 0;
-  vtkIdType *pts; // will refer to the point id's of the face
+  vtkIdType const *pts(nullptr); // will refer to the point id's of the face
   _grid->GetCellPoints(vtkId, npts, pts);
   // MESSAGE(vtkId << " " << npts << "  " << _nbDownCells);
   //ASSERT(npts == _nbDownCells);
@@ -532,7 +533,7 @@ int SMDS_Down2D::computeVolumeIds(int cellId, int* ids)
   // --- find point id's of the face
 
   vtkIdType npts = 0;
-  vtkIdType *pts; // will refer to the point id's of the face
+  vtkIdType const *pts(nullptr); // will refer to the point id's of the face
   _grid->GetCellPoints(cellId, npts, pts);
   vector<int> nodes;
   for (int i = 0; i < npts; i++)
@@ -627,7 +628,7 @@ int SMDS_Down2D::computeVolumeIdsFromNodesFace(int* pts, int npts, int* ids)
 void SMDS_Down2D::setTempNodes(int cellId, int vtkId)
 {
   vtkIdType npts = 0;
-  vtkIdType *pts; // will refer to the point id's of the face
+  vtkIdType const *pts(nullptr); // will refer to the point id's of the face
   _grid->GetCellPoints(vtkId, npts, pts);
   // MESSAGE(vtkId << " " << npts << "  " << _nbNodes);
   //ASSERT(npts == _nbNodes);
@@ -674,14 +675,14 @@ bool SMDS_Down2D::isInFace(int cellId, int *pts, int npts)
  */
 void SMDS_Down2D::allocate(int nbElems)
 {
-  if (nbElems >= _vtkCellIds.size())
-    {
-      _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
-      _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1);
-      _upCellIds.resize(2 * (nbElems + SMDS_Mesh::chunkSize), -1);
-      _upCellTypes.resize(2 * (nbElems + SMDS_Mesh::chunkSize), -1);
-      _tempNodes.resize(_nbNodes * (nbElems + SMDS_Mesh::chunkSize), -1);
-    }
+  if (nbElems >= (int)_vtkCellIds.size())
+  {
+    _cellIds.resize    (_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
+    _vtkCellIds.resize (nbElems + SMDS_Mesh::chunkSize, -1);
+    _upCellIds.resize  (2 * (nbElems + SMDS_Mesh::chunkSize), -1);
+    _upCellTypes.resize(2 * (nbElems + SMDS_Mesh::chunkSize), -1);
+    _tempNodes.resize  (_nbNodes * (nbElems + SMDS_Mesh::chunkSize), -1);
+  }
 }
 
 void SMDS_Down2D::compactStorage()
@@ -764,11 +765,11 @@ SMDS_Down3D::~SMDS_Down3D()
 
 void SMDS_Down3D::allocate(int nbElems)
 {
-  if (nbElems >= _vtkCellIds.size())
-    {
-      _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
-      _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1);
-    }
+  if (nbElems >= (int)_vtkCellIds.size())
+  {
+    _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
+    _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1);
+  }
 }
 
 void SMDS_Down3D::compactStorage()
@@ -776,17 +777,17 @@ void SMDS_Down3D::compactStorage()
   // nothing to do, size was known before
 }
 
-int SMDS_Down3D::getNumberOfUpCells(int cellId)
+int SMDS_Down3D::getNumberOfUpCells(int /*cellId*/)
 {
   return 0;
 }
 
-const int* SMDS_Down3D::getUpCells(int cellId)
+const int* SMDS_Down3D::getUpCells(int /*cellId*/)
 {
   return 0;
 }
 
-const unsigned char* SMDS_Down3D::getUpTypes(int cellId)
+const unsigned char* SMDS_Down3D::getUpTypes(int /*cellId*/)
 {
   return 0;
 }
@@ -795,7 +796,7 @@ void SMDS_Down3D::getNodeIds(int cellId, std::set<int>& nodeSet)
 {
   int vtkId = this->_vtkCellIds[cellId];
   vtkIdType npts = 0;
-  vtkIdType *nodes; // will refer to the point id's of the volume
+  vtkIdType const *nodes(nullptr); // will refer to the point id's of the volume
   _grid->GetCellPoints(vtkId, npts, nodes);
   for (int i = 0; i < npts; i++)
     nodeSet.insert(nodes[i]);
@@ -903,7 +904,7 @@ void SMDS_DownTriangle::computeEdgesWithNodes(int cellId, ListElemByNodesType& e
   edgesWithNodes.elems[2].vtkType = VTK_LINE;
 }
 
-void SMDS_DownTriangle::addDownCell(int cellId, int lowCellId, unsigned char aType)
+void SMDS_DownTriangle::addDownCell(int cellId, int lowCellId, unsigned char /*aType*/)
 {
   //ASSERT((cellId >=0)&& (cellId < _maxId));
   //ASSERT(aType == VTK_LINE);
@@ -960,7 +961,7 @@ void SMDS_DownQuadTriangle::computeEdgesWithNodes(int cellId, ListElemByNodesTyp
   edgesWithNodes.elems[2].vtkType = VTK_QUADRATIC_EDGE;
 }
 
-void SMDS_DownQuadTriangle::addDownCell(int cellId, int lowCellId, unsigned char aType)
+void SMDS_DownQuadTriangle::addDownCell(int cellId, int lowCellId, unsigned char /*aType*/)
 {
   //ASSERT((cellId >=0)&& (cellId < _maxId));
   //ASSERT(aType == VTK_QUADRATIC_EDGE);
@@ -1020,7 +1021,7 @@ void SMDS_DownQuadrangle::computeEdgesWithNodes(int cellId, ListElemByNodesType&
   edgesWithNodes.elems[3].vtkType = VTK_LINE;
 }
 
-void SMDS_DownQuadrangle::addDownCell(int cellId, int lowCellId, unsigned char aType)
+void SMDS_DownQuadrangle::addDownCell(int cellId, int lowCellId, unsigned char /*aType*/)
 {
   //ASSERT((cellId >=0)&& (cellId < _maxId));
   //ASSERT(aType == VTK_LINE);
@@ -1084,7 +1085,7 @@ void SMDS_DownQuadQuadrangle::computeEdgesWithNodes(int cellId, ListElemByNodesT
   edgesWithNodes.elems[3].vtkType = VTK_QUADRATIC_EDGE;
 }
 
-void SMDS_DownQuadQuadrangle::addDownCell(int cellId, int lowCellId, unsigned char aType)
+void SMDS_DownQuadQuadrangle::addDownCell(int cellId, int lowCellId, unsigned char /*aType*/)
 {
   //ASSERT((cellId >=0)&& (cellId < _maxId));
   //ASSERT(aType == VTK_QUADRATIC_EDGE);
@@ -1121,35 +1122,35 @@ void SMDS_DownTetra::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& o
 {
   set<int> setNodes;
   setNodes.clear();
-  for (int i = 0; i < orderedNodes.size(); i++)
+  for ( size_t i = 0; i < orderedNodes.size(); i++ )
     setNodes.insert(orderedNodes[i]);
   //MESSAGE("cellId = " << cellId);
 
   vtkIdType npts = 0;
-  vtkIdType *nodes; // will refer to the point id's of the volume
+  vtkIdType const *nodes(nullptr); // will refer to the point id's of the volume
   _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
 
   set<int> tofind;
   int ids[12] = { 0, 1, 2,  0, 3, 1,  2, 3, 0,   1, 3, 2 };
-//int ids[12] = { 2, 1, 0,  1, 3, 0,  0, 3, 2,   2, 3, 1 };
+  //int ids[12] = { 2, 1, 0,  1, 3, 0,  0, 3, 2,   2, 3, 1 };
   for (int k = 0; k < 4; k++)
+  {
+    tofind.clear();
+    for (int i = 0; i < 3; i++)
+      tofind.insert(nodes[ids[3 * k + i]]);
+    if (setNodes == tofind)
     {
-      tofind.clear();
       for (int i = 0; i < 3; i++)
-        tofind.insert(nodes[ids[3 * k + i]]);
-      if (setNodes == tofind)
-        {
-          for (int i = 0; i < 3; i++)
-            orderedNodes[i] = nodes[ids[3 * k + i]];
-          return;
-        }
+        orderedNodes[i] = nodes[ids[3 * k + i]];
+      return;
     }
-  MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId]));
+  }
+  MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->FromVtkToSmds(_vtkCellIds[cellId]));
   MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2]);
   MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]);
 }
 
-void SMDS_DownTetra::addDownCell(int cellId, int lowCellId, unsigned char aType)
+void SMDS_DownTetra::addDownCell(int cellId, int lowCellId, unsigned char /*aType*/)
 {
   //ASSERT((cellId >=0)&& (cellId < _maxId));
   //ASSERT(aType == VTK_TRIANGLE);
@@ -1178,7 +1179,7 @@ void SMDS_DownTetra::computeFacesWithNodes(int cellId, ListElemByNodesType& face
   // --- find point id's of the volume
 
   vtkIdType npts = 0;
-  vtkIdType *nodes; // will refer to the point id's of the volume
+  vtkIdType const *nodes(nullptr); // will refer to the point id's of the volume
   _grid->GetCellPoints(cellId, npts, nodes);
 
   // --- create all the ordered list of node id's for each face
@@ -1229,35 +1230,35 @@ void SMDS_DownQuadTetra::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType
 {
   set<int> setNodes;
   setNodes.clear();
-  for (int i = 0; i < orderedNodes.size(); i++)
+  for ( size_t i = 0; i < orderedNodes.size(); i++ )
     setNodes.insert(orderedNodes[i]);
   //MESSAGE("cellId = " << cellId);
 
   vtkIdType npts = 0;
-  vtkIdType *nodes; // will refer to the point id's of the volume
+  vtkIdType const *nodes(nullptr); // will refer to the point id's of the volume
   _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
 
   set<int> tofind;
   int ids[24] = { 0, 1, 2, 4, 5, 6,  0, 3, 1, 7, 8, 4,  2, 3, 0, 9, 7, 6,  1, 3, 2, 8, 9, 5 };
-//int ids[24] = { 2, 1, 0, 5, 4, 6,  1, 3, 0, 8, 7, 4,  0, 3, 2, 7, 9, 6,  2, 3, 1, 9, 8, 5 };
+  //int ids[24] = { 2, 1, 0, 5, 4, 6,  1, 3, 0, 8, 7, 4,  0, 3, 2, 7, 9, 6,  2, 3, 1, 9, 8, 5 };
   for (int k = 0; k < 4; k++)
+  {
+    tofind.clear();
+    for (int i = 0; i < 6; i++)
+      tofind.insert(nodes[ids[6 * k + i]]);
+    if (setNodes == tofind)
     {
-      tofind.clear();
       for (int i = 0; i < 6; i++)
-        tofind.insert(nodes[ids[6 * k + i]]);
-      if (setNodes == tofind)
-        {
-          for (int i = 0; i < 6; i++)
-            orderedNodes[i] = nodes[ids[6 * k + i]];
-          return;
-        }
+        orderedNodes[i] = nodes[ids[6 * k + i]];
+      return;
     }
-  MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId]));
+  }
+  MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->FromVtkToSmds(_vtkCellIds[cellId]));
   MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2]);
   MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]);
 }
 
-void SMDS_DownQuadTetra::addDownCell(int cellId, int lowCellId, unsigned char aType)
+void SMDS_DownQuadTetra::addDownCell(int cellId, int lowCellId, unsigned char /*aType*/)
 {
   //ASSERT((cellId >=0)&& (cellId < _maxId));
   //ASSERT(aType == VTK_QUADRATIC_TRIANGLE);
@@ -1288,7 +1289,7 @@ void SMDS_DownQuadTetra::computeFacesWithNodes(int cellId, ListElemByNodesType&
   // --- find point id's of the volume
 
   vtkIdType npts = 0;
-  vtkIdType *nodes; // will refer to the point id's of the volume
+  vtkIdType const *nodes(nullptr); // will refer to the point id's of the volume
   _grid->GetCellPoints(cellId, npts, nodes);
 
   // --- create all the ordered list of node id's for each face
@@ -1352,12 +1353,12 @@ void SMDS_DownPyramid::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>&
 {
   set<int> setNodes;
   setNodes.clear();
-  for (int i = 0; i < orderedNodes.size(); i++)
+  for ( size_t i = 0; i < orderedNodes.size(); i++ )
     setNodes.insert(orderedNodes[i]);
   //MESSAGE("cellId = " << cellId);
 
   vtkIdType npts = 0;
-  vtkIdType *nodes; // will refer to the point id's of the volume
+  vtkIdType const *nodes(nullptr); // will refer to the point id's of the volume
   _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
 
   set<int> tofind;
@@ -1368,25 +1369,25 @@ void SMDS_DownPyramid::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>&
   for (int i = 0; i < 4; i++)
     tofind.insert(nodes[ids[i]]);
   if (setNodes == tofind)
-    {
-      for (int i = 0; i < 4; i++)
-        orderedNodes[i] = nodes[ids[i]];
-      return;
-    }
+  {
+    for (int i = 0; i < 4; i++)
+      orderedNodes[i] = nodes[ids[i]];
+    return;
+  }
   // Triangular faces
   for (int k = 0; k < 4; k++)
+  {
+    tofind.clear();
+    for (int i = 0; i < 3; i++)
+      tofind.insert(nodes[ids[4 + 3 * k + i]]);
+    if (setNodes == tofind)
     {
-      tofind.clear();
       for (int i = 0; i < 3; i++)
-        tofind.insert(nodes[ids[4 + 3 * k + i]]);
-      if (setNodes == tofind)
-        {
-          for (int i = 0; i < 3; i++)
-            orderedNodes[i] = nodes[ids[4 + 3 * k + i]];
-          return;
-        }
+        orderedNodes[i] = nodes[ids[4 + 3 * k + i]];
+      return;
     }
-  MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId]));
+  }
+  MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->FromVtkToSmds(_vtkCellIds[cellId]));
   MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2]);
   MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]);
 }
@@ -1435,7 +1436,7 @@ void SMDS_DownPyramid::computeFacesWithNodes(int cellId, ListElemByNodesType& fa
   // --- find point id's of the volume
 
   vtkIdType npts = 0;
-  vtkIdType *nodes; // will refer to the point id's of the volume
+  vtkIdType const *nodes(nullptr); // will refer to the point id's of the volume
   _grid->GetCellPoints(cellId, npts, nodes);
 
   // --- create all the ordered list of node id's for each face
@@ -1492,15 +1493,15 @@ SMDS_DownQuadPyramid::~SMDS_DownQuadPyramid()
 
 void SMDS_DownQuadPyramid::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& orderedNodes)
 {
-//   MESSAGE("SMDS_DownQuadPyramid::getOrderedNodesOfFace cellId = " << cellId);
+  //   MESSAGE("SMDS_DownQuadPyramid::getOrderedNodesOfFace cellId = " << cellId);
   set<int> setNodes;
   setNodes.clear();
-  for (int i = 0; i < orderedNodes.size(); i++)
+  for ( size_t i = 0; i < orderedNodes.size(); i++)
     setNodes.insert(orderedNodes[i]);
   //MESSAGE("cellId = " << cellId);
 
   vtkIdType npts = 0;
-  vtkIdType *nodes; // will refer to the point id's of the volume
+  vtkIdType const *nodes(nullptr); // will refer to the point id's of the volume
   _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
 
   set<int> tofind;
@@ -1512,25 +1513,25 @@ void SMDS_DownQuadPyramid::getOrderedNodesOfFace(int cellId, std::vector<vtkIdTy
   for (int i = 0; i < 8; i++)
     tofind.insert(nodes[ids[i]]);
   if (setNodes == tofind)
-    {
-      for (int i = 0; i < 8; i++)
-        orderedNodes[i] = nodes[ids[i]];
-      return;
-    }
+  {
+    for (int i = 0; i < 8; i++)
+      orderedNodes[i] = nodes[ids[i]];
+    return;
+  }
   // Triangular faces
   for (int k = 0; k < 4; k++)
+  {
+    tofind.clear();
+    for (int i = 0; i < 6; i++)
+      tofind.insert(nodes[ids[8 + 6 * k + i]]);
+    if (setNodes == tofind)
     {
-      tofind.clear();
       for (int i = 0; i < 6; i++)
-        tofind.insert(nodes[ids[8 + 6 * k + i]]);
-      if (setNodes == tofind)
-        {
-          for (int i = 0; i < 6; i++)
-            orderedNodes[i] = nodes[ids[8 + 6 * k + i]];
-          return;
-        }
+        orderedNodes[i] = nodes[ids[8 + 6 * k + i]];
+      return;
     }
-  MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId]));
+  }
+  MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->FromVtkToSmds(_vtkCellIds[cellId]));
   MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2] << " " << orderedNodes[3]);
   MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]);
 }
@@ -1580,7 +1581,7 @@ void SMDS_DownQuadPyramid::computeFacesWithNodes(int cellId, ListElemByNodesType
   // --- find point id's of the volume
 
   vtkIdType npts = 0;
-  vtkIdType *nodes; // will refer to the point id's of the volume
+  vtkIdType const *nodes(nullptr); // will refer to the point id's of the volume
   _grid->GetCellPoints(cellId, npts, nodes);
 
   // --- create all the ordered list of node id's for each face
@@ -1655,45 +1656,45 @@ void SMDS_DownPenta::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& o
 {
   set<int> setNodes;
   setNodes.clear();
-  for (int i = 0; i < orderedNodes.size(); i++)
+  for ( size_t i = 0; i < orderedNodes.size(); i++)
     setNodes.insert(orderedNodes[i]);
   //MESSAGE("cellId = " << cellId);
 
   vtkIdType npts = 0;
-  vtkIdType *nodes; // will refer to the point id's of the volume
+  vtkIdType const *nodes(nullptr); // will refer to the point id's of the volume
   _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
 
   set<int> tofind;
-//int ids[18] = { 0, 2, 1,  3, 4, 5,   0, 1, 4, 3,   1, 2, 5, 4,   2, 0, 3, 5 };
+  //int ids[18] = { 0, 2, 1,  3, 4, 5,   0, 1, 4, 3,   1, 2, 5, 4,   2, 0, 3, 5 };
   int ids[18] = { 0, 1, 2,  3, 5, 4,   0, 3, 4, 1,   1, 4, 5, 2,   2, 5, 3, 0 };
 
   // Triangular faces
   for (int k = 0; k < 2; k++)
+  {
+    tofind.clear();
+    for (int i = 0; i < 3; i++)
+      tofind.insert(nodes[ids[3 * k + i]]);
+    if (setNodes == tofind)
     {
-      tofind.clear();
       for (int i = 0; i < 3; i++)
-        tofind.insert(nodes[ids[3 * k + i]]);
-      if (setNodes == tofind)
-        {
-          for (int i = 0; i < 3; i++)
-            orderedNodes[i] = nodes[ids[3 * k + i]];
-          return;
-        }
+        orderedNodes[i] = nodes[ids[3 * k + i]];
+      return;
     }
+  }
   // Quadrangular faces
   for (int k = 0; k < 3; k++)
+  {
+    tofind.clear();
+    for (int i = 0; i < 4; i++)
+      tofind.insert(nodes[ids[6 + 4 * k + i]]);
+    if (setNodes == tofind)
     {
-      tofind.clear();
       for (int i = 0; i < 4; i++)
-        tofind.insert(nodes[ids[6 + 4 * k + i]]);
-      if (setNodes == tofind)
-        {
-          for (int i = 0; i < 4; i++)
-            orderedNodes[i] = nodes[ids[6 + 4 * k + i]];
-          return;
-        }
+        orderedNodes[i] = nodes[ids[6 + 4 * k + i]];
+      return;
     }
-  MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId]));
+  }
+  MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->FromVtkToSmds(_vtkCellIds[cellId]));
   MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2]);
   MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]);
 }
@@ -1704,7 +1705,7 @@ void SMDS_DownPenta::addDownCell(int cellId, int lowCellId, unsigned char aType)
   int *faces = &_cellIds[_nbDownCells * cellId];
   if (aType == VTK_QUAD)
     for (int i = 0; i < 3; i++)
-      {
+    {
         if (faces[i] < 0)
           {
             faces[i] = lowCellId;
@@ -1744,7 +1745,7 @@ void SMDS_DownPenta::computeFacesWithNodes(int cellId, ListElemByNodesType& face
   // --- find point id's of the volume
 
   vtkIdType npts = 0;
-  vtkIdType *nodes; // will refer to the point id's of the volume
+  vtkIdType const *nodes(nullptr); // will refer to the point id's of the volume
   _grid->GetCellPoints(cellId, npts, nodes);
 
   // --- create all the ordered list of node id's for each face
@@ -1805,46 +1806,46 @@ void SMDS_DownQuadPenta::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType
 {
   set<int> setNodes;
   setNodes.clear();
-  for (int i = 0; i < orderedNodes.size(); i++)
+  for ( size_t i = 0; i < orderedNodes.size(); i++ )
     setNodes.insert(orderedNodes[i]);
   //MESSAGE("cellId = " << cellId);
 
   vtkIdType npts = 0;
-  vtkIdType *nodes; // will refer to the point id's of the volume
+  vtkIdType const *nodes(nullptr); // will refer to the point id's of the volume
   _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
 
   set<int> tofind;
-//int ids[18] = { 0, 2, 1,  3, 4, 5,   0, 1, 4, 3,   1, 2, 5, 4,   2, 0, 3, 5 };
+  //int ids[18] = { 0, 2, 1,  3, 4, 5,   0, 1, 4, 3,   1, 2, 5, 4,   2, 0, 3, 5 };
   int ids[36] = { 0, 1, 2, 6, 7, 8,  3, 5, 4, 11, 10, 9,
                   0, 3, 4, 1, 12, 9, 13, 6,   1, 4, 5, 2, 13, 10, 14, 7,   2, 5, 3, 0, 14, 11, 12, 8 };
 
   // Triangular faces
   for (int k = 0; k < 2; k++)
+  {
+    tofind.clear();
+    for (int i = 0; i < 6; i++)
+      tofind.insert(nodes[ids[6 * k + i]]);
+    if (setNodes == tofind)
     {
-      tofind.clear();
       for (int i = 0; i < 6; i++)
-        tofind.insert(nodes[ids[6 * k + i]]);
-      if (setNodes == tofind)
-        {
-          for (int i = 0; i < 6; i++)
-            orderedNodes[i] = nodes[ids[6 * k + i]];
-          return;
-        }
+        orderedNodes[i] = nodes[ids[6 * k + i]];
+      return;
     }
+  }
   // Quadrangular faces
   for (int k = 0; k < 3; k++)
+  {
+    tofind.clear();
+    for (int i = 0; i < 8; i++)
+      tofind.insert(nodes[ids[12 + 8 * k + i]]);
+    if (setNodes == tofind)
     {
-      tofind.clear();
       for (int i = 0; i < 8; i++)
-        tofind.insert(nodes[ids[12 + 8 * k + i]]);
-      if (setNodes == tofind)
-        {
-          for (int i = 0; i < 8; i++)
-            orderedNodes[i] = nodes[ids[12 + 8 * k + i]];
-          return;
-        }
+        orderedNodes[i] = nodes[ids[12 + 8 * k + i]];
+      return;
     }
-  MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId]));
+  }
+  MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->FromVtkToSmds(_vtkCellIds[cellId]));
   MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2]);
   MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]);
 }
@@ -1896,7 +1897,7 @@ void SMDS_DownQuadPenta::computeFacesWithNodes(int cellId, ListElemByNodesType&
   // --- find point id's of the volume
 
   vtkIdType npts = 0;
-  vtkIdType *nodes; // will refer to the point id's of the volume
+  vtkIdType const *nodes(nullptr); // will refer to the point id's of the volume
   _grid->GetCellPoints(cellId, npts, nodes);
 
   // --- create all the ordered list of node id's for each face
@@ -1976,36 +1977,36 @@ void SMDS_DownHexa::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& or
 {
   set<int> setNodes;
   setNodes.clear();
-  for (int i = 0; i < orderedNodes.size(); i++)
+  for ( size_t i = 0; i < orderedNodes.size(); i++ )
     setNodes.insert(orderedNodes[i]);
   //MESSAGE("cellId = " << cellId);
 
   vtkIdType npts = 0;
-  vtkIdType *nodes; // will refer to the point id's of the volume
+  vtkIdType const *nodes(nullptr); // will refer to the point id's of the volume
   _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
 
   set<int> tofind;
-//int ids[24] = { 0, 1, 2, 3,  7, 6, 5, 4,  4, 0, 3, 7,  5, 1, 0, 4,  6, 2, 1, 5,  7, 3, 2, 6};
+  //int ids[24] = { 0, 1, 2, 3,  7, 6, 5, 4,  4, 0, 3, 7,  5, 1, 0, 4,  6, 2, 1, 5,  7, 3, 2, 6};
   int ids[24] = { 3, 2, 1, 0,  4, 5, 6, 7,  7, 3, 0, 4,  4, 0, 1, 5,  5, 1, 2, 6,  6, 2, 3, 7};
   for (int k = 0; k < 6; k++) // loop on the 6 faces
+  {
+    tofind.clear();
+    for (int i = 0; i < 4; i++)
+      tofind.insert(nodes[ids[4 * k + i]]); // node ids of the face i
+    if (setNodes == tofind)
     {
-      tofind.clear();
       for (int i = 0; i < 4; i++)
-        tofind.insert(nodes[ids[4 * k + i]]); // node ids of the face i
-      if (setNodes == tofind)
-        {
-          for (int i = 0; i < 4; i++)
-            orderedNodes[i] = nodes[ids[4 * k + i]];
-          return;
-        }
+        orderedNodes[i] = nodes[ids[4 * k + i]];
+      return;
     }
-  MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId]));
+  }
+  MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->FromVtkToSmds(_vtkCellIds[cellId]));
   MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2] << " " << orderedNodes[3]);
   MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]);
   MESSAGE(nodes[4] << " " << nodes[5] << " " << nodes[6] << " " << nodes[7]);
 }
 
-void SMDS_DownHexa::addDownCell(int cellId, int lowCellId, unsigned char aType)
+void SMDS_DownHexa::addDownCell(int cellId, int lowCellId, unsigned char /*aType*/)
 {
   //ASSERT((cellId >=0)&& (cellId < _maxId));
   int *faces = &_cellIds[_nbDownCells * cellId];
@@ -2036,7 +2037,7 @@ void SMDS_DownHexa::computeFacesWithNodes(int cellId, ListElemByNodesType& faces
   // --- find point id's of the volume
 
   vtkIdType npts = 0;
-  vtkIdType *nodes; // will refer to the point id's of the volume
+  vtkIdType const *nodes(nullptr); // will refer to the point id's of the volume
   _grid->GetCellPoints(cellId, npts, nodes);
 
   // --- create all the ordered list of node id's for each face
@@ -2107,12 +2108,12 @@ void SMDS_DownQuadHexa::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>
 {
   set<int> setNodes;
   setNodes.clear();
-  for (int i = 0; i < orderedNodes.size(); i++)
+  for ( size_t i = 0; i < orderedNodes.size(); i++ )
     setNodes.insert(orderedNodes[i]);
   //MESSAGE("cellId = " << cellId);
 
   vtkIdType npts = 0;
-  vtkIdType *nodes; // will refer to the point id's of the volume
+  vtkIdType const *nodes(nullptr); // will refer to the point id's of the volume
   _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
 
   set<int> tofind;
@@ -2120,23 +2121,23 @@ void SMDS_DownQuadHexa::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>
   int ids[48] = { 3, 2, 1, 0,10, 9, 8,11,   4, 5, 6, 7,12,13,14,15,   7, 3, 0, 4,19,11,16,15,
                   4, 0, 1, 5,16, 8,17,12,   5, 1, 2, 6,17, 9,18,13,   6, 2, 3, 7,18,10,19,14};
   for (int k = 0; k < 6; k++)
+  {
+    tofind.clear();
+    for (int i = 0; i < 8; i++)
+      tofind.insert(nodes[ids[8 * k + i]]);
+    if (setNodes == tofind)
     {
-      tofind.clear();
       for (int i = 0; i < 8; i++)
-        tofind.insert(nodes[ids[8 * k + i]]);
-      if (setNodes == tofind)
-        {
-          for (int i = 0; i < 8; i++)
-            orderedNodes[i] = nodes[ids[8 * k + i]];
-          return;
-        }
+        orderedNodes[i] = nodes[ids[8 * k + i]];
+      return;
     }
-  MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId]));
+  }
+  MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->FromVtkToSmds(_vtkCellIds[cellId]));
   MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2] << " " << orderedNodes[3]);
   MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]);
 }
 
-void SMDS_DownQuadHexa::addDownCell(int cellId, int lowCellId, unsigned char aType)
+void SMDS_DownQuadHexa::addDownCell(int cellId, int lowCellId, unsigned char /*aType*/)
 {
   //ASSERT((cellId >=0)&& (cellId < _maxId));
   int *faces = &_cellIds[_nbDownCells * cellId];
@@ -2167,7 +2168,7 @@ void SMDS_DownQuadHexa::computeFacesWithNodes(int cellId, ListElemByNodesType& f
   // --- find point id's of the volume
 
   vtkIdType npts = 0;
-  vtkIdType *nodes; // will refer to the point id's of the volume
+  vtkIdType const *nodes; // will refer to the point id's of the volume
   _grid->GetCellPoints(cellId, npts, nodes);
 
   // --- create all the ordered list of node id's for each face