VTK  9.4.20241222
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
20
21VTK_ABI_NAMESPACE_BEGIN
22class VTKFILTERSGEOMETRY_EXPORT vtkStructuredAMRNeighbor : public vtkStructuredNeighbor
23{
24public:
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
101VTK_ABI_NAMESPACE_END
102#endif /* vtkStructuredAMRNeighbor_h */
103// VTK-HeaderTest-Exclude: vtkStructuredAMRNeighbor.h
An internal, light-weight object used to store neighbor information for AMR grids.
vtkStructuredAMRNeighbor & operator=(const vtkStructuredAMRNeighbor &N)
Overload assignment operator.
~vtkStructuredAMRNeighbor() override=default
Destructor.
std::string GetRelationShipString()
Returns the neighbor relationship as a string (useful for debugging).
vtkStructuredAMRNeighbor(int gridLevel, int neiID, int neighborLevel, int gridOverlap[6], int neiOverlap[6], int orient[3], int relationShip)
Custom constructor.
void GetReceiveExtentOnGrid(int ng, int gridExtent[6], int ext[6])
Returns the receive extent w.r.t.
vtkStructuredAMRNeighbor(const vtkStructuredAMRNeighbor &N)
Copy constructor.
vtkStructuredAMRNeighbor()
Default constructor.
void ComputeSendAndReceiveExtent(int gridRealExtent[6], int gridGhostedExtent[6], int neiRealExtent[6], int WholeExtent[6], int N) override
Computes the SendExtent and RcvExtent for this neighbor.
An internal, light-weight class used to store neighbor information.