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

Method SearchForDonorGridAtLevel

Filters/AMR/vtkAMRResampleFilter.cxx:359–387  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

357
358//------------------------------------------------------------------------------
359bool vtkAMRResampleFilter::SearchForDonorGridAtLevel(double q[3], vtkOverlappingAMR* amrds,
360 unsigned int level, unsigned int& donorGridId, int& donorCellIdx)
361{
362 assert("pre: AMR dataset is nullptr" && (amrds != nullptr));
363 this->NumberOfBlocksTestedForLevel = 0;
364 std::ostringstream oss;
365 oss << "SearchLevel-" << level;
366
367 vtkTimerLog::MarkStartEvent(oss.str().c_str());
368
369 for (donorGridId = 0; donorGridId < amrds->GetNumberOfBlocks(level); ++donorGridId)
370 {
371 donorCellIdx = -1;
372 this->NumberOfBlocksTestedForLevel++;
373 if (amrds->GetOverlappingAMRMetaData()->FindCell(q, level, donorGridId, donorCellIdx))
374 {
375 assert("pre: donorCellIdx is invalid" && (donorCellIdx >= 0)); // &&
376 // (donorCellIdx < donorGrid->GetNumberOfCells()) );
377 vtkTimerLog::MarkEndEvent(oss.str().c_str());
378 return true;
379 } // END if
380
381 } // END for all data at level
382
383 // No suitable grid is found at the requested level, set donorGrid to nullptr
384 // to indicate that to the caller.
385 vtkTimerLog::MarkEndEvent(oss.str().c_str());
386 return false;
387}
388
389//------------------------------------------------------------------------------
390int vtkAMRResampleFilter::ProbeGridPointInAMR(double q[3], unsigned int& donorLevel,

Callers 1

ProbeGridPointInAMRMethod · 0.95

Calls 6

assertFunction · 0.50
c_strMethod · 0.45
strMethod · 0.45
GetNumberOfBlocksMethod · 0.45
FindCellMethod · 0.45

Tested by

no test coverage detected