Salome HOME
0020832: EDF 1359 SMESH : Automatic meshing of boundary layers
[modules/smesh.git] / src / SMDS / SMDS_UnstructuredGrid.cxx
index 00d50a9d4b2d05ece0f25bcb580ab039109a78e6..6ff8f517c16b3417a0929ce1ce1b640dc8c98334 100644 (file)
@@ -147,11 +147,11 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
   } enumState;
   enumState compactState = lookHoleStart;
 
-  //   if (this->Links)
-  //   {
-  //           this->Links->UnRegister(this);
-  //           this->Links = 0;
-  //   }
+  //    if (this->Links)
+  //    {
+  //            this->Links->UnRegister(this);
+  //            this->Links = 0;
+  //    }
 
   // --- if newNodeSize, create a new compacted vtkPoints
 
@@ -160,6 +160,9 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
     {
       MESSAGE("-------------- compactGrid, newNodeSize " << newNodeSize);
       newPoints = vtkPoints::New();
+      // rnv: to fix bug "21125: EDF 1233 SMESH: Degrardation of precision in a test case for quadratic conversion"
+      // using double type for storing coordinates of nodes instead float.
+      newPoints->SetDataType(VTK_DOUBLE);
       newPoints->Initialize();
       newPoints->Allocate(newNodeSize);
       newPoints->SetNumberOfPoints(newNodeSize);
@@ -371,7 +374,7 @@ void SMDS_UnstructuredGrid::copyNodes(vtkPoints *newPoints, std::vector<int>& id
   int nbPoints = end - start;
   if (nbPoints > 0)
     {
-      memcpy(target, source, 3 * sizeof(float) * nbPoints);
+      memcpy(target, source, 3 * sizeof(double) * nbPoints);
       for (int j = start; j < end; j++)
         idNodesOldToNew[j] = alreadyCopied++; // old vtkId --> new vtkId
         //idNodesOldToNew[alreadyCopied++] = idNodesOldToNew[j]; // new vtkId --> old SMDS id
@@ -879,7 +882,7 @@ void SMDS_UnstructuredGrid::ModifyCellNodes(int vtkVolId, std::map<int, int> loc
  * @param localClonedNodeIds map old node id to new node id.
  * @return vtk id of the new volume.
  */
-int SMDS_UnstructuredGrid::getOrderedNodesOfFace(int vtkVolId, std::vector<int>& orderedNodes)
+int SMDS_UnstructuredGrid::getOrderedNodesOfFace(int vtkVolId, std::vector<vtkIdType>& orderedNodes)
 {
   int vtkType = this->GetCellType(vtkVolId);
   int cellDim = SMDS_Downward::getCellDimension(vtkType);