Carmen Code
 All Classes Files Functions Variables Macros Pages
PrintGrid.h
Go to the documentation of this file.
1 /***************************************************************************
2  PrintGrid.h - description
3  -------------------
4  begin : Tue Mar 19 2002
5  copyright : (C) 2002 by Olivier Roussel & Alexei Tsigulin
6  email : roussel@ict.uni-karlsruhe.de, lpsoft@mail.ru
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
38 class PrintGrid
39 {
40 /*
41 ______________________________________________________________________________________________
42 
43 DESCRIPTION
44 
45  This is a grid of level L used to print data into file.
46 
47 ______________________________________________________________________________________________
48 
49 PUBLIC METHODS
50 
51  Constructor and distructor
52 ______________________________________________________________________________________________
53 
54 */
55 
56 public:
57  PrintGrid(int L);
59  ~PrintGrid();
61 /*
62 ______________________________________________________________________________________________
63 
64  Set and get procedures
65 ______________________________________________________________________________________________
66 
67 */
68 
78 void setValue(const int i, const int j, const int k, const Vector& UserAverage);
79 
88 Vector value(const int i, const int j, const int k) const;
89 
99 real value(const int i, const int j, const int k, const int QuantityNo) const;
100 
111 real cellValue(const int i, const int j, const int k, const int QuantityNo) const;
112 
121 inline real density(const int i, const int j, const int k) const;
122 
131 inline real psi(const int i, const int j, const int k) const;
132 
141 real pressure(const int i, const int j, const int k) const;
142 
151 real temperature(const int i, const int j, const int k) const;
152 
161 real concentration(const int i, const int j, const int k) const;
162 
171 inline real energy(const int i, const int j, const int k) const;
172 
182 inline real velocity(const int i, const int j, const int k, const int AxisNo) const;
183 
192 Vector velocity(const int i, const int j, const int k) const;
193 
202 real divergenceB(const int i, const int j, const int k) const;
203 
213 real vorticity(const int i, const int j, const int k) const;
214 
224 inline real magField(const int i, const int j, const int k, const int AxisNo) const;
225 
234 Vector magField(const int i, const int j, const int k) const;
235 
236 /*
237 ______________________________________________________________________________________________
238 
239  Refresh and predict procedure
240 ______________________________________________________________________________________________
241 
242 */
243 
250 void refresh();
251 
262 void predict(const int l, const int i, const int j, const int k);
263 
269 void computePointValue();
270 /*
271 ______________________________________________________________________________________________
272 
273 PRIVATE VARIABLES AND METHODS
274 ______________________________________________________________________________________________
275 
276 */
277 
278 private:
289  Vector tempValue(const int l, const int i, const int j, const int k) const;
290 
291  int localScaleNb;
292  int elementNb;
293  Vector *Q;
294  Vector *Qt;
295 };
296 
297 
298 /*
299 ______________________________________________________________________________________________
300 
301 INLINE FUNCTIONS
302 ______________________________________________________________________________________________
303 
304 */
305 
306 inline real PrintGrid::density(const int i, const int j, const int k) const
307 {
308  return value(i,j,k,1);
309 }
310 
311 /*
312 ______________________________________________________________________________________________
313 
314 */
315 
316 inline real PrintGrid::psi(const int i, const int j, const int k) const
317 {
318  return value(i,j,k,6);
319 }
320 
321 /*
322 ______________________________________________________________________________________________
323 
324 */
325 
326 inline real PrintGrid::energy(const int i, const int j, const int k) const
327 {
328  return value(i,j,k,5);
329 }
330 
331 
332 /*
333 ______________________________________________________________________________________________
334 
335 */
336 
337 inline real PrintGrid::velocity(const int i, const int j, const int k, const int AxisNo) const
338 {
339  return cellValue(i,j,k,AxisNo+1)/cellValue(i,j,k,1);
340 }
341 
342 /*
343 ______________________________________________________________________________________________
344 
345 */
346 
347 inline real PrintGrid::magField(const int i, const int j, const int k, const int AxisNo) const
348 {
349  return cellValue(i,j,k,AxisNo+6);
350 }
void computePointValue()
Transform cell-average values into point values.
Definition: PrintGrid.cpp:543
Standard class for every vector in Carmen.
Definition: Vector.h:29
void predict(const int l, const int i, const int j, const int k)
Predicts the cell-average values of the current grid from the values stored in the temporary ones...
Definition: PrintGrid.cpp:474
real cellValue(const int i, const int j, const int k, const int QuantityNo) const
Returns the quantity QuantityNo of the cell-average vector located at i, j, k, taking into account bo...
Definition: PrintGrid.cpp:113
real magField(const int i, const int j, const int k, const int AxisNo) const
Returns the AxisNo-th component of the cell-average velocity located at i, j, k.
Definition: PrintGrid.h:347
real pressure(const int i, const int j, const int k) const
Returns the cell-average pressure located at i, j, k.
Definition: PrintGrid.cpp:184
real velocity(const int i, const int j, const int k, const int AxisNo) const
Returns the AxisNo-th component of the cell-average velocity located at i, j, k.
Definition: PrintGrid.h:337
An object PrintGrid is a special regular grid created to write tree-structured data into an output fi...
Definition: PrintGrid.h:38
~PrintGrid()
Definition: PrintGrid.cpp:59
PrintGrid(int L)
Definition: PrintGrid.cpp:30
void refresh()
Stores the cell-average values of the current grid into temporary values, in order to compute cell-av...
Definition: PrintGrid.cpp:462
real energy(const int i, const int j, const int k) const
Returns the cell-average energy per unit of volume located at i, j, k.
Definition: PrintGrid.h:326
real psi(const int i, const int j, const int k) const
Returns the cell-average density located at i, j, k.
Definition: PrintGrid.h:316
real concentration(const int i, const int j, const int k) const
Returns the cell-average concentration of the limiting reactant, located at i, j, k...
Definition: PrintGrid.cpp:219
Vector value(const int i, const int j, const int k) const
Returns the cell-average vector located at i, j, k.
Definition: PrintGrid.cpp:86
real divergenceB(const int i, const int j, const int k) const
Returns the divergence of magnetic field B located at i, j, k.
Definition: PrintGrid.cpp:235
real temperature(const int i, const int j, const int k) const
Returns the cell-average temperature located at i, j, k.
Definition: PrintGrid.cpp:202
real density(const int i, const int j, const int k) const
Returns the cell-average density located at i, j, k.
Definition: PrintGrid.h:306
void setValue(const int i, const int j, const int k, const Vector &UserAverage)
Sets the cell-average vector located at i, j, k to UserAverage.
Definition: PrintGrid.cpp:71
real vorticity(const int i, const int j, const int k) const
Returns 0 in 1D, the scalar vorticity in 2D, the norm of the cell-average vorticity in 3D...
Definition: PrintGrid.cpp:294
#define real
Definition: PreProcessor.h:31