diff --git a/src/3rdParty/salomesmesh/src/SMDS/SMDS_UnstructuredGrid.cpp b/src/3rdParty/salomesmesh/src/SMDS/SMDS_UnstructuredGrid.cpp index ce9b01a4d2..f5b91ff800 100644 --- a/src/3rdParty/salomesmesh/src/SMDS/SMDS_UnstructuredGrid.cpp +++ b/src/3rdParty/salomesmesh/src/SMDS/SMDS_UnstructuredGrid.cpp @@ -193,8 +193,8 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector& idNodesOldToNew, int n vtkCellArray *newConnectivity = vtkCellArray::New(); newConnectivity->Initialize(); - int oldCellDataSize = this->Connectivity->GetData()->GetSize(); - newConnectivity->Allocate(oldCellDataSize); + int oldCellDataSize = this->GetCells()->GetConnectivityArray()->GetSize(); + newConnectivity->AllocateExact(oldCellDataSize, oldCellDataSize); MESSAGE("oldCellSize="<< oldCellSize << " oldCellDataSize=" << oldCellDataSize); vtkUnsignedCharArray *newTypes = vtkUnsignedCharArray::New(); @@ -420,7 +420,8 @@ void SMDS_UnstructuredGrid::copyBloc(vtkUnsignedCharArray *newTypes, //MESSAGE(" " << oldval << " " << pointsCell[l]); } /*int newcnt = */newConnectivity->InsertNextCell(nbpts, pointsCell); - int newLoc = newConnectivity->GetInsertLocation(nbpts); + int newLoc = this->GetCells()->GetOffsetsArray()->GetNumberOfValues() - 1 + + this->GetCells()->GetConnectivityArray()->GetNumberOfValues() - nbpts - 1; //MESSAGE(newcnt << " " << newLoc); newLocations->SetValue(alreadyCopied, newLoc); alreadyCopied++;