VTK  9.3.20240419
vtkStructuredNeighbor.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
11 #ifndef vtkStructuredNeighbor_h
12 #define vtkStructuredNeighbor_h
13 
14 #include "vtkFiltersGeometryModule.h" // For export macro
15 #include "vtkObject.h"
16 
17 VTK_ABI_NAMESPACE_BEGIN
18 class VTKFILTERSGEOMETRY_EXPORT vtkStructuredNeighbor
19 {
20 public:
21  // An enum that defines the neighboring orientation which is stored in a
22  // 3-tuple vtkStructuredNeighbor::Orientation. In each dimension, there
23  // is a high and low end, the orientation tuple defines how to grow ghost
24  // layers along each dimension.
26  {
27  SUBSET_LO = -2, // The grid is a subset of the neighboring grid and the
28  // ghost layers are pointing away from the low end
29  LO = -1, // The grid partially overlap with its neighbor on the
30  // low end, thus, ghost layers are pointing away from
31  // the low end
32  ONE_TO_ONE = 0, // grids abut 1-to-1 in both HI and LO, the
33  // cardinality of both grids is the same in the
34  // corresponding dimension.
35  HI = 1, // The grid partially overlaps with its neighbor on the
36  // high end, thus, ghost layers are pointing away from
37  // the high end
38  SUBSET_HI = 2, // The grid is a subset of the neighboring grid and the
39  // ghost layers are pointing away from the high end
40  SUBSET_BOTH = 3, // The grid is a subset of the neighboring grid and the
41  // ghost layers grow from both low and high ends.
42  SUPERSET = 4, // grid is a superset of the neighboring grid in the
43  // given direction.
44  UNDEFINED = 5 // the neighboring relationship is undefined, e.g., if
45  // we are checking 2D data, the neighbor orientation
46  // in the 3rd dimension is undefined.
47  };
48 
49  // Class Member Variables made public for easier access
50  int NeighborID; // The registered ID of the neighboring grid
51  int OverlapExtent[6]; // The extent at which the grids overlap
52  int SendExtent[6]; // The extent that we send to this neighbor
53  int RcvExtent[6]; // The extent that we receive from this neighbor
54  int Orientation[3]; // Defines how we are neighboring with this grid, see
55  // NeighborOrientation enum above.
56 
61 
66  vtkStructuredNeighbor(int NeiID, int overlap[6]);
67 
72  vtkStructuredNeighbor(int NeiID, int overlap[6], int orient[3]);
73 
78 
83 
85 
89  {
90  if (this != &N)
91  {
92  this->Orientation[0] = N.Orientation[0];
93  this->Orientation[1] = N.Orientation[1];
94  this->Orientation[2] = N.Orientation[2];
95  this->NeighborID = N.NeighborID;
96  for (int i = 0; i < 6; ++i)
97  {
98  this->SendExtent[i] = N.SendExtent[i];
99  this->RcvExtent[i] = N.RcvExtent[i];
100  this->OverlapExtent[i] = N.OverlapExtent[i];
101  } // END for
102  } // END if
103  return *this;
104  }
106 
108 
114  virtual void ComputeSendAndReceiveExtent(int gridRealExtent[6], int gridGhostedExtent[6],
115  int neiRealExtent[6], int WholeExtent[6], int N);
117 };
118 
119 VTK_ABI_NAMESPACE_END
120 #endif /* vtkStructuredNeighbor_h */
121 // VTK-HeaderTest-Exclude: vtkStructuredNeighbor.h
An internal, light-weight class used to store neighbor information.
virtual void ComputeSendAndReceiveExtent(int gridRealExtent[6], int gridGhostedExtent[6], int neiRealExtent[6], int WholeExtent[6], int N)
Computes the SendExtent and the RcvExtent for this neighbor.
vtkStructuredNeighbor(int NeiID, int overlap[6], int orient[3])
Custom constructor.
vtkStructuredNeighbor()
Default Constructor.
vtkStructuredNeighbor(int NeiID, int overlap[6])
Custom constructor.
vtkStructuredNeighbor & operator=(const vtkStructuredNeighbor &N)
Overload assignment operator.
virtual ~vtkStructuredNeighbor()
Default destructor.
vtkStructuredNeighbor(const vtkStructuredNeighbor &N)
Copy constructor.