/** * @file grid_properties.hpp * @author Julian Iseringhausen * @date Mon Apr 18 12:54:05 2011 * * @brief VMG::GlobalIndices, VMG::LocalIndices and VMG::SpatialExtent * */ #ifndef GRID_PROPERTIES_HPP_ #define GRID_PROPERTIES_HPP_ #include "base/defs.hpp" #include "base/index.hpp" #include "base/vector.hpp" namespace VMG { class GlobalIndices { public: GlobalIndices(); const Index& BeginFinest() const {return begin_finest;} ///< Global index of first local grid point const Index& EndFinest() const {return end_finest;} ///< Global index of first non-local grid point const Index& SizeFinest() const {return size_finest;} ///< Global grid size including boundary const Index& BeginLocal() const {return begin_local;} const Index& EndLocal() const {return end_local;} const Index& SizeLocal() const {return size_local;} const Index& SizeGlobal() const {return size_global;} const BT& BoundaryType() const {return boundary;} Index& BeginFinest() {return begin_finest;} ///< Global index of first local grid point Index& EndFinest() {return end_finest;} ///< Global index of first non-local grid point Index& SizeFinest() {return size_finest;} ///< Global grid size including boundary Index& BeginLocal() {return begin_local;} Index& EndLocal() {return end_local;} Index& SizeLocal() {return size_local;} Index& SizeGlobal() {return size_global;} BT& BoundaryType() {return boundary;} private: Index begin_finest, end_finest, size_finest; Index begin_local, end_local, size_local; Index size_global; BT boundary; }; class LocalIndices { public: LocalIndices(); 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;} Index HasHalo1() const; Index HasHalo2() const; Index HasBoundary1() const; Index HasBoundary2() const; 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: SpatialExtent(); 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_PROPERTIES_HPP_ */