OpenLB 1.7
Loading...
Searching...
No Matches
postProcessing.hh
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2006, 2007, 2008 Jonas Latt
4 * E-mail contact: info@openlb.net
5 * The most recent release of OpenLB can be downloaded at
6 * <http://www.openlb.net/>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program; if not, write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22*/
23
24#ifndef POST_PROCESSING_HH
25#define POST_PROCESSING_HH
26
27
28namespace olb {
29
31
32template <typename T, typename DESCRIPTOR>
34{
35 return _name;
36}
37
38template <typename T, typename DESCRIPTOR>
40{
41 return _name;
42}
43
44template <typename T, typename DESCRIPTOR>
46{
47 return _priority;
48}
49
51
52template<typename T, typename DESCRIPTOR>
54 int x0_, int x1_, int y0_, int y1_)
55 : x0(x0_), x1(x1_), y0(y0_), y1(y1_)
56{ }
57
58template<typename T, typename DESCRIPTOR>
60{
61 x0 += deltaX;
62 x1 += deltaX;
63 y0 += deltaY;
64 y1 += deltaY;
65}
66
67template<typename T, typename DESCRIPTOR>
69{
70 x0 += delta[0];
71 x1 += delta[0];
72 y0 += delta[1];
73 y1 += delta[1];
74}
75
76template<typename T, typename DESCRIPTOR>
78extract(int x0_, int x1_, int y0_, int y1_)
79{
80 int newX0, newX1, newY0, newY1;
81 if ( util::intersect (
82 x0, x1, y0, y1,
83 x0_, x1_, y0_, y1_,
84 newX0, newX1, newY0, newY1 ) ) {
85 x0 = newX0;
86 x1 = newX1;
87 y0 = newY0;
88 y1 = newY1;
89 return true;
90 }
91 else {
92 return false;
93 }
94}
95
96template<typename T, typename DESCRIPTOR>
98{
99 return extract(lower[0], upper[0], lower[1], upper[1]);
100}
101
102template<typename T, typename DESCRIPTOR>
104{
105 x0 = lower[0];
106 x1 = upper[0];
107 y0 = lower[1];
108 y1 = upper[1];
109}
110
111template<typename T, typename DESCRIPTOR>
112void PostProcessorGenerator2D<T,DESCRIPTOR>::reset(int x0_, int x1_, int y0_, int y1_)
113{
114 x0 = x0_;
115 x1 = x1_;
116 y0 = y0_;
117 y1 = y1_;
118}
119
120
122
123template<typename T, typename DESCRIPTOR>
125 int x0_, int x1_, int y0_, int y1_)
126 : x0(x0_), x1(x1_), y0(y0_), y1(y1_)
127{ }
128
129template<typename T, typename DESCRIPTOR>
131{
132 x0 += delta[0];
133 x1 += delta[0];
134 y0 += delta[1];
135 y1 += delta[1];
136}
137
138template<typename T, typename DESCRIPTOR>
140{
141 x0 += deltaX;
142 x1 += deltaX;
143 y0 += deltaY;
144 y1 += deltaY;
145}
147template<typename T, typename DESCRIPTOR>
148bool LatticeCouplingGenerator2D<T,DESCRIPTOR>::extract(int x0_, int x1_, int y0_, int y1_)
149{
150 int newX0, newX1, newY0, newY1;
151 if ( util::intersect (
152 x0, x1, y0, y1,
153 x0_, x1_, y0_, y1_,
154 newX0, newX1, newY0, newY1 ) ) {
155 x0 = newX0;
156 x1 = newX1;
157 y0 = newY0;
158 y1 = newY1;
159 return true;
160 }
161 else {
162 return false;
163 }
164}
165
166template<typename T, typename DESCRIPTOR>
168{
169 return extract(lower[0], upper[0], lower[1], upper[1]);
170}
171
172template<typename T, typename DESCRIPTOR>
173void LatticeCouplingGenerator2D<T,DESCRIPTOR>::reset(int x0_, int x1_, int y0_, int y1_)
174{
175 x0 = x0_;
176 x1 = x1_;
177 y0 = y0_;
178 y1 = y1_;
179}
181template<typename T, typename DESCRIPTOR>
184 reset(lower[0], upper[0], lower[1], upper[1]);
190
191template <typename T, typename DESCRIPTOR>
193{
194 return _name;
195}
196
197template <typename T, typename DESCRIPTOR>
199{
200 return _name;
201}
202
203template <typename T, typename DESCRIPTOR>
205{
206 return _priority;
207}
208
210
211template<typename T, typename DESCRIPTOR>
213 int x0_, int x1_, int y0_, int y1_, int z0_, int z1_)
214 : x0(x0_), x1(x1_), y0(y0_), y1(y1_), z0(z0_), z1(z1_)
215{ }
216
217template<typename T, typename DESCRIPTOR>
219 int deltaX, int deltaY, int deltaZ, int iC_ )
220{
221 x0 += deltaX;
222 x1 += deltaX;
223 y0 += deltaY;
224 y1 += deltaY;
225 z0 += deltaZ;
226 z1 += deltaZ;
227 iC = iC_;
228}
229
230template<typename T, typename DESCRIPTOR>
232 LatticeR<3> delta, int iC_)
233{
234 x0 += delta[0];
235 x1 += delta[0];
236 y0 += delta[1];
237 y1 += delta[1];
238 z0 += delta[2];
239 z1 += delta[2];
240 iC = iC_;
241}
242
243template<typename T, typename DESCRIPTOR>
245extract(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_)
246{
247 int newX0, newX1, newY0, newY1, newZ0, newZ1;
248 if ( util::intersect (
249 x0, x1, y0, y1, z0, z1,
250 x0_, x1_, y0_, y1_, z0_, z1_,
251 newX0, newX1, newY0, newY1, newZ0, newZ1 ) ) {
252 x0 = newX0;
253 x1 = newX1;
254 y0 = newY0;
255 y1 = newY1;
256 z0 = newZ0;
257 z1 = newZ1;
258 return true;
259 }
260 else {
261 return false;
262 }
263}
264
265template<typename T, typename DESCRIPTOR>
267{
268 return extract(lower[0], upper[0], lower[1], upper[1], lower[2], upper[2]);
269}
270
271template<typename T, typename DESCRIPTOR>
273{
274 x0 = lower[0];
275 x1 = upper[0];
276 y0 = lower[1];
277 y1 = upper[1];
278 z0 = lower[2];
279 z1 = upper[2];
280}
281
282template<typename T, typename DESCRIPTOR>
284reset(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_)
285{
286 x0 = x0_;
287 x1 = x1_;
288 y0 = y0_;
289 y1 = y1_;
290 z0 = z0_;
291 z1 = z1_;
292}
293
295
296template<typename T, typename DESCRIPTOR>
298 int x0_, int x1_, int y0_, int y1_, int z0_, int z1_)
299 : x0(x0_), x1(x1_), y0(y0_), y1(y1_), z0(z0_), z1(z1_), iC(-1)
300{ }
301
302template<typename T, typename DESCRIPTOR>
304{
305 x0 += delta[0];
306 x1 += delta[0];
307 y0 += delta[1];
308 y1 += delta[1];
309 z0 += delta[2];
310 z1 += delta[2];
311 iC = iC_;
312}
313
314template<typename T, typename DESCRIPTOR>
316 int deltaX, int deltaY, int deltaZ, int iC_)
317{
318 x0 += deltaX;
319 x1 += deltaX;
320 y0 += deltaY;
321 y1 += deltaY;
322 z0 += deltaZ;
323 z1 += deltaZ;
324 iC = iC_;
325}
326
327template<typename T, typename DESCRIPTOR>
329extract(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_)
330{
331 int newX0, newX1, newY0, newY1, newZ0, newZ1;
332 if ( util::intersect (
333 x0, x1, y0, y1, z0, z1,
334 x0_, x1_, y0_, y1_, z0_, z1_,
335 newX0, newX1, newY0, newY1, newZ0, newZ1 ) ) {
336 x0 = newX0;
337 x1 = newX1;
338 y0 = newY0;
339 y1 = newY1;
340 z0 = newZ0;
341 z1 = newZ1;
342 return true;
343 }
344 else {
345 return false;
346 }
347}
348
349template<typename T, typename DESCRIPTOR>
351{
352 return extract(lower[0], upper[0], lower[1], upper[1], lower[2], upper[2]);
353}
354
355template<typename T, typename DESCRIPTOR>
357{
358 x0 = lower[0];
359 x1 = upper[0];
360 y0 = lower[1];
361 y1 = upper[1];
362 z0 = lower[2];
363 z1 = upper[2];
364}
365
366template<typename T, typename DESCRIPTOR>
368reset(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_)
369{
370 x0 = x0_;
371 x1 = x1_;
372 y0 = y0_;
373 y1 = y1_;
374 z0 = z0_;
375 z1 = z1_;
376}
377
379
380template <typename BLOCK>
382{ }
383
384template <typename BLOCK>
386{
387 if (!blockLattice.statisticsEnabled()) {
388 return;
389 }
390
391 blockLattice.getStatistics().reset();
392}
393
394} // namespace olb
395
396#endif
bool extract(int x0_, int x1_, int y0_, int y1_)
void shift(LatticeR< 2 > delta)
void reset(int x0_, int x1_, int y0_, int y1_)
LatticeCouplingGenerator2D(int x0_, int x1_, int y0_, int y1_)
void reset(LatticeR< 3 > lower, LatticeR< 3 > upper)
void shift(LatticeR< 3 > delta, int iC_=-1)
bool extract(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_)
std::string & getName()
read and write access to name
int getPriority() const
read only access to priority
std::string & getName()
read and write access to name
int getPriority() const
read only access to priority
bool extract(int x0_, int x1_, int y0_, int y1_)
void shift(int deltaX, int deltaY)
PostProcessorGenerator2D(int x0_, int x1_, int y0_, int y1_)
void reset(int x0_, int x1_, int y0_, int y1_)
bool extract(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_)
PostProcessorGenerator3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_)
void shift(int deltaX, int deltaY, int deltaZ, int iC_=-1)
void reset(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_)
Plain old scalar vector.
Definition vector.h:47
bool intersect(int x0, int x1, int y0, int y1, int x0_, int x1_, int y0_, int y1_, int &newX0, int &newX1, int &newY0, int &newY1)
Definition util.h:89
Top level namespace for all of OpenLB.
void apply(BLOCK &blockLattice)
void setup(BLOCK &blockLattice)