Time Average Grid.
More...
#include <TimeAverageGrid.h>
|
| TimeAverageGrid (const int UserScaleNb, const int UserQuantityNb) |
| Constructor of TimeAverageGrid class. For a given variable number. More...
|
|
| TimeAverageGrid (const int UserScaleNb) |
| Constructor of TimeAverageGrid class. More...
|
|
| ~TimeAverageGrid () |
| Destructor of TimeAverageGrid clas. More...
|
|
void | updateValue (const int ElementNo, const int QuantityNo, const real UserValue) |
| Update Values. For a given element. More...
|
|
void | updateValue (const int i, const int j, const int k, const int QuantityNo, const real UserValue) |
| Update Values. At position i,j,k. More...
|
|
void | updateValue (const int i, const int j, const int k, const Vector arg) |
| Update values. More...
|
|
void | updateSample () |
| Update number of samples. More...
|
|
real | value (const int ElementNo, const int QuantityNo) const |
| Get value at the position ElementNo. More...
|
|
real | value (const int i, const int j, const int k, const int QuantityNo) const |
| Get value at the position i,j,k. More...
|
|
real | density (const int i, const int j, const int k) const |
| Get density at the position i,j,k. More...
|
|
real | velocity (const int i, const int j, const int k, const int AxisNo) const |
| Get velocity at the position i,j,k. More...
|
|
real | stress (const int i, const int j, const int k, const int No) const |
|
TimeAverageGrid::TimeAverageGrid |
( |
const int |
UserScaleNb, |
|
|
const int |
UserQuantityNb |
|
) |
| |
Constructor of TimeAverageGrid class. For a given variable number.
- Parameters
-
UserScaleNb | Level |
UserQuantityNb | Variable number |
36 LocalScaleNb = UserScaleNb;
37 LocalQuantityNb = UserQuantityNb;
38 ElementNb = 1 << (
Dimension*LocalScaleNb );
45 for (i=0;i<ElementNb;i++) Q[i].setDimension(LocalQuantityNb);
Standard class for every vector in Carmen.
Definition: Vector.h:29
int Dimension
Definition: Parameters.cpp:74
TimeAverageGrid::TimeAverageGrid |
( |
const int |
UserScaleNb | ) |
|
Constructor of TimeAverageGrid class.
- Parameters
-
77 LocalScaleNb = UserScaleNb;
78 ElementNb = 1 << (
Dimension*LocalScaleNb );
85 for (i=0;i<ElementNb;i++) Q[i].setDimension(LocalQuantityNb);
Standard class for every vector in Carmen.
Definition: Vector.h:29
int Dimension
Definition: Parameters.cpp:74
TimeAverageGrid::~TimeAverageGrid |
( |
| ) |
|
real TimeAverageGrid::density |
( |
const int |
i, |
|
|
const int |
j, |
|
|
const int |
k |
|
) |
| const |
|
inline |
Get density at the position i,j,k.
- Parameters
-
i | Position x |
j | Position y |
k | Position z |
- Returns
- real
161 return value(i,j,k,1);
real value(const int ElementNo, const int QuantityNo) const
Get value at the position ElementNo.
Definition: TimeAverageGrid.h:196
real TimeAverageGrid::stress |
( |
const int |
i, |
|
|
const int |
j, |
|
|
const int |
k, |
|
|
const int |
No |
|
) |
| const |
193 real rhoV1=0., rhoV2=0., rhoV1V2=0.;
198 rhoV1 =
value(i,j,k,2);
199 rhoV2 =
value(i,j,k,2);
204 rhoV1 =
value(i,j,k,2);
205 rhoV2 =
value(i,j,k,3);
210 rhoV1 =
value(i,j,k,3);
211 rhoV2 =
value(i,j,k,3);
216 rhoV1 =
value(i,j,k,2);
217 rhoV2 =
value(i,j,k,4);
222 rhoV1 =
value(i,j,k,3);
223 rhoV2 =
value(i,j,k,4);
228 rhoV1 =
value(i,j,k,4);
229 rhoV2 =
value(i,j,k,4);
234 return ( ( rhoV1V2 - (rhoV1*rhoV2)/rho )/rho );
real value(const int ElementNo, const int QuantityNo) const
Get value at the position ElementNo.
Definition: TimeAverageGrid.h:196
int Dimension
Definition: Parameters.cpp:74
real density(const int i, const int j, const int k) const
Get density at the position i,j,k.
Definition: TimeAverageGrid.h:159
#define real
Definition: PreProcessor.h:31
void TimeAverageGrid::updateSample |
( |
| ) |
|
|
inline |
Update number of samples.
- Returns
- void
void TimeAverageGrid::updateValue |
( |
const int |
ElementNo, |
|
|
const int |
QuantityNo, |
|
|
const real |
UserValue |
|
) |
| |
Update Values. For a given element.
- Parameters
-
ElementNo | Element number |
QuantityNo | Variable number |
UserValue | Real value |
- Returns
- void
109 real eps = 1./(SampleNb+1.);
111 (Q+ElementNo)->setValue(QuantityNo, eps*UserValue + (1-eps)*(Q+ElementNo)->
value(QuantityNo));
real value(const int ElementNo, const int QuantityNo) const
Get value at the position ElementNo.
Definition: TimeAverageGrid.h:196
#define real
Definition: PreProcessor.h:31
void TimeAverageGrid::updateValue |
( |
const int |
i, |
|
|
const int |
j, |
|
|
const int |
k, |
|
|
const int |
QuantityNo, |
|
|
const real |
UserValue |
|
) |
| |
Update Values. At position i,j,k.
- Parameters
-
i | Position x |
j | Position y |
k | Position z |
QuantityNo | Variable number |
UserValue | Real value |
- Returns
- void
125 int n = (1<<LocalScaleNb);
126 int ElementNo = i + n*(j + n*k);
void updateValue(const int ElementNo, const int QuantityNo, const real UserValue)
Update Values. For a given element.
Definition: TimeAverageGrid.cpp:107
void TimeAverageGrid::updateValue |
( |
const int |
i, |
|
|
const int |
j, |
|
|
const int |
k, |
|
|
const Vector |
arg |
|
) |
| |
Update values.
- Parameters
-
i | Position x |
j | Position y |
k | Position z |
arg | Vector |
- Returns
- void
140 real U=0., V=0., W=0.;
145 U = arg.
value(2)/rho;
void updateValue(const int ElementNo, const int QuantityNo, const real UserValue)
Update Values. For a given element.
Definition: TimeAverageGrid.cpp:107
int Dimension
Definition: Parameters.cpp:74
real value(const int n) const
Returns the value of the component n.
Definition: Vector.h:565
#define real
Definition: PreProcessor.h:31
real TimeAverageGrid::value |
( |
const int |
ElementNo, |
|
|
const int |
QuantityNo |
|
) |
| const |
|
inline |
Get value at the position ElementNo.
- Parameters
-
ElementNo | Element number |
QuantityNo | Variable number |
- Returns
- real
198 return (Q+ElementNo)->value(QuantityNo);
real TimeAverageGrid::value |
( |
const int |
i, |
|
|
const int |
j, |
|
|
const int |
k, |
|
|
const int |
QuantityNo |
|
) |
| const |
|
inline |
Get value at the position i,j,k.
- Parameters
-
i | Position x |
j | Position y |
k | Position z |
QuantityNo | Variable number |
- Returns
- real
210 return value(i + (1<<LocalScaleNb)*(j +(1<<LocalScaleNb)*k), QuantityNo);
real value(const int ElementNo, const int QuantityNo) const
Get value at the position ElementNo.
Definition: TimeAverageGrid.h:196
real TimeAverageGrid::velocity |
( |
const int |
i, |
|
|
const int |
j, |
|
|
const int |
k, |
|
|
const int |
AxisNo |
|
) |
| const |
|
inline |
Get velocity at the position i,j,k.
- Parameters
-
i | Position x |
j | Position y |
k | Position z |
AxisNo | Axis of interest |
- Returns
- real
real value(const int ElementNo, const int QuantityNo) const
Get value at the position ElementNo.
Definition: TimeAverageGrid.h:196
The documentation for this class was generated from the following files: