/** * @file grid_indexing.hpp * @author Julian Iseringhausen * @date Mon Apr 18 12:54:05 2011 * * @brief VMG::GlobalIndices, VMG::LocalIndices and VMG::SpatialExtent * */ #ifndef GRID_INDEXING_HPP_ #define GRID_INDEXING_HPP_ #include "base/index.hpp" #include "base/vector.hpp" namespace VMG { class GlobalIndices { public: const Index& Size() const {return size;} ///< Global grid size including boundary const Index& Begin() const {return begin;} ///< Global index of first local grid point const Index& End() const {return end;} ///< Global index of first non-local grid point const Index& AlignmentBegin() const {return alignmentBegin;} ///< Global index of first point of the next higher level const Index& AlignmentEnd() const {return alignmentEnd;} const BT& BoundaryType() const {return boundary;} Index& Size() {return size;} ///< Global grid size including boundary Index& Begin() {return begin;} ///< Global index of first local grid point Index& End() {return end;} ///< Global index of first non-local grid point Index& AlignmentBegin() {return alignmentBegin;} ///< Global index of first point of the next higher level Index& AlignmentEnd() {return alignmentEnd;} BT& BoundaryType() {return boundary;} private: Index size; Index begin; Index end; Index alignmentBegin, alignmentEnd; BT boundary; }; class LocalIndices { public: const Index& Size() const {return size;} ///< Local grid size excluding halo const Index& SizeTotal() const {return sizeTotal;} ///< Local grid size including halo and boundary const Index& Begin() const {return begin;} ///< Index of first local grid point const Index& End() const {return end;} ///< Index of first non-local grid point Index& Size() {return size;} ///< Local grid size excluding halo Index& SizeTotal() {return sizeTotal;} ///< Local grid size including halo and boundary Index& Begin() {return begin;} ///< Index of first local grid point Index& End() {return end;} ///< Index of first non-local grid point const Index& HaloBegin1() const {return haloBegin1;} ///< Index of first halo point const Index& HaloBegin2() const {return haloBegin2;} ///< Index of first halo point const Index& HaloEnd1() const {return haloEnd1;} ///< Index of first non-halo point const Index& HaloEnd2() const {return haloEnd2;} ///< Index of first non-halo point Index& HaloBegin1() {return haloBegin1;} ///< Index of first halo point Index& HaloBegin2() {return haloBegin2;} ///< Index of first halo point Index& HaloEnd1() {return haloEnd1;} ///< Index of first non-halo point Index& HaloEnd2() {return haloEnd2;} ///< Index of first non-halo point const Index& BoundaryBegin1() const {return boundaryBegin1;} ///< Index of first boundary point const Index& BoundaryBegin2() const {return boundaryBegin2;} ///< Index of first boundary point const Index& BoundaryEnd1() const {return boundaryEnd1;} ///< Index of first non-boundary point const Index& BoundaryEnd2() const {return boundaryEnd2;} ///< Index of first non-boundary point Index& BoundaryBegin1() {return boundaryBegin1;} ///< Index of first boundary point Index& BoundaryBegin2() {return boundaryBegin2;} ///< Index of first boundary point Index& BoundaryEnd1() {return boundaryEnd1;} ///< Index of first non-boundary point Index& BoundaryEnd2() {return boundaryEnd2;} ///< Index of first non-boundary point const Index& AlignmentBegin() const {return alignmentBegin;} const Index& AlignmentEnd() const {return alignmentEnd;} Index& AlignmentBegin() {return alignmentBegin;} Index& AlignmentEnd() {return alignmentEnd;} private: Index size; Index sizeTotal; Index begin; Index end; Index haloBegin1, haloEnd1; Index haloBegin2, haloEnd2; Index boundaryBegin1, boundaryEnd1; Index boundaryBegin2, boundaryEnd2; Index alignmentBegin, alignmentEnd; }; class SpatialExtent { public: const Vector& Size() const {return size;} const Index& SizeFactor() const {return size_factor;} const Vector& Begin() const {return begin;} const Vector& End() const {return end;} const Vector& MeshWidth() const {return meshWidth;} Vector& Size() {return size;} Index& SizeFactor() {return size_factor;} Vector& Begin() {return begin;} Vector& End() {return end;} Vector& MeshWidth() {return meshWidth;} private: Vector size; Index size_factor; Vector begin; Vector end; Vector meshWidth; }; } #endif /* GRID_INDEXING_HPP_ */