------------------------------------------------------------------------------
| 1205 | |
| 1206 | //------------------------------------------------------------------------------ |
| 1207 | void vtkStructuredGridConnectivity::InitializeGhostData(int gridID) |
| 1208 | { |
| 1209 | // Sanity check |
| 1210 | assert("pre: gridID is out-of-bounds!" && (gridID >= 0) && |
| 1211 | (gridID < static_cast<int>(this->NumberOfGrids))); |
| 1212 | assert("pre: GhostedPointData vector has not been properly allocated!" && |
| 1213 | (this->NumberOfGrids == this->GhostedGridPointData.size())); |
| 1214 | assert("pre: GhostedCellData vector has not been properly allocated!" && |
| 1215 | (this->NumberOfGrids == this->GhostedGridCellData.size())); |
| 1216 | assert("pre: Grid has no registered point data!" && (this->GridPointData[gridID] != nullptr)); |
| 1217 | assert("pre: Grid has no registered cell data!" && (this->GridCellData[gridID] != nullptr)); |
| 1218 | |
| 1219 | // STEP 0: Get the ghosted grid extent |
| 1220 | int GhostedGridExtent[6]; |
| 1221 | this->GetGhostedGridExtent(gridID, GhostedGridExtent); |
| 1222 | |
| 1223 | // STEP 1: Get the number of nodes/cells in the ghosted extent |
| 1224 | int numNodes = vtkStructuredData::GetNumberOfPoints(GhostedGridExtent, this->DataDescription); |
| 1225 | int numCells = vtkStructuredData::GetNumberOfCells(GhostedGridExtent, this->DataDescription); |
| 1226 | |
| 1227 | // STEP 2: Allocate coordinates if the grid |
| 1228 | if (this->GridPoints[gridID] != nullptr) |
| 1229 | { |
| 1230 | |
| 1231 | if (this->GhostedGridPoints[gridID] != nullptr) |
| 1232 | { |
| 1233 | this->GhostedGridPoints[gridID]->Delete(); |
| 1234 | } |
| 1235 | |
| 1236 | this->GhostedGridPoints[gridID] = vtkPoints::New(); |
| 1237 | this->GhostedGridPoints[gridID]->SetDataTypeToDouble(); |
| 1238 | this->GhostedGridPoints[gridID]->SetNumberOfPoints(numNodes); |
| 1239 | } |
| 1240 | |
| 1241 | // STEP 3: Allocate point & cell data |
| 1242 | this->GhostedGridPointData[gridID] = vtkPointData::New(); |
| 1243 | this->GhostedGridCellData[gridID] = vtkCellData::New(); |
| 1244 | |
| 1245 | this->AllocatePointData( |
| 1246 | this->GridPointData[gridID], numNodes, this->GhostedGridPointData[gridID]); |
| 1247 | this->AllocateCellData(this->GridCellData[gridID], numCells, this->GhostedGridCellData[gridID]); |
| 1248 | } |
| 1249 | |
| 1250 | //------------------------------------------------------------------------------ |
| 1251 | void vtkStructuredGridConnectivity::CopyCoordinates( |
no test coverage detected