An object Cell contains all the informations of a cell for both multiresolution and finite volume computations. More...
#include <Cell.h>

Public Member Functions | |
| Cell () | |
| Cell constructor. More... | |
| ~Cell () | |
| Cell distructor. More... | |
| void | operator= (const Cell &C) |
| Defines the cell operators. It is possible to obtain the cell values as: More... | |
| void | setSize (const int AxisNo, const real UserSize) |
| Sets the size of the cell in the direction AxisNo to UserSize. Example: More... | |
| void | setSize (const Vector &UserSize) |
| Sets the size of the cell in every direction to the vector UserSize . Example: More... | |
| void | setCenter (const int AxisNo, const real UserX) |
| Sets the coordinate of the cell-center in the direction AxisNo to UserX. Example: More... | |
| void | setCenter (const Vector &UserX) |
| Sets the position of the cell-center to the vector UserX. Example: More... | |
| void | setAverage (const int QuantityNo, const real UserAverage) |
| Sets the cell-average of the quantity QuantityNo to UserAverage. Example: More... | |
| void | setAverage (const Vector &UserAverage) |
| Sets all the cell-average quantities to the vector UserAverage. Example: More... | |
| void | setAverageZero () |
| Sets all the cell-average values to zero. More... | |
| void | setTempAverage (const int QuantityNo, const real UserAverage) |
| Identical to setAverage (int QuantityNo, real UserAverage), but for the vector of the temporary cell-average values. More... | |
| void | setTempAverage (const Vector &UserAverage) |
| Identical to void setAverage (const Vector& UserAverage), but for the vector of the temporary cell-average values. More... | |
| void | setTempAverageZero () |
| Sets all the temmporary cell-average values to zero. More... | |
| void | setLowAverage (const int QuantityNo, const real UserAverage) |
| Identical to setAverage (int QuantityNo, real UserAverage), but for the vector of the cell-average values with low precision in the Runge-Kutta-Fehlberg method. More... | |
| void | setLowAverage (const Vector &UserAverage) |
| Identical to void setAverage (const Vector& UserAverage), void setAverage (const Vector& UserAverage), but for the vector of the cell-average values with low precision in the Runge-Kutta-Fehlberg method. More... | |
| void | setOldAverage (const int QuantityNo, const real UserAverage) |
| Identical to setAverage (int QuantityNo, real UserAverage), but for the vector of the old cell-average values. More... | |
| void | setOldAverage (const Vector &UserAverage) |
| Identical to void setAverage (const Vector& UserAverage), but for the vector of the cell-average values. More... | |
| void | setDivergence (const int QuantityNo, const real UserAverage) |
| Identical to void setAverage (int QuantityNo, real UserAverage), but for the divergence vector. More... | |
| void | setDivergence (const Vector &UserAverage) |
| Identical to void setAverage (const Vector& UserAverage), but for the divergence vector. More... | |
| void | setPsiGrad (const int Dimension, const real UserAverage) |
| Identical to void setAverage (int QuantityNo, real UserAverage), but for the gradient of psi vector. More... | |
| void | setPsiGrad (const Vector &UserAverage) |
| Identical to void setAverage (int QuantityNo, real UserAverage), but for the gradient of psi vector. More... | |
| void | setRes (const real UserAverage) |
| Set resistivity. More... | |
| void | setDivergenceZero () |
| Sets all the components of the divergence vector to zero. More... | |
| void | setGradient (const int i, const int j, const real UserAverage) |
| Sets the component no. i, j of the quantity gradient to UserAverage. More... | |
| void | setTempGradient (const int i, const int j, const real UserAverage) |
| Identical to the previous one for the temporary values. Does not work for MHD! More... | |
| void | setGradient (const Matrix &UserAverage) |
| Sets the quantity gradient to the matrix UserAverage. Does not work for MHD! Example: More... | |
| void | setTempGradient (const Matrix &UserAverage) |
| dentical to the previous one for the temporary values. More... | |
| void | setGradientZero () |
| Sets all the components of the velocity gradient to zero. More... | |
| bool | isInsideBoundary () const |
| Returns true if the cell is inside the boundary. More... | |
| bool | isInFluid () const |
| Returns true if the cell is inside the fluid. More... | |
| real | size (const int AxisNo) const |
| Returns the cell size in the direction AxisNo. More... | |
| Vector | size () const |
| Returns the vector cointaining the cell size in every direction. More... | |
| real | center (const int AxisNo) const |
| Returns the component no. AxisNo of the cell-center position. More... | |
| Vector | center () const |
| Returns the cell-center position vector. More... | |
| real | average (const int QuantityNo) const |
| Returns the component no. QuantityNo of the cell-average value. More... | |
| Vector | average () const |
| Returns the cell-average value vector. More... | |
| real | tempAverage (const int QuantityNo) const |
| Returns the component no. QuantityNo of the temporary cell-average value. More... | |
| Vector | tempAverage () const |
| Returns the temporary cell-average value vector. More... | |
| real | lowAverage (const int QuantityNo) const |
| Returns the component no. QuantityNo of the cell-average value with low precision in the Runge-Kutta-Fehlberg method. More... | |
| Vector | lowAverage () const |
| Returns the cell-average vector with low precision in the Runge-Kutta-Fehlberg method. More... | |
| real | oldAverage (const int QuantityNo) const |
| Returns the component no. QuantityNo of the old cell-average values. More... | |
| Vector | oldAverage () const |
| Returns the old cell-average values. More... | |
| real | divergence (const int QuantityNo) const |
| Returns the component no. QuantityNo of the divergence vector. More... | |
| Vector | divergence () const |
| Returns the divergence vector. More... | |
| real | PsiGrad (const int Dimension) const |
| Returns the component of PsiGrad vector. More... | |
| Vector | PsiGrad () const |
| Returns the PsiGrad vector. More... | |
| real | gradient (const int i, const int j) const |
| Returns the component no. i, j of the velocity gradient. Does not work for MHD! More... | |
| real | tempGradient (const int i, const int j) const |
| Identical to the previous one for the temporary values. More... | |
| Matrix | gradient () const |
| Returns the velocity gradient in matrix form. More... | |
| Matrix | tempGradient () const |
| Identical to the previous one for the temporary values. More... | |
| real | density () const |
| Returns the cell-average density. More... | |
| real | tempDensity () const |
| Identical to the previous one for the temporary values. More... | |
| real | psi () const |
| Returns the cell-average density. More... | |
| real | tempPsi () const |
| Identical to the previous one for the temporary values. More... | |
| real | etaConst () const |
| Returns the cell-average resistivity. More... | |
| real | pressure () const |
| Returns the cell-average pressure. More... | |
| real | tempPressure () const |
| Identical to the previous one for the temporary values. More... | |
| real | oldPressure () const |
| Identical to the previous one for the values at the instant n-1. More... | |
| real | temperature () const |
| Returns the cell-average temperature. Does not work for MHD! More... | |
| real | tempTemperature () const |
| Identical to the previous one for the temporary values. Does not work for MHD! More... | |
| real | concentration () const |
| Returns the cell-average concentration of the limiting reactant. Does not work for MHD! More... | |
| real | energy () const |
| Returns the cell-average energy per unit of volume. More... | |
| real | tempEnergy () const |
| Identical to the previous one for the temporary values. More... | |
| real | magField (const int AxisNo) const |
| Returns the component no. AxisNo of the cell-average magnetic field. More... | |
| real | tempMagField (const int AxisNo) const |
| Identical to the previous one for the temporary values. More... | |
| Vector | magField () const |
| Returns the cell-average magnetic field vector. More... | |
| Vector | tempMagField () const |
| Identical to the previous one for the temporary values. More... | |
| real | velocity (const int AxisNo) const |
| Returns the component no. AxisNo of the cell-average velocity. More... | |
| real | tempVelocity (const int AxisNo) const |
| Identical to the previous one for the temporary values. More... | |
| Vector | velocity () const |
| Returns the cell-average velocity vector. More... | |
| Vector | tempVelocity () const |
| Identical to the previous one for the temporary values. More... | |
| real | speedOfSound () const |
| Returns the cell-average speed of sound. More... | |
| real | entropy () const |
| Returns the entropy (p/rho^Gamma). Does not work for MHD! More... | |
| real | fastSpeed (const int AxisNo) const |
| Returns the fast speed vector. More... | |
| real | volume () const |
| Returns the volume of the cell (length in 1D, area in 2D, volume in 3D). More... | |
| bool | isOverflow () const |
| Return true if one of the cell-average quantities is greater than the maximum. This usually means the computation is numerically unstable. More... | |
Public Attributes | |
| Vector | X |
| Vector | dX |
| Vector | Q |
| Vector | Qs |
| Vector | Qlow |
| Vector | Qold |
| Vector | D |
| real | Res |
| Vector | PGrad |
| Matrix | Grad |
| Matrix | Grads |
An object Cell contains all the informations of a cell for both multiresolution and finite volume computations.
| Cell::Cell | ( | ) |
Cell constructor.
| Cell::~Cell | ( | ) |
Cell distructor.
|
inline |
Returns the component no. QuantityNo of the cell-average value.
| QuantityNo | Number of MHD variables = 9. |

|
inline |
|
inline |
Returns the component no. AxisNo of the cell-center position.
| AxisNo | Space direction the function is computed. |

|
inline |
|
inline |
Returns the cell-average concentration of the limiting reactant. Does not work for MHD!
|
inline |
Returns the cell-average density.

|
inline |
Returns the component no. QuantityNo of the divergence vector.
| QuantityNo | Number of MHD variables = 9. |

|
inline |
|
inline |
Returns the cell-average energy per unit of volume.

|
inline |
Returns the entropy (p/rho^Gamma). Does not work for MHD!
|
inline |
| real Cell::fastSpeed | ( | const int | AxisNo | ) | const |
Returns the fast speed vector.
Computes the fast magnetoacoustic wave at each direction.
| AxisNo |
| AxisNo | Number of axis of interest. 1: x-direction, 2: y-direction, 3: z-direction. |

|
inline |
Returns the component no. i, j of the velocity gradient. Does not work for MHD!
| i | |
| j |

| bool Cell::isInFluid | ( | ) | const |
Returns true if the cell is inside the fluid.
brief Returns true if the cell is inside the boundary
return bool
| bool Cell::isInsideBoundary | ( | ) | const |
Returns true if the cell is inside the boundary.

| bool Cell::isOverflow | ( | ) | const |
Return true if one of the cell-average quantities is greater than the maximum. This usually means the computation is numerically unstable.

|
inline |
Returns the component no. QuantityNo of the cell-average value with low precision in the Runge-Kutta-Fehlberg method.
| QuantityNo | Number of MHD variables = 9. |

|
inline |
Returns the cell-average vector with low precision in the Runge-Kutta-Fehlberg method.
|
inline |
Returns the component no. AxisNo of the cell-average magnetic field.
| AxisNo |

| Vector Cell::magField | ( | ) | const |
Returns the cell-average magnetic field vector.
Computes the magnetic field. Allocates the magnetic field initial condition Q[i+6] to its components.

|
inline |
Returns the component no. QuantityNo of the old cell-average values.
| QuantityNo | Number of MHD variables = 9. |

| real Cell::oldPressure | ( | ) | const |
Identical to the previous one for the values at the instant n-1.
Computes the pressure of the fluid at the instant n-1. This value is useful for time integration computations.

| void Cell::operator= | ( | const Cell & | C | ) |
Defines the cell operators. It is possible to obtain the cell values as:
| C | Cell of interest |
| real Cell::pressure | ( | ) | const |
Returns the cell-average pressure.
Computes the pressure of the fluid. The pressure is computed in terms of the energy density, velocity and magnetic field. It is given by (Gamma-1.)*(rhoE - .5*(rhoV*rhoV)/rho - .5*(B*B)); return double.

|
inline |
Returns the cell-average density.

|
inline |
Returns the component of PsiGrad vector.
| Dimension |

|
inline |
Sets the cell-average of the quantity QuantityNo to UserAverage. Example:
#include "Carmen.h"
QuantityNb = 2;
real T=0.,Y=1.;
Cell c;
c.setAverage(1,T);
c.setAverage(2,Y);
| QuantityNo | Number of MHD variables |
| UserAverage | Average value |

|
inline |
|
inline |
Sets all the cell-average values to zero.

|
inline |
Sets the coordinate of the cell-center in the direction AxisNo to UserX. Example:
#include "Carmen.h"
Dimension = 3;
real x=1., y=0., z=0.;
Cell c;
c.setCenter(1,x);
c.setCenter(2,y);
c.setCenter(3,z);
| AxisNo | Number of axis of interest. 1: x-direction, 2: y-direction, 3: z-direction. |
| UserX | Center of the cell. |

|
inline |
|
inline |
Identical to void setAverage (int QuantityNo, real UserAverage), but for the divergence vector.
| QuantityNo | Number of MHD variables |
| UserAverage | Divergence values |

|
inline |
Identical to void setAverage (const Vector& UserAverage), but for the divergence vector.
| UserAverage | Divergence values |
|
inline |
Sets all the components of the divergence vector to zero.
|
inline |
Sets the component no. i, j of the quantity gradient to UserAverage.
Does not work for MHD!
Example:
#include "Carmen.h"
QuantityNb = 2;
real Gxx=0., Gxy=1., Gyx=1., Gyy=0.;
Cell c;
c.setGradient(1,1,Gxx);
c.setGradient(1,2,Gxy);
c.setGradient(2,1,Gyx);
c.setGradient(2,2,Gyy);
| i | |
| j | |
| UserAverage | Gradient value |

|
inline |
|
inline |
Sets all the components of the velocity gradient to zero.
|
inline |
Identical to setAverage (int QuantityNo, real UserAverage), but for the vector of the cell-average values with low precision in the Runge-Kutta-Fehlberg method.
| QuantityNo | Number of MHD variables |
| UserAverage | Average value |

|
inline |
Identical to void setAverage (const Vector& UserAverage), void setAverage (const Vector& UserAverage), but for the vector of the cell-average values with low precision in the Runge-Kutta-Fehlberg method.
| UserAverage | Average value |
|
inline |
Identical to setAverage (int QuantityNo, real UserAverage), but for the vector of the old cell-average values.
| QuantityNo | Number of MHD variables |
| UserAverage | Average value |

|
inline |
Identical to void setAverage (const Vector& UserAverage), but for the vector of the cell-average values.
| UserAverage | Average value |
|
inline |
Identical to void setAverage (int QuantityNo, real UserAverage), but for the gradient of psi vector.
| Dimension | Dimension of the system |
| UserAverage | Gradient of psi value |

|
inline |
Identical to void setAverage (int QuantityNo, real UserAverage), but for the gradient of psi vector.
| UserAverage | Gradient of psi value |
|
inline |
|
inline |
Sets the size of the cell in the direction AxisNo to UserSize. Example:
#include "Carmen.h"
Dimension = 2;
real dx=1., dy=2.;
Cell c;
c.setSize(1, dx);
c.setSize(2, dy);
| AxisNo | Number of axis of interest. 1: x-direction, 2: y-direction, 3: z-direction. |
| UserSize | Size of the cell. |

|
inline |
|
inline |
Identical to setAverage (int QuantityNo, real UserAverage), but for the vector of the temporary cell-average values.
| QuantityNo | Number of MHD variables |
| UserAverage | Average value |

|
inline |
Identical to void setAverage (const Vector& UserAverage), but for the vector of the temporary cell-average values.
| UserAverage | Average value |
|
inline |
Sets all the temmporary cell-average values to zero.
|
inline |
Identical to the previous one for the temporary values. Does not work for MHD!
| i | |
| j | |
| UserAverage | Gradient value |

|
inline |
dentical to the previous one for the temporary values.
| UserAverage | Gradient value |
|
inline |
Returns the cell size in the direction AxisNo.
| AxisNo | Space direction the function is computed. |

|
inline |
|
inline |
Returns the cell-average speed of sound.
|
inline |
Returns the component no. QuantityNo of the temporary cell-average value.
| QuantityNo | Number of MHD variables = 9. |

|
inline |
|
inline |
Identical to the previous one for the temporary values.

|
inline |
Identical to the previous one for the temporary values.
| real Cell::temperature | ( | ) | const |
Returns the cell-average temperature. Does not work for MHD!
Computes the temperature. Not useful for MHD computarions.

|
inline |
Identical to the previous one for the temporary values.
| i | |
| j |
|
inline |
Identical to the previous one for the temporary values.
|
inline |
Identical to the previous one for the temporary values.
| AxisNo |
| Vector Cell::tempMagField | ( | ) | const |
Identical to the previous one for the temporary values.
Computes temporary the magnetic field. This value is useful for time integration computations.
| real Cell::tempPressure | ( | ) | const |
Identical to the previous one for the temporary values.
Computes the temporary pressure of the fluid. This computation is needed for the Runge-Kutta time integration.

|
inline |
Identical to the previous one for the temporary values.
| real Cell::tempTemperature | ( | ) | const |
Identical to the previous one for the temporary values. Does not work for MHD!
Computes the temporary temperature. Not useful for MHD computarions.
|
inline |
| Vector Cell::tempVelocity | ( | ) | const |
Identical to the previous one for the temporary values.
Computes the temporary velocity of the fluid. This value is useful for time integration computations.
|
inline |
Returns the component no. AxisNo of the cell-average velocity.
| AxisNo |

| Vector Cell::velocity | ( | ) | const |
Returns the cell-average velocity vector.
Computes the velocity of the fluid. Allocates the velocity initial condition Q[i+6] to its components.
| real Cell::volume | ( | ) | const |
Returns the volume of the cell (length in 1D, area in 2D, volume in 3D).
Computes the volume of a cell.
| Vector Cell::D |
Divergence vector. Its dimension is QuantityNb.
| Matrix Cell::Grad |
Quantity gradient. Only necessary for a Navier-Stokes computation. Not working!
| Matrix Cell::Grads |
Temporary quantity gradient. Only necessary for a Navier-Stokes computation. Not working!
| Vector Cell::PGrad |
Gradient of psi scalar function. Its dimension is Dimension.
| Vector Cell::Qlow |
This vector is used to store the cell-averages computed with the N-stage Runge-Kutta-Fehlberg N(N+1) method.
| Vector Cell::Qold |
Cell-average values at the instant n-1.
| Vector Cell::Qs |
Temporary cell-average values. This vector is used to store the intermediary value in a multi-step Runge-Kutta or McCormack time integration.
| real Cell::Res |
Resistivity scalar function.
| Vector Cell::X |
Position of the cell center. Its dimension is Dimension.
1.8.6