Schnek
boundary.hpp
1 /*
2  * boundary.hpp
3  *
4  * Created on: 27 Sep 2012
5  * Author: Holger Schmitz
6  * Email: holger@notjustphysics.com
7  *
8  * Copyright 2012 Holger Schmitz
9  *
10  * This file is part of Schnek.
11  *
12  * Schnek is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation, either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * Schnek is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with Schnek. If not, see <http://www.gnu.org/licenses/>.
24  *
25  */
26 
27 #ifndef SCHNEK_BOUNDARY_HPP_
28 #define SCHNEK_BOUNDARY_HPP_
29 
30 #include "subgrid.hpp"
31 #include "field.hpp"
32 
33 namespace schnek {
34 
40 template<
41  size_t rank,
42  template<size_t> class CheckingPolicy = ArrayNoArgCheck
43 >
44 class Boundary
45 {
46  public:
50  typedef typename DomainType::LimitType LimitType;
51 
53  typedef enum {Min, Max} bound;
54 
55  private:
57  DomainType size;
58 
60  size_t delta;
61 
62  public:
65  Boundary();
66 
74  Boundary(const LimitType &lo, const LimitType &hi, int delta_);
75 
82  Boundary(DomainType &size_, int delta_);
83 
88  int getDelta() { return delta; }
89 
91  const DomainType& getDomain() { return size; }
92 
101  DomainType getGhostDomain(size_t dim, bound b);
102 
111  DomainType getGhostSourceDomain(size_t dim, bound b);
112 
122  DomainType getBoundaryDomain(size_t dim, bound b, bool stagger);
123 
125  DomainType getInnerDomain();
126 
127 
136  template<class GridType>
137  SubGrid<GridType, CheckingPolicy> getGhostBoundary(size_t dim, bound b, GridType &grid);
138 
148  template<
149  typename T,
150  template<size_t> class CheckingPolicy2,
151  template<typename, size_t> class StoragePolicy
152  >
155 };
156 
157 } // namespace schnek
158 
159 #include "boundary.t"
160 
161 #endif // SCHNEK_BOUNDARY_HPP_
162 
163 
164 
165 
Definition: boundary.hpp:44
Range< int, rank, CheckingPolicy > DomainType
The range type that contains the domain size.
Definition: boundary.hpp:48
Definition: field.hpp:41
DomainType getBoundaryDomain(size_t dim, bound b, bool stagger)
int getDelta()
Definition: boundary.hpp:88
Definition: algo.hpp:30
DomainType getGhostSourceDomain(size_t dim, bound b)
DomainType getGhostDomain(size_t dim, bound b)
SubGrid< GridType, CheckingPolicy > getGhostBoundary(size_t dim, bound b, GridType &grid)
DomainType getInnerDomain()
DomainType::LimitType LimitType
The array type that contains the limits of the domain.
Definition: boundary.hpp:50
const DomainType & getDomain()
Definition: boundary.hpp:91
bound
An enum specifying the location of a ghost domain.
Definition: boundary.hpp:53
Definition: subgrid.hpp:147