source: src/grid/grid_properties.hpp@ dfed1c

Last change on this file since dfed1c was dfed1c, checked in by Julian Iseringhausen <isering@…>, 14 years ago

Major vmg update.

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

  • Property mode set to 100644
File size: 5.0 KB
Line 
1/**
2 * @file grid_properties.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_PROPERTIES_HPP_
11#define GRID_PROPERTIES_HPP_
12
13#include "base/defs.hpp"
14#include "base/index.hpp"
15#include "base/vector.hpp"
16
17namespace VMG
18{
19
20class GlobalIndices
21{
22public:
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
35 const BT& BoundaryType() const {return boundary;}
36
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
47 BT& BoundaryType() {return boundary;}
48
49private:
50 Index begin_finest, end_finest, size_finest;
51 Index begin_local, end_local, size_local;
52 Index size_global;
53 BT boundary;
54};
55
56class LocalIndices
57{
58public:
59 LocalIndices();
60
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
97 Index HasHalo1() const;
98 Index HasHalo2() const;
99 Index HasBoundary1() const;
100 Index HasBoundary2() const;
101
102private:
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
114class SpatialExtent
115{
116public:
117 SpatialExtent();
118
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
131private:
132 Vector size;
133 Index size_factor;
134 Vector begin;
135 Vector end;
136 Vector meshWidth;
137};
138
139}
140
141#endif /* GRID_PROPERTIES_HPP_ */
Note: See TracBrowser for help on using the repository browser.