Parallel/DIY/vtkDIYGhostUtilities.cxx
void ComputeAdjacencyAndOverlapMasks(const ExtentType& localExtent, const ExtentType& extent,
  unsigned char& adjacencyMask, unsigned char& overlapMask)
{
  // AdjacencyMask is a binary mask that is trigger if 2
  // blocks are adjacent. Dimensionnality of the grid is carried away
  // by discarding any bit that is on a degenerate dimension
  adjacencyMask = (((localExtent[0] == extent[1]) * Adjacency::Left) |
                    ((localExtent[1] == extent[0]) * Adjacency::Right) |
                    ((localExtent[2] == extent[3]) * Adjacency::Front) |
                    ((localExtent[3] == extent[2]) * Adjacency::Back) |
                    ((localExtent[4] == extent[5]) * Adjacency::Bottom) |
                    ((localExtent[5] == extent[4]) * Adjacency::Top)) &
    (((Adjacency::Left | Adjacency::Right) * (localExtent[0] != localExtent[1])) |
      ((Adjacency::Front | Adjacency::Back) * (localExtent[2] != localExtent[3])) |
      ((Adjacency::Bottom | Adjacency::Top) * (localExtent[4] != localExtent[5])));

  overlapMask = ((localExtent[0] < extent[1] && extent[0] < localExtent[1])) |
    ((localExtent[2] < extent[3] && extent[2] < localExtent[3]) << 1) |
    ((localExtent[4] < extent[5] && extent[4] < localExtent[5]) << 2);
}
//----------------------------------------------------------------------------
/**
 * This function computes the adjacency and overlap masks mapping the configuration between the 2
 * input extents `localExtent` and `extent`
 */
This function computes the adjacency and overlap masks mapping the configuration between the 2
input extents `localExtent` and `extent`
This function computes the adjacency and overlap masks mapping the configuration between the 2 input extents ` localExtent ` and ` extent `
void ComputeAdjacencyAndOverlapMasks(const ExtentType& localExtent, const ExtentType& extent,
  unsigned char& adjacencyMask, unsigned char& overlapMask)
{
  adjacencyMask = (((localExtent[0] == extent[1]) * Adjacency::Left) |
                    ((localExtent[1] == extent[0]) * Adjacency::Right) |
                    ((localExtent[2] == extent[3]) * Adjacency::Front) |
                    ((localExtent[3] == extent[2]) * Adjacency::Back) |
                    ((localExtent[4] == extent[5]) * Adjacency::Bottom) |
                    ((localExtent[5] == extent[4]) * Adjacency::Top)) &
    (((Adjacency::Left | Adjacency::Right) * (localExtent[0] != localExtent[1])) |
      ((Adjacency::Front | Adjacency::Back) * (localExtent[2] != localExtent[3])) |
      ((Adjacency::Bottom | Adjacency::Top) * (localExtent[4] != localExtent[5])));
  overlapMask = ((localExtent[0] < extent[1] && extent[0] < localExtent[1])) |
    ((localExtent[2] < extent[3] && extent[2] < localExtent[3]) << 1) |
    ((localExtent[4] < extent[5] && extent[4] < localExtent[5]) << 2);
}
void ComputeAdjacencyAndOverlapMasks ( const ExtentType & localExtent , const ExtentType & extent , unsigned char & adjacencyMask , unsigned char & overlapMask ) { adjacencyMask = ( ( ( localExtent [ 0 ] == extent [ 1 ] ) * Adjacency :: Left ) | ( ( localExtent [ 1 ] == extent [ 0 ] ) * Adjacency :: Right ) | ( ( localExtent [ 2 ] == extent [ 3 ] ) * Adjacency :: Front ) | ( ( localExtent [ 3 ] == extent [ 2 ] ) * Adjacency :: Back ) | ( ( localExtent [ 4 ] == extent [ 5 ] ) * Adjacency :: Bottom ) | ( ( localExtent [ 5 ] == extent [ 4 ] ) * Adjacency :: Top ) ) & ( ( ( Adjacency :: Left | Adjacency :: Right ) * ( localExtent [ 0 ] != localExtent [ 1 ] ) ) | ( ( Adjacency :: Front | Adjacency :: Back ) * ( localExtent [ 2 ] != localExtent [ 3 ] ) ) | ( ( Adjacency :: Bottom | Adjacency :: Top ) * ( localExtent [ 4 ] != localExtent [ 5 ] ) ) ) ; overlapMask = ( ( localExtent [ 0 ] < extent [ 1 ] && extent [ 0 ] < localExtent [ 1 ] ) ) | ( ( localExtent [ 2 ] < extent [ 3 ] && extent [ 2 ] < localExtent [ 3 ] ) << 1 ) | ( ( localExtent [ 4 ] < extent [ 5 ] && extent [ 4 ] < localExtent [ 5 ] ) << 2 ) ; }
This function computes the adjacency and overlap masks mapping the configuration between the 2
 input extents `localExtent` and `extent`
This function computes the adjacency and overlap masks mapping the configuration between the 2 input extents ` localExtent ` and ` extent `
// AdjacencyMask is a binary mask that is trigger if 2 // blocks are adjacent. Dimensionnality of the grid is carried away // by discarding any bit that is on a degenerate dimension