Functions

cc_pos.c File Reference

Functions to compute (x1,x2,x3) positions of cells i,j,k. More...

Go to the source code of this file.

Functions

void cc_pos (const GridS *pG, const int i, const int j, const int k, Real *px1, Real *px2, Real *px3)
 given i,j,k returns cell-centered x1,x2,x3
void fc_pos (const GridS *pG, const int i, const int j, const int k, Real *px1, Real *px2, Real *px3)
 given i,j,k returns face-centered x1,x2,x3
Real x1vc (const GridS *pG, const int i)
int celli (const GridS *pGrid, const Real x, const Real dx1_1, int *i, Real *a)
 given x, returns containing cell first index.
Real x1cc (const Grid *pGrid, const int i)
 given i, returns cell-centered x1.
int cellj (const Grid *pGrid, const Real y, const Real dx2_1, int *j, Real *b)
 given y, returns containing cell first index.
Real x2cc (const Grid *pGrid, const int j)
 given j, returns cell-centered x2.
int cellk (const Grid *pGrid, const Real z, const Real dx3_1, int *k, Real *c)
 given z, returns containing cell first index.
Real x3cc (const Grid *pGrid, const int k)
 given k, returns cell-centered x3.

Detailed Description

Functions to compute (x1,x2,x3) positions of cells i,j,k.

PURPOSE: Functions to compute (x1,x2,x3) positions of cells i,j,k. In a nested grid, each Grid structure is a patch in a larger computational domain (with the exception of the level0 grid). The displacement of the origin of the Grid from the origin of the computational domain (level0 grid) is x1_{disp} = idisp*dx1. Furthermore, the origin of the level0 grid can be displaced by a distance x1_{0} from the origin of x1. Thus, the x1 position of the center of cell i (x1_{cc,i}) in any level Grid is x1_{cc,i} = x1_{0} + ((i + idisp) + 0.5)*dx1 Similarly for x2 and x3.

CONTAINS PUBLIC FUNCTIONS:

Definition in file cc_pos.c.


Function Documentation

void cc_pos ( const GridS pG,
const int  i,
const int  j,
const int  k,
Real px1,
Real px2,
Real px3 
)
int celli ( const GridS pGrid,
const Real  x,
const Real  dx1_1,
int *  i,
Real a 
)

given x, returns containing cell first index.

Definition at line 86 of file cc_pos.c.

Referenced by getwei_linear(), getwei_QP(), and getwei_TSC().

Here is the caller graph for this function:

cellj ( const Grid *  pGrid,
const Real  y,
const Real  dx2_1,
int *  j,
Real b 
)

given y, returns containing cell first index.

Definition at line 104 of file cc_pos.c.

Referenced by getwei_linear(), getwei_QP(), getwei_TSC(), and problem().

Here is the caller graph for this function:

int cellk ( const Grid *  pGrid,
const Real  z,
const Real  dx3_1,
int *  k,
Real c 
)

given z, returns containing cell first index.

Definition at line 122 of file cc_pos.c.

Referenced by getwei_linear(), getwei_QP(), getwei_TSC(), and problem().

Here is the caller graph for this function:

void fc_pos ( const GridS pG,
const int  i,
const int  j,
const int  k,
Real px1,
Real px2,
Real px3 
)

given i,j,k returns face-centered x1,x2,x3

Definition at line 51 of file cc_pos.c.

References GridS::dx1, GridS::dx2, GridS::dx3, GridS::is, GridS::js, GridS::ks, and GridS::MinX.

Referenced by OutData1(), and OutData2().

Here is the caller graph for this function:

Real x1cc ( const Grid *  pGrid,
const int  i 
)

given i, returns cell-centered x1.

Definition at line 96 of file cc_pos.c.

Referenced by x1vc().

Here is the caller graph for this function:

Real x1vc ( const GridS pG,
const int  i 
)

Definition at line 61 of file cc_pos.c.

References GridS::dx1, GridS::is, GridS::MinX, and x1cc().

Referenced by Bpsub(), Bzsub(), integrate_1d_ctu(), integrate_2d_ctu(), integrate_3d_ctu(), Mrpsub(), Msub(), Pbsub(), and problem().

Here is the call graph for this function:

Here is the caller graph for this function:

Real x2cc ( const Grid *  pGrid,
const int  j 
)

given j, returns cell-centered x2.

Definition at line 114 of file cc_pos.c.

Real x3cc ( const Grid *  pGrid,
const int  k 
)

given k, returns cell-centered x3.

Definition at line 132 of file cc_pos.c.