An object PrintGrid is a special regular grid created to write tree-structured data into an output file. More...
#include <PrintGrid.h>
Public Member Functions | |
PrintGrid (int L) | |
~PrintGrid () | |
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. More... | |
Vector | value (const int i, const int j, const int k) const |
Returns the cell-average vector located at i, j, k. More... | |
real | value (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. More... | |
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 boundary conditions. More... | |
real | density (const int i, const int j, const int k) const |
Returns the cell-average density located at i, j, k. More... | |
real | psi (const int i, const int j, const int k) const |
Returns the cell-average density located at i, j, k. More... | |
real | pressure (const int i, const int j, const int k) const |
Returns the cell-average pressure located at i, j, k. More... | |
real | temperature (const int i, const int j, const int k) const |
Returns the cell-average temperature located at i, j, k. More... | |
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. More... | |
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. More... | |
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. More... | |
Vector | velocity (const int i, const int j, const int k) const |
Returns the cell-average velocity located at i, j, k. More... | |
real | divergenceB (const int i, const int j, const int k) const |
Returns the divergence of magnetic field B located at i, j, k. More... | |
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, located at i, j, k. Does not work for MHD! More... | |
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. More... | |
Vector | magField (const int i, const int j, const int k) const |
Returns the cell-average velocity located at i, j, k. More... | |
void | refresh () |
Stores the cell-average values of the current grid into temporary values, in order to compute cell-averages in the next finer grid. More... | |
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. More... | |
void | computePointValue () |
Transform cell-average values into point values. More... | |
An object PrintGrid is a special regular grid created to write tree-structured data into an output file.
It contains the following data:
To write tree-structured data into a regular fine grid, one starts with the grid of level 0 and one stops at the level L. For a given grid of level l and a given element i, j, k of this grid, if the node of the tree corresponding to the element is a leaf, the value is replaced by the one of the node, else it is predicted from parents.
Such grid does not contain any cell information, in order to reduce memory requirements.
PrintGrid::PrintGrid | ( | int | L | ) |
Constructor of PrintGrid class. Generates a grid of 2**(Dimension*L) elements.
PrintGrid::~PrintGrid | ( | ) |
Distructor of the PrintGrid class. Removes the grid.
real PrintGrid::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 boundary conditions.
i | Position x |
j | Position y |
k | Position z |
QuantityNo | Number of MHD variables. |
void PrintGrid::computePointValue | ( | ) |
Transform cell-average values into point values.
real PrintGrid::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.
i | Position x |
j | Position y |
k | Position z |
|
inline |
Returns the cell-average density located at i, j, k.
i | Position x |
j | Position y |
k | Position z |
real PrintGrid::divergenceB | ( | const int | i, |
const int | j, | ||
const int | k | ||
) | const |
Returns the divergence of magnetic field B located at i, j, k.
i | Position x |
j | Position y |
k | Position z |
|
inline |
Returns the cell-average energy per unit of volume located at i, j, k.
i | Position x |
j | Position y |
k | Position z |
|
inline |
Returns the AxisNo-th component of the cell-average velocity located at i, j, k.
i | Position x |
j | Position y |
k | Position z |
AxisNo | Axis of interest |
Vector PrintGrid::magField | ( | const int | i, |
const int | j, | ||
const int | k | ||
) | const |
Returns the cell-average velocity located at i, j, k.
i | Position x |
j | Position y |
k | Position z |
void PrintGrid::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.
l | Level |
i | Position x |
j | Position y |
k | Position z |
real PrintGrid::pressure | ( | const int | i, |
const int | j, | ||
const int | k | ||
) | const |
Returns the cell-average pressure located at i, j, k.
i | Position x |
j | Position y |
k | Position z |
|
inline |
Returns the cell-average density located at i, j, k.
i | Position x |
j | Position y |
k | Position z |
void PrintGrid::refresh | ( | ) |
void PrintGrid::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.
i | Position x |
j | Position y |
k | Position z |
UserAverage | Vector of averages |
real PrintGrid::temperature | ( | const int | i, |
const int | j, | ||
const int | k | ||
) | const |
Returns the cell-average temperature located at i, j, k.
i | Position x |
j | Position y |
k | Position z |
Vector PrintGrid::value | ( | const int | i, |
const int | j, | ||
const int | k | ||
) | const |
Returns the cell-average vector located at i, j, k.
i | Position x |
j | Position y |
k | Position z |
real PrintGrid::value | ( | 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.
i | Position x |
j | Position y |
k | Position z |
QuantityNo | Number of MHD variables. |
|
inline |
Returns the AxisNo-th component of the cell-average velocity located at i, j, k.
i | Position x |
j | Position y |
k | Position z |
AxisNo | Axis of interest. |
Vector PrintGrid::velocity | ( | const int | i, |
const int | j, | ||
const int | k | ||
) | const |
Returns the cell-average velocity located at i, j, k.
i | Position x |
j | Position y |
k | Position z |
real PrintGrid::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, located at i, j, k. Does not work for MHD!
i | Position x |
j | Position y |
k | Position z |
dx + 0.5*abs(By1)/dy + 1.120e-13;