Carmen Code
 All Classes Files Functions Variables Macros Pages
FineMesh.h
Go to the documentation of this file.
1 /***************************************************************************
2  FineMesh.h - description
3  -------------------
4  begin : Wed Jun 13 2001
5  copyright : (C) 2001 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 
18 /***************************************************************************
19  * An object FineMesh is a regular fine mesh, used for
20  * finite volume computations.
21  * It is not used for multiresolution computations.
22  *
23  * It contains an array of cells <i>*MeshCell</i>.
24  *
25  * NOTE: for reasons of simplicity, only periodic and Neuman boundary conditions have been
26  * implemented.
27  */
28 
40 class FineMesh
41 {
42 /*
43 ______________________________________________________________________________________________
44 
45 PUBLIC METHODS
46 
47  Constructor and distructor
48 ______________________________________________________________________________________________
49 
50 */
51 public:
52 
59 FineMesh();
60 
65 ~FineMesh();
66 /*
67 ______________________________________________________________________________________________
68 
69  Time evolution procedures
70 ______________________________________________________________________________________________
71 
72 */
73 
79 void store();
80 
86 void storeGrad();
87 
94 void computeDivergence(int);
95 
102 void computeDivergence_cell(int);
103 
110 void RungeKutta_cell(int);
111 
112  //each cells
119 void RungeKutta(int);
120 
126 void computeIntegral();
127 
134 void computeCorrection(int);
135 
142 void computeCorrection_cell(int);
143 
151 void computeGradient(int);
152 
160 void computeGradient_cell(int);
161 
167 void computeTimeAverage();
168 
176 void checkStability() const;
177 
178 /*
179 ______________________________________________________________________________________________
180 
181  Output procedures
182 ______________________________________________________________________________________________
183 
184 */
185 
192 void writeHeader(const char* FileName) const;
193 
200 void writeAverage(const char* FileName);
201 
208 void writeTimeAverage(const char* FileName) const;
209 /*
210 ______________________________________________________________________________________________
211 
212  Backup-restore procedure (to restart a computation)
213 ______________________________________________________________________________________________
214 
215 */
222 void backup();
223 
230 void restore();
231 
232 
233 //Parallel
235  ***Neighbour_iU,
236  ***Neighbour_jL,
237  ***Neighbour_jU,
238  ***Neighbour_kL,
239  ***Neighbour_kU;
241 /*
242 ______________________________________________________________________________________________
243 
244 PRIVATE METHODS AND VARIABLES
245 ______________________________________________________________________________________________
246 
247 */
248 
249 //parallel modification
250 
251 /***************************************************************************
252  * Returns pointer to the cell located at <i>i, j, k</i>.
253  *
254  */
255 public:
258 private:
259  Cell* cell(const int i, const int j, const int k) const;
261 /***************************************************************************
262  * Returns pointer to the <i>n</i>-th cell.
263  *
264  */
265  inline Cell* cell(const int n) const;
268 /***************************************************************************
269  * Compute coarse grid data and store fine grid data in temporary
270  *
271  */
272  void coarsen();
275 /***************************************************************************
276  * Restore fine grid data from temporary. Inverse of : coarsen()
277  *
278  */
279  void refine();
282 /***************************************************************************
283  * Array of cells
284  *
285  */
286  TimeAverageGrid *MyTimeAverageGrid;
288 };
289 
290 
291 /*
292 ______________________________________________________________________________________________
293 
294 INLINE FUNCTIONS
295 ______________________________________________________________________________________________
296 
297 */
298 
299 inline Cell* FineMesh::cell(const int n) const
300 {
301  return (MeshCell +n);
302 }
303 
304 
305 
Cell *** Neighbour_iU
Definition: FineMesh.h:234
void writeTimeAverage(const char *FileName) const
Write time-averages into file FileName.
Definition: FineMesh.cpp:1835
void computeCorrection(int)
Computes divergence cleaning source term (only for MHD).
Definition: FineMesh.cpp:540
An object Cell contains all the informations of a cell for both multiresolution and finite volume com...
Definition: Cell.h:41
void checkStability() const
Checks if the computation is numerically unstable, i.e. if one of the cell-averages is overflow...
Definition: FineMesh.cpp:927
An object FineMesh is a regular fine mesh, used for finite volume computations. It is not used for mu...
Definition: FineMesh.h:40
void restore()
Restores the tree structure and the cell-averages from the file carmen.bak. This file was created by ...
Definition: FineMesh.cpp:1768
FineMesh()
Constructor of FineMesh class Generates a regular fine mesh containing 2**(Dimension*ScaleNb) cells...
Definition: FineMesh.cpp:33
void computeTimeAverage()
Computes the time-average value in every cell.
Definition: FineMesh.cpp:1803
void computeIntegral()
Computes integral values like e.g. flame velocity, global error, etc.
Definition: FineMesh.cpp:965
void computeCorrection_cell(int)
Computes divergence cleaning source term (only for MHD) at one cell.
Definition: FineMesh.cpp:507
void computeDivergence_cell(int)
Computes one Cell Divirgence.
Definition: FineMesh.cpp:334
Cell *** Neighbour_jU
Definition: FineMesh.h:234
Cell *** Neighbour_iL
Definition: FineMesh.h:234
Cell *** Neighbour_kU
Definition: FineMesh.h:234
void RungeKutta_cell(int)
Computes one Runge-Kutta step.
Definition: FineMesh.cpp:763
void RungeKutta(int)
Computes the Runge-Kutta step.
Definition: FineMesh.cpp:807
void storeGrad()
Stores gradient values into temporary gradient values.
Definition: FineMesh.cpp:910
void writeAverage(const char *FileName)
Write cell-averages for GNUplot, Data Explorer, TecPLot and VTK into file FileName.
Definition: FineMesh.cpp:1263
Cell *** Neighbour_kL
Definition: FineMesh.h:234
Time Average Grid.
Definition: TimeAverageGrid.h:24
void store()
Stores cell-average values into temporary cell-average values.
Definition: FineMesh.cpp:882
~FineMesh()
Destructor the regular fine mesh.
Definition: FineMesh.cpp:250
void computeGradient_cell(int)
Computes velocity gradient (only for Navier-Stokes). each cells.
Definition: FineMesh.cpp:614
void computeDivergence(int)
Computes the divergence vector with the space discretization scheme.
Definition: FineMesh.cpp:426
Cell *** Neighbour_jL
Definition: FineMesh.h:234
Cell * MeshCell
Definition: FineMesh.h:256
void backup()
Backs up the tree structure and the cell-averages into a file carmen.bak. In further computations...
Definition: FineMesh.cpp:1741
void computeGradient(int)
Computes velocity gradient (only for Navier-Stokes). one cell.
Definition: FineMesh.cpp:689
void writeHeader(const char *FileName) const
Write header for GNUplot, Data Explorer, TecPLot and VTK into file FileName.
Definition: FineMesh.cpp:1096