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

Method GetLevelBlockID

IO/AMR/vtkAMReXGridReader.cxx:295–315  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

293
294//------------------------------------------------------------------------------
295int vtkAMReXGridReader::GetLevelBlockID(int blockIdx)
296{
297 if (!this->Internal->headersAreRead)
298 {
299 return (-1);
300 }
301
302 int numberOfLevels = this->GetNumberOfLevels() + 1;
303 int levelBlocksLo = 0;
304 int levelBlocksHi = 0;
305 for (int cc = 0; cc < numberOfLevels; ++cc)
306 {
307 levelBlocksHi += this->Internal->LevelHeader[cc]->levelBoxArraySize;
308 if (blockIdx >= levelBlocksLo && blockIdx < levelBlocksHi)
309 {
310 return blockIdx - levelBlocksLo;
311 }
312 levelBlocksLo = levelBlocksHi;
313 }
314 return (-1);
315}
316
317//------------------------------------------------------------------------------
318void vtkAMReXGridReader::GetAMRGridData(int blockIdx, vtkUniformGrid* block, const char* field)

Callers 1

GetAMRGridMethod · 0.95

Calls 1

GetNumberOfLevelsMethod · 0.95

Tested by

no test coverage detected