MCPcopy Create free account
hub / github.com/Kitware/VTK / FillNodesGhostArray

Method FillNodesGhostArray

Filters/Geometry/vtkStructuredAMRGridConnectivity.cxx:1269–1311  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1267
1268//------------------------------------------------------------------------------
1269void vtkStructuredAMRGridConnectivity::FillNodesGhostArray(
1270 int gridId, vtkUnsignedCharArray* nodesArray)
1271{
1272 assert("pre: grid index is out-of-bounds" && (gridId >= 0) &&
1273 (gridId < static_cast<int>(this->NumberOfGrids)));
1274
1275 // STEP 0: If the nodes array is nullptr, return immediately
1276 if (nodesArray == nullptr)
1277 {
1278 return;
1279 }
1280
1281 // STEP 1: Get normalized whole extent at the level of the given grid.
1282 int gridLevel = this->GetGridLevel(gridId);
1283 int NormalizedWholeExtent[6];
1284 this->GetWholeExtentAtLevel(gridLevel, NormalizedWholeExtent);
1285
1286 // STEP 2: Loop through the grid points and mark them accordingly
1287 int ext[6];
1288 this->GetGridExtent(gridId, ext);
1289 int gridDataDescription = vtkStructuredData::GetDataDescriptionFromExtent(ext);
1290 assert("pre:grid data-description does not match whole extent description" &&
1291 (gridDataDescription == this->DataDescription));
1292
1293 // STEP 3: Mark nodes
1294 int ijk[3];
1295 for (int i = IMIN(ext); i <= IMAX(ext); ++i)
1296 {
1297 for (int j = JMIN(ext); j <= JMAX(ext); ++j)
1298 {
1299 for (int k = KMIN(ext); k <= KMAX(ext); ++k)
1300 {
1301 ijk[0] = i;
1302 ijk[1] = j;
1303 ijk[2] = k;
1304 vtkIdType idx = vtkStructuredData::ComputePointIdForExtent(ext, ijk, gridDataDescription);
1305
1306 this->MarkNodeProperty(
1307 gridId, i, j, k, ext, NormalizedWholeExtent, *nodesArray->GetPointer(idx));
1308 } // END for all k
1309 } // END for all j
1310 } // END for all i
1311}
1312
1313//------------------------------------------------------------------------------
1314void vtkStructuredAMRGridConnectivity::GetNodeOrientation(

Callers 1

FillGhostArraysMethod · 0.95

Calls 6

GetGridLevelMethod · 0.95
GetWholeExtentAtLevelMethod · 0.95
GetGridExtentMethod · 0.95
MarkNodePropertyMethod · 0.95
assertFunction · 0.50
GetPointerMethod · 0.45

Tested by

no test coverage detected