VTK  9.3.1
vtkStructuredAMRNeighbor.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
15 #ifndef vtkStructuredAMRNeighbor_h
16 #define vtkStructuredAMRNeighbor_h
17 
18 #include "vtkFiltersGeometryModule.h" // For export macro
19 #include "vtkStructuredNeighbor.h"
20 
21 VTK_ABI_NAMESPACE_BEGIN
22 class VTKFILTERSGEOMETRY_EXPORT vtkStructuredAMRNeighbor : public vtkStructuredNeighbor
23 {
24 public:
25  // An enum that defines the neighbor relationship between the 2 grids.
27  {
28  PARENT, // Neighbor fully contains this grid
29  PARTIALLY_OVERLAPPING_PARENT, // Neighbor partially contains this grid
30  CHILD, // This grid fully contains the neighbor
31  PARTIALLY_OVERLAPPING_CHILD, // This grid partially contains the neighbor
32  SAME_LEVEL_SIBLING, // Grids are adjacent at the same level
33  COARSE_TO_FINE_SIBLING, // Grid is adjacent with a finer neighbor
34  FINE_TO_COARSE_SIBLING, // Grid is adjacent with a coarser neighbor
35  UNDEFINED
36  };
37 
38  // NOTE: The OverlapExtent stores the overlap w.r.t. the neighboring grid
39  // Consequently, GridOverlapExtent stores the overlap extent w.r.t. this grid.
40  int GridOverlapExtent[6]; // The overlap extent w.r.t. this grid
41  int GridLevel; // The level of the grid that has this neighbor
42  int NeighborLevel; // The level of the neighboring grid
43  int RelationShip; // The relationship of the grid with this neighbor
44 
49 
56  vtkStructuredAMRNeighbor(int gridLevel, int neiID, int neighborLevel, int gridOverlap[6],
57  int neiOverlap[6], int orient[3], int relationShip);
58 
64  {
65  *this = N;
66  }
67 
71  ~vtkStructuredAMRNeighbor() override = default;
72 
77 
82  void GetReceiveExtentOnGrid(int ng, int gridExtent[6], int ext[6]);
83 
87  std::string GetRelationShipString();
88 
90 
96  void ComputeSendAndReceiveExtent(int gridRealExtent[6], int gridGhostedExtent[6],
97  int neiRealExtent[6], int WholeExtent[6], int N) override;
99 };
100 
101 VTK_ABI_NAMESPACE_END
102 #endif /* vtkStructuredAMRNeighbor_h */
103 // VTK-HeaderTest-Exclude: vtkStructuredAMRNeighbor.h
vtkStructuredAMRNeighbor(const vtkStructuredAMRNeighbor &N)
Copy constructor.
vtkStructuredNeighbor & operator=(const vtkStructuredNeighbor &N)
Overload assignment operator.
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.
An internal, light-weight class used to store neighbor information.
An internal, light-weight object used to store neighbor information for AMR grids.