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

Function ComputeAdjacencyAndOverlapMasks

Parallel/DIY/vtkDIYGhostUtilities.cxx:831–850  ·  view source on GitHub ↗

---------------------------------------------------------------------------- * This function computes the adjacency and overlap masks mapping the configuration between the 2 * input extents `localExtent` and `extent` */

Source from the content-addressed store, hash-verified

829 * input extents `localExtent` and `extent`
830 */
831void ComputeAdjacencyAndOverlapMasks(const ::ExtentType& localExtent, const ::ExtentType& extent,
832 unsigned char& adjacencyMask, unsigned char& overlapMask)
833{
834 // AdjacencyMask is a binary mask that is trigger if 2
835 // blocks are adjacent. Dimensionnality of the grid is carried away
836 // by discarding any bit that is on a degenerate dimension
837 adjacencyMask = (((localExtent[0] == extent[1]) * ::Adjacency::Left) |
838 ((localExtent[1] == extent[0]) * ::Adjacency::Right) |
839 ((localExtent[2] == extent[3]) * ::Adjacency::Front) |
840 ((localExtent[3] == extent[2]) * ::Adjacency::Back) |
841 ((localExtent[4] == extent[5]) * ::Adjacency::Bottom) |
842 ((localExtent[5] == extent[4]) * ::Adjacency::Top)) &
843 (((::Adjacency::Left | ::Adjacency::Right) * (localExtent[0] != localExtent[1])) |
844 ((::Adjacency::Front | ::Adjacency::Back) * (localExtent[2] != localExtent[3])) |
845 ((::Adjacency::Bottom | ::Adjacency::Top) * (localExtent[4] != localExtent[5])));
846
847 overlapMask = ((localExtent[0] < extent[1] && extent[0] < localExtent[1])) |
848 ((localExtent[2] < extent[3] && extent[2] < localExtent[3]) << 1) |
849 ((localExtent[4] < extent[5] && extent[4] < localExtent[5]) << 2);
850}
851
852//----------------------------------------------------------------------------
853bool AreExtentsAdjacent(const ::ExtentType& e1, const ::ExtentType& e2)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected