OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
GuardCellSizes.hpp
Go to the documentation of this file.
1// -*- C++ -*-
2/***************************************************************************
3 *
4 * The IPPL Framework
5 *
6 * This program was prepared by PSI.
7 * All rights in the program are reserved by PSI.
8 * Neither PSI nor the author(s)
9 * makes any warranty, express or implied, or assumes any liability or
10 * responsibility for the use of this software
11 *
12 * Visit www.amas.web.psi for more details
13 *
14 ***************************************************************************/
15
16// -*- C++ -*-
17/***************************************************************************
18 *
19 * The IPPL Framework
20 *
21 *
22 * Visit http://people.web.psi.ch/adelmann/ for more details
23 *
24 ***************************************************************************/
25
26// include files
28
29
30template<unsigned Dim>
32{
33
34
35 for (unsigned d=0; d<Dim; ++d)
36 Left[d] = Right[d] = s;
37}
38
39template<unsigned Dim>
41{
42
43
44 for (unsigned d=0; d<Dim; ++d)
45 Left[d] = Right[d] = s[d];
46}
47
48template<unsigned Dim>
50{
51
52
53 for (unsigned d=0; d<Dim; ++d) {
54 Left[d] = l;
55 Right[d] = r;
56 }
57}
58
59template<unsigned Dim>
60GuardCellSizes<Dim>::GuardCellSizes(unsigned *l, unsigned *r)
61{
62
63
64 for (unsigned d=0; d<Dim; ++d) {
65 Left[d] = l[d];
66 Right[d] = r[d];
67 }
68}
69
70template<unsigned Dim>
72{
73
74
75 for (unsigned d=0; d<Dim; ++d)
76 Left[d] = s;
77}
78
79template<unsigned Dim>
81{
82
83
84 for (unsigned d=0; d<Dim; ++d)
85 Left[d] = s[d];
86}
87
88template<unsigned Dim>
89void GuardCellSizes<Dim>::set_Left(unsigned d, unsigned *s)
90{
91
92
93 Left[d] = s[d];
94}
95
96template<unsigned Dim>
98{
99
100
101 for (unsigned d=0; d<Dim; ++d)
102 Right[d] = s;
103}
104
105template<unsigned Dim>
107{
108
109
110 for (unsigned d=0; d<Dim; ++d)
111 Right[d] = s[d];
112}
113
114template<unsigned Dim>
115void GuardCellSizes<Dim>::set_Right(unsigned d, unsigned *s)
116{
117
118
119 Right[d] = s[d];
120}
121
123
124template<unsigned Dim>
125std::ostream&
126operator<<(std::ostream& out, const GuardCellSizes<Dim>& gc)
127{
128
129
130 for (unsigned d=0; d<Dim; ++d)
131 out << "[" << gc.left(d) << "," << gc.right(d) << "]";
132 return out;
133}
134
135/***************************************************************************
136 * $RCSfile: GuardCellSizes.cpp,v $ $Author: adelmann $
137 * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:26 $
138 * IPPL_VERSION_ID: $Id: GuardCellSizes.cpp,v 1.1.1.1 2003/01/23 07:40:26 adelmann Exp $
139 ***************************************************************************/
const unsigned Dim
std::ostream & operator<<(std::ostream &out, const GuardCellSizes< Dim > &gc)
unsigned left(unsigned d) const
void set_Right(unsigned s)
void set_Left(unsigned s)
unsigned right(unsigned d) const