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

Method SearchGridDecendants

Filters/AMR/vtkAMRResampleFilter.cxx:585–623  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

583
584//------------------------------------------------------------------------------
585void vtkAMRResampleFilter::SearchGridDecendants(double q[3], vtkOverlappingAMR* amrds,
586 unsigned int maxLevel, unsigned int& level, unsigned int& gridId, int& cellId)
587{
588 assert("pre: AMR dataset is nullptr" && (amrds != nullptr));
589 unsigned int *children, clevel, n, i;
590 for (; level < maxLevel - 1; ++level)
591 {
592 // Get the children of the grid
593 children = amrds->GetChildren(level, gridId, n);
594 clevel = level + 1;
595 // If there are no children then we found the grid!
596 if (children == nullptr)
597 {
598 return;
599 }
600 // assert(n == children[0]);
601 for (i = 0; i < n; ++i)
602 {
603 if (amrds->GetOverlappingAMRMetaData()->FindCell(q, clevel, children[i], cellId))
604 {
605 // We found a descendant so stop searching the
606 // children and can instead search that grid's
607 // children
608 gridId = children[i];
609 ++this->NumberOfTimesLevelDown;
610 break;
611 }
612 }
613 if (i >= n)
614 {
615 // We tested some children that we didn't need to if
616 // we had visibility info
617 this->NumberOfBlocksVisSkipped += n;
618 // If we are here then no child contains the point
619 // so don't search any further
620 return;
621 }
622 }
623}
624
625//------------------------------------------------------------------------------
626int vtkAMRResampleFilter::ProbeGridPointInAMRGraph(double q[3], unsigned int& donorLevel,

Callers 1

Calls 4

assertFunction · 0.50
GetChildrenMethod · 0.45
FindCellMethod · 0.45

Tested by

no test coverage detected