1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
|
// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
// SPDX-License-Identifier: BSD-3-Clause
/**
* @class vtkStructuredAMRNeighbor
* @brief An internal, light-weight object used to store neighbor information for
* AMR grids.
*
* @sa
* vtkStructuredNeighbor vtkStructuredAMRGridConnectivity
*/
#ifndef vtkStructuredAMRNeighbor_h
#define vtkStructuredAMRNeighbor_h
#include "vtkFiltersGeometryModule.h" // For export macro
#include "vtkStructuredNeighbor.h"
VTK_ABI_NAMESPACE_BEGIN
class VTKFILTERSGEOMETRY_EXPORT vtkStructuredAMRNeighbor : public vtkStructuredNeighbor
{
public:
// An enum that defines the neighbor relationship between the 2 grids.
enum NeighborRelationship
{
PARENT, // Neighbor fully contains this grid
PARTIALLY_OVERLAPPING_PARENT, // Neighbor partially contains this grid
CHILD, // This grid fully contains the neighbor
PARTIALLY_OVERLAPPING_CHILD, // This grid partially contains the neighbor
SAME_LEVEL_SIBLING, // Grids are adjacent at the same level
COARSE_TO_FINE_SIBLING, // Grid is adjacent with a finer neighbor
FINE_TO_COARSE_SIBLING, // Grid is adjacent with a coarser neighbor
UNDEFINED
};
// NOTE: The OverlapExtent stores the overlap w.r.t. the neighboring grid
// Consequently, GridOverlapExtent stores the overlap extent w.r.t. this grid.
int GridOverlapExtent[6]; // The overlap extent w.r.t. this grid
int GridLevel; // The level of the grid that has this neighbor
int NeighborLevel; // The level of the neighboring grid
int RelationShip; // The relationship of the grid with this neighbor
/**
* Default constructor.
*/
vtkStructuredAMRNeighbor();
/**
* Custom constructor. Creates an AMR neighbor for a grid (block) at level
* GridLevel with the neighboring block at NeiID, NeighborLevel. The two
* neighbors overlap at the pre-computed overlap extent which is given w.r.t
* to the current grid (i.e., not the neighboring grid).
*/
vtkStructuredAMRNeighbor(int gridLevel, int neiID, int neighborLevel, int gridOverlap[6],
int neiOverlap[6], int orient[3], int relationShip);
/**
* Copy constructor.
*/
vtkStructuredAMRNeighbor(const vtkStructuredAMRNeighbor& N)
: vtkStructuredNeighbor(N)
{
*this = N;
}
/**
* Destructor.
*/
~vtkStructuredAMRNeighbor() override = default;
/**
* Overload assignment operator.
*/
vtkStructuredAMRNeighbor& operator=(const vtkStructuredAMRNeighbor& N);
/**
* Returns the receive extent w.r.t. the grid's level, i.e., not the
* neighbor's level.
*/
void GetReceiveExtentOnGrid(int ng, int gridExtent[6], int ext[6]);
/**
* Returns the neighbor relationship as a string (useful for debugging).
*/
std::string GetRelationShipString();
///@{
/**
* Computes the SendExtent and RcvExtent for this neighbor. The method assumes
* that the overlap extent and orientation are already computed. Using this
* information, the method grows the overlap extent to form the Send and Rcv
* extents for this neighbor instance.
*/
void ComputeSendAndReceiveExtent(int gridRealExtent[6], int gridGhostedExtent[6],
int neiRealExtent[6], int WholeExtent[6], int N) override;
///@}
};
VTK_ABI_NAMESPACE_END
#endif /* vtkStructuredAMRNeighbor_h */
// VTK-HeaderTest-Exclude: vtkStructuredAMRNeighbor.h
|