| [48b662] | 1 | /**
|
|---|
| [dfed1c] | 2 | * @file grid_properties.hpp
|
|---|
| [48b662] | 3 | * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
|
|---|
| 4 | * @date Mon Apr 18 12:54:05 2011
|
|---|
| 5 | *
|
|---|
| 6 | * @brief VMG::GlobalIndices, VMG::LocalIndices and VMG::SpatialExtent
|
|---|
| 7 | *
|
|---|
| 8 | */
|
|---|
| 9 |
|
|---|
| [dfed1c] | 10 | #ifndef GRID_PROPERTIES_HPP_
|
|---|
| 11 | #define GRID_PROPERTIES_HPP_
|
|---|
| [48b662] | 12 |
|
|---|
| [dfed1c] | 13 | #include "base/defs.hpp"
|
|---|
| [48b662] | 14 | #include "base/index.hpp"
|
|---|
| 15 | #include "base/vector.hpp"
|
|---|
| 16 |
|
|---|
| 17 | namespace VMG
|
|---|
| 18 | {
|
|---|
| 19 |
|
|---|
| 20 | class GlobalIndices
|
|---|
| 21 | {
|
|---|
| 22 | public:
|
|---|
| [dfed1c] | 23 | GlobalIndices();
|
|---|
| 24 |
|
|---|
| 25 | const Index& BeginFinest() const {return begin_finest;} ///< Global index of first local grid point
|
|---|
| 26 | const Index& EndFinest() const {return end_finest;} ///< Global index of first non-local grid point
|
|---|
| 27 | const Index& SizeFinest() const {return size_finest;} ///< Global grid size including boundary
|
|---|
| 28 |
|
|---|
| 29 | const Index& BeginLocal() const {return begin_local;}
|
|---|
| 30 | const Index& EndLocal() const {return end_local;}
|
|---|
| 31 | const Index& SizeLocal() const {return size_local;}
|
|---|
| 32 |
|
|---|
| 33 | const Index& SizeGlobal() const {return size_global;}
|
|---|
| 34 |
|
|---|
| [48b662] | 35 | const BT& BoundaryType() const {return boundary;}
|
|---|
| 36 |
|
|---|
| [dfed1c] | 37 | Index& BeginFinest() {return begin_finest;} ///< Global index of first local grid point
|
|---|
| 38 | Index& EndFinest() {return end_finest;} ///< Global index of first non-local grid point
|
|---|
| 39 | Index& SizeFinest() {return size_finest;} ///< Global grid size including boundary
|
|---|
| 40 |
|
|---|
| 41 | Index& BeginLocal() {return begin_local;}
|
|---|
| 42 | Index& EndLocal() {return end_local;}
|
|---|
| 43 | Index& SizeLocal() {return size_local;}
|
|---|
| 44 |
|
|---|
| 45 | Index& SizeGlobal() {return size_global;}
|
|---|
| 46 |
|
|---|
| [48b662] | 47 | BT& BoundaryType() {return boundary;}
|
|---|
| 48 |
|
|---|
| 49 | private:
|
|---|
| [dfed1c] | 50 | Index begin_finest, end_finest, size_finest;
|
|---|
| 51 | Index begin_local, end_local, size_local;
|
|---|
| 52 | Index size_global;
|
|---|
| [48b662] | 53 | BT boundary;
|
|---|
| 54 | };
|
|---|
| 55 |
|
|---|
| 56 | class LocalIndices
|
|---|
| 57 | {
|
|---|
| 58 | public:
|
|---|
| [dfed1c] | 59 | LocalIndices();
|
|---|
| 60 |
|
|---|
| [48b662] | 61 | const Index& Size() const {return size;} ///< Local grid size excluding halo
|
|---|
| 62 | const Index& SizeTotal() const {return sizeTotal;} ///< Local grid size including halo and boundary
|
|---|
| 63 | const Index& Begin() const {return begin;} ///< Index of first local grid point
|
|---|
| 64 | const Index& End() const {return end;} ///< Index of first non-local grid point
|
|---|
| 65 |
|
|---|
| 66 | Index& Size() {return size;} ///< Local grid size excluding halo
|
|---|
| 67 | Index& SizeTotal() {return sizeTotal;} ///< Local grid size including halo and boundary
|
|---|
| 68 | Index& Begin() {return begin;} ///< Index of first local grid point
|
|---|
| 69 | Index& End() {return end;} ///< Index of first non-local grid point
|
|---|
| 70 |
|
|---|
| 71 | const Index& HaloBegin1() const {return haloBegin1;} ///< Index of first halo point
|
|---|
| 72 | const Index& HaloBegin2() const {return haloBegin2;} ///< Index of first halo point
|
|---|
| 73 | const Index& HaloEnd1() const {return haloEnd1;} ///< Index of first non-halo point
|
|---|
| 74 | const Index& HaloEnd2() const {return haloEnd2;} ///< Index of first non-halo point
|
|---|
| 75 |
|
|---|
| 76 | Index& HaloBegin1() {return haloBegin1;} ///< Index of first halo point
|
|---|
| 77 | Index& HaloBegin2() {return haloBegin2;} ///< Index of first halo point
|
|---|
| 78 | Index& HaloEnd1() {return haloEnd1;} ///< Index of first non-halo point
|
|---|
| 79 | Index& HaloEnd2() {return haloEnd2;} ///< Index of first non-halo point
|
|---|
| 80 |
|
|---|
| 81 | const Index& BoundaryBegin1() const {return boundaryBegin1;} ///< Index of first boundary point
|
|---|
| 82 | const Index& BoundaryBegin2() const {return boundaryBegin2;} ///< Index of first boundary point
|
|---|
| 83 | const Index& BoundaryEnd1() const {return boundaryEnd1;} ///< Index of first non-boundary point
|
|---|
| 84 | const Index& BoundaryEnd2() const {return boundaryEnd2;} ///< Index of first non-boundary point
|
|---|
| 85 |
|
|---|
| 86 | Index& BoundaryBegin1() {return boundaryBegin1;} ///< Index of first boundary point
|
|---|
| 87 | Index& BoundaryBegin2() {return boundaryBegin2;} ///< Index of first boundary point
|
|---|
| 88 | Index& BoundaryEnd1() {return boundaryEnd1;} ///< Index of first non-boundary point
|
|---|
| 89 | Index& BoundaryEnd2() {return boundaryEnd2;} ///< Index of first non-boundary point
|
|---|
| 90 |
|
|---|
| 91 | const Index& AlignmentBegin() const {return alignmentBegin;}
|
|---|
| 92 | const Index& AlignmentEnd() const {return alignmentEnd;}
|
|---|
| 93 |
|
|---|
| 94 | Index& AlignmentBegin() {return alignmentBegin;}
|
|---|
| 95 | Index& AlignmentEnd() {return alignmentEnd;}
|
|---|
| 96 |
|
|---|
| [dfed1c] | 97 | Index HasHalo1() const;
|
|---|
| 98 | Index HasHalo2() const;
|
|---|
| 99 | Index HasBoundary1() const;
|
|---|
| 100 | Index HasBoundary2() const;
|
|---|
| 101 |
|
|---|
| [48b662] | 102 | private:
|
|---|
| 103 | Index size;
|
|---|
| 104 | Index sizeTotal;
|
|---|
| 105 | Index begin;
|
|---|
| 106 | Index end;
|
|---|
| 107 | Index haloBegin1, haloEnd1;
|
|---|
| 108 | Index haloBegin2, haloEnd2;
|
|---|
| 109 | Index boundaryBegin1, boundaryEnd1;
|
|---|
| 110 | Index boundaryBegin2, boundaryEnd2;
|
|---|
| 111 | Index alignmentBegin, alignmentEnd;
|
|---|
| 112 | };
|
|---|
| 113 |
|
|---|
| 114 | class SpatialExtent
|
|---|
| 115 | {
|
|---|
| 116 | public:
|
|---|
| [dfed1c] | 117 | SpatialExtent();
|
|---|
| 118 |
|
|---|
| [48b662] | 119 | const Vector& Size() const {return size;}
|
|---|
| 120 | const Index& SizeFactor() const {return size_factor;}
|
|---|
| 121 | const Vector& Begin() const {return begin;}
|
|---|
| 122 | const Vector& End() const {return end;}
|
|---|
| 123 | const Vector& MeshWidth() const {return meshWidth;}
|
|---|
| 124 |
|
|---|
| 125 | Vector& Size() {return size;}
|
|---|
| 126 | Index& SizeFactor() {return size_factor;}
|
|---|
| 127 | Vector& Begin() {return begin;}
|
|---|
| 128 | Vector& End() {return end;}
|
|---|
| 129 | Vector& MeshWidth() {return meshWidth;}
|
|---|
| 130 |
|
|---|
| 131 | private:
|
|---|
| 132 | Vector size;
|
|---|
| 133 | Index size_factor;
|
|---|
| 134 | Vector begin;
|
|---|
| 135 | Vector end;
|
|---|
| 136 | Vector meshWidth;
|
|---|
| 137 | };
|
|---|
| 138 |
|
|---|
| 139 | }
|
|---|
| 140 |
|
|---|
| [dfed1c] | 141 | #endif /* GRID_PROPERTIES_HPP_ */
|
|---|