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

Method ComputeNeighbors

Filters/Geometry/vtkStructuredGridConnectivity.cxx:246–278  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

244
245//------------------------------------------------------------------------------
246void vtkStructuredGridConnectivity::ComputeNeighbors()
247{
248 // STEP 0: Acquire data description, i.e., determine how the structured data
249 // is laid out, e.g., is it volumetric or 2-D along some plane, XY, XZ, or YZ.
250 this->AcquireDataDescription();
251 if (this->DataDescription == vtkStructuredData::VTK_STRUCTURED_EMPTY ||
252 this->DataDescription == vtkStructuredData::VTK_STRUCTURED_SINGLE_POINT)
253 {
254 return;
255 }
256
257 // STEP 1: Establish neighbors based on the structured extents.
258 for (unsigned int i = 0; i < this->NumberOfGrids; ++i)
259 {
260 this->SetBlockTopology(i);
261 for (unsigned int j = i + 1; j < this->NumberOfGrids; ++j)
262 {
263 this->EstablishNeighbors(i, j);
264 } // END for all j
265 } // END for all i
266
267 // STEP 2: Fill the ghost arrays
268 for (unsigned int i = 0; i < this->NumberOfGrids; ++i)
269 {
270 // NOTE: typically remote grids have nullptr ghost arrays, by this approach
271 // ComputeNeighbors() can be called transparently from
272 // vtkPStructuredGridConnectivity without any modification.
273 if (this->GridPointGhostArrays[i] != nullptr)
274 {
275 this->FillGhostArrays(i, this->GridPointGhostArrays[i], this->GridCellGhostArrays[i]);
276 }
277 } // END for all grids
278}
279
280//------------------------------------------------------------------------------
281void vtkStructuredGridConnectivity::SearchNeighbors(

Callers 4

SimpleTestFunction · 0.45
Test2DAMRFunction · 0.45
Test3DAMRFunction · 0.45

Calls 4

SetBlockTopologyMethod · 0.95
EstablishNeighborsMethod · 0.95
FillGhostArraysMethod · 0.95

Tested by 4

SimpleTestFunction · 0.36
Test2DAMRFunction · 0.36
Test3DAMRFunction · 0.36