source: src/grid/grid_indexing.hpp@ 48b662

Last change on this file since 48b662 was 48b662, checked in by Olaf Lenz <olenz@…>, 14 years ago

Moved files in scafacos_fcs one level up.

git-svn-id: https://svn.version.fz-juelich.de/scafacos/trunk@847 5161e1c8-67bf-11de-9fd5-51895aff932f

  • Property mode set to 100644
File size: 4.6 KB
Line 
1/**
2 * @file grid_indexing.hpp
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
10#ifndef GRID_INDEXING_HPP_
11#define GRID_INDEXING_HPP_
12
13#include "base/index.hpp"
14#include "base/vector.hpp"
15
16namespace VMG
17{
18
19class GlobalIndices
20{
21public:
22 const Index& Size() const {return size;} ///< Global grid size including boundary
23 const Index& Begin() const {return begin;} ///< Global index of first local grid point
24 const Index& End() const {return end;} ///< Global index of first non-local grid point
25 const Index& AlignmentBegin() const {return alignmentBegin;} ///< Global index of first point of the next higher level
26 const Index& AlignmentEnd() const {return alignmentEnd;}
27 const BT& BoundaryType() const {return boundary;}
28
29 Index& Size() {return size;} ///< Global grid size including boundary
30 Index& Begin() {return begin;} ///< Global index of first local grid point
31 Index& End() {return end;} ///< Global index of first non-local grid point
32 Index& AlignmentBegin() {return alignmentBegin;} ///< Global index of first point of the next higher level
33 Index& AlignmentEnd() {return alignmentEnd;}
34 BT& BoundaryType() {return boundary;}
35
36private:
37 Index size;
38 Index begin;
39 Index end;
40 Index alignmentBegin, alignmentEnd;
41 BT boundary;
42};
43
44class LocalIndices
45{
46public:
47 const Index& Size() const {return size;} ///< Local grid size excluding halo
48 const Index& SizeTotal() const {return sizeTotal;} ///< Local grid size including halo and boundary
49 const Index& Begin() const {return begin;} ///< Index of first local grid point
50 const Index& End() const {return end;} ///< Index of first non-local grid point
51
52 Index& Size() {return size;} ///< Local grid size excluding halo
53 Index& SizeTotal() {return sizeTotal;} ///< Local grid size including halo and boundary
54 Index& Begin() {return begin;} ///< Index of first local grid point
55 Index& End() {return end;} ///< Index of first non-local grid point
56
57 const Index& HaloBegin1() const {return haloBegin1;} ///< Index of first halo point
58 const Index& HaloBegin2() const {return haloBegin2;} ///< Index of first halo point
59 const Index& HaloEnd1() const {return haloEnd1;} ///< Index of first non-halo point
60 const Index& HaloEnd2() const {return haloEnd2;} ///< Index of first non-halo point
61
62 Index& HaloBegin1() {return haloBegin1;} ///< Index of first halo point
63 Index& HaloBegin2() {return haloBegin2;} ///< Index of first halo point
64 Index& HaloEnd1() {return haloEnd1;} ///< Index of first non-halo point
65 Index& HaloEnd2() {return haloEnd2;} ///< Index of first non-halo point
66
67 const Index& BoundaryBegin1() const {return boundaryBegin1;} ///< Index of first boundary point
68 const Index& BoundaryBegin2() const {return boundaryBegin2;} ///< Index of first boundary point
69 const Index& BoundaryEnd1() const {return boundaryEnd1;} ///< Index of first non-boundary point
70 const Index& BoundaryEnd2() const {return boundaryEnd2;} ///< Index of first non-boundary point
71
72 Index& BoundaryBegin1() {return boundaryBegin1;} ///< Index of first boundary point
73 Index& BoundaryBegin2() {return boundaryBegin2;} ///< Index of first boundary point
74 Index& BoundaryEnd1() {return boundaryEnd1;} ///< Index of first non-boundary point
75 Index& BoundaryEnd2() {return boundaryEnd2;} ///< Index of first non-boundary point
76
77 const Index& AlignmentBegin() const {return alignmentBegin;}
78 const Index& AlignmentEnd() const {return alignmentEnd;}
79
80 Index& AlignmentBegin() {return alignmentBegin;}
81 Index& AlignmentEnd() {return alignmentEnd;}
82
83private:
84 Index size;
85 Index sizeTotal;
86 Index begin;
87 Index end;
88 Index haloBegin1, haloEnd1;
89 Index haloBegin2, haloEnd2;
90 Index boundaryBegin1, boundaryEnd1;
91 Index boundaryBegin2, boundaryEnd2;
92 Index alignmentBegin, alignmentEnd;
93};
94
95class SpatialExtent
96{
97public:
98 const Vector& Size() const {return size;}
99 const Index& SizeFactor() const {return size_factor;}
100 const Vector& Begin() const {return begin;}
101 const Vector& End() const {return end;}
102 const Vector& MeshWidth() const {return meshWidth;}
103
104 Vector& Size() {return size;}
105 Index& SizeFactor() {return size_factor;}
106 Vector& Begin() {return begin;}
107 Vector& End() {return end;}
108 Vector& MeshWidth() {return meshWidth;}
109
110private:
111 Vector size;
112 Index size_factor;
113 Vector begin;
114 Vector end;
115 Vector meshWidth;
116};
117
118}
119
120#endif /* GRID_INDEXING_HPP_ */
Note: See TracBrowser for help on using the repository browser.