To manipulate structured grids. More...
Public Member Functions | |
Grid () | |
Construct a default grid with 10 intervals in each direction. | |
Grid (real_t xm, real_t xM, size_t npx) | |
Construct a 1-D structured grid given its extremal coordinates and number of intervals. More... | |
Grid (real_t xm, real_t xM, real_t ym, real_t yM, size_t npx, size_t npy) | |
Construct a 2-D structured grid given its extremal coordinates and number of intervals. More... | |
Grid (Point< real_t > m, Point< real_t > M, size_t npx, size_t npy) | |
Construct a 2-D structured grid given its extremal coordinates and number of intervals. More... | |
Grid (real_t xm, real_t xM, real_t ym, real_t yM, real_t zm, real_t zM, size_t npx, size_t npy, size_t npz) | |
Construct a 3-D structured grid given its extremal coordinates and number of intervals. More... | |
Grid (Point< real_t > m, Point< real_t > M, size_t npx, size_t npy, size_t npz) | |
Construct a 3-D structured grid given its extremal coordinates and number of intervals. More... | |
void | setXMin (const Point< real_t > &x) |
Set min. coordinates of the domain. More... | |
void | setXMax (const Point< real_t > &x) |
void | setDomain (real_t xmin, real_t xmax) |
Set Dimensions of the domain: 1-D case. More... | |
void | setDomain (real_t xmin, real_t xmax, real_t ymin, real_t ymax) |
Set Dimensions of the domain: 2-D case. More... | |
void | setDomain (real_t xmin, real_t xmax, real_t ymin, real_t ymax, real_t zmin, real_t zmax) |
Set Dimensions of the domain: 3-D case. More... | |
void | setDomain (Point< real_t > xmin, Point< real_t > xmax) |
Set Dimensions of the domain: 3-D case. More... | |
const Point< real_t > & | getXMin () const |
Return min. Coordinates of the domain. | |
const Point< real_t > & | getXMax () const |
Return max. Coordinates of the domain. | |
void | setN (size_t nx, size_t ny=0, size_t nz=0) |
Set number of grid intervals in the x , y and z -directions. More... | |
size_t | getNx () const |
Return number of grid intervals in the x -direction. | |
size_t | getNy () const |
Return number of grid intervals in the y -direction. More... | |
size_t | getNz () const |
Return number of grid intervals in the z-direction. More... | |
real_t | getHx () const |
Return grid size in the x-direction. | |
real_t | getHy () const |
Return grid size in the y-direction. | |
real_t | getHz () const |
Return grid size in the z-direction. | |
Point< real_t > | getCoord (size_t i) const |
Return coordinates a point with label i in a 1-D grid. | |
Point< real_t > | getCoord (size_t i, size_t j) const |
Return coordinates a point with label (i,j) in a 2-D grid. | |
Point< real_t > | getCoord (size_t i, size_t j, size_t k) const |
Return coordinates a point with label (i,j,k) in a 3-D grid. | |
real_t | getX (size_t i) const |
Return x-coordinate of point with index i | |
real_t | getY (size_t j) const |
Return y-coordinate of point with index j | |
real_t | getZ (size_t k) const |
Return z-coordinate of point with index k | |
Point2D< real_t > | getXY (size_t i, size_t j) const |
Return coordinates of point with indices (i,j) | |
Point< real_t > | getXYZ (size_t i, size_t j, size_t k) const |
Return coordinates of point with indices (i,j,k) | |
real_t | getCenter (size_t i) const |
Return coordinates of center of a 1-D cell with indices i , i+1 | |
Point< real_t > | getCenter (size_t i, size_t j) const |
Return coordinates of center of a 2-D cell with indices (i,j) , (i+1,j) , (i+1,j+1) , (i,j+1) | |
Point< real_t > | getCenter (size_t i, size_t j, size_t k) const |
Return coordinates of center of a 3-D cell with indices (i,j,k) , (i+1,j,k) , (i+1,j+1,k) , (i,j+1,k) , (i,j,k+1) , (i+1,j,k+1) , (i+1,j+1,k+1) , (i,j+1,k+1) | |
void | setCode (string exp, int code) |
Set a code for some grid points. More... | |
void | setCode (int side, int code) |
Set a code for grid points on sides. More... | |
int | getCode (int side) const |
Return code for a side number. More... | |
int | getCode (size_t i, size_t j) const |
Return code for a grid point. More... | |
int | getCode (size_t i, size_t j, size_t k) const |
Return code for a grid point. More... | |
size_t | getDim () const |
Return space dimension. | |
void | Deactivate (size_t i) |
Change state of a cell from active to inactive (1-D grid) More... | |
void | Deactivate (size_t i, size_t j) |
Change state of a cell from active to inactive (2-D grid) More... | |
void | Deactivate (size_t i, size_t j, size_t k) |
Change state of a cell from active to inactive (2-D grid) More... | |
int | isActive (size_t i) const |
Say if cell is active or not (1-D grid) More... | |
int | isActive (size_t i, size_t j) const |
Say if cell is active or not (2-D grid) More... | |
int | isActive (size_t i, size_t j, size_t k) const |
Say if cell is active or not (3-D grid) More... | |
Detailed Description
To manipulate structured grids.
Constructor & Destructor Documentation
Construct a 1-D structured grid given its extremal coordinates and number of intervals.
- Parameters
-
[in] xm Minimal value for x
[in] xM Maximal value for x
[in] npx Number of grid intervals in the x
-direction
Construct a 2-D structured grid given its extremal coordinates and number of intervals.
- Parameters
-
[in] xm Minimal value for x
[in] xM Maximal value for x
[in] ym Minimal value for y
[in] yM Maximal value for y
[in] npx Number of grid intervals in the x
-direction[in] npy Number of grid intervals in the y
-direction
Construct a 2-D structured grid given its extremal coordinates and number of intervals.
- Parameters
-
[in] m Minimal coordinate value [in] M Maximal coordinate value [in] npx Number of grid intervals in the x
-direction[in] npy Number of grid intervals in the y
-direction
Grid | ( | real_t | xm, |
real_t | xM, | ||
real_t | ym, | ||
real_t | yM, | ||
real_t | zm, | ||
real_t | zM, | ||
size_t | npx, | ||
size_t | npy, | ||
size_t | npz | ||
) |
Construct a 3-D structured grid given its extremal coordinates and number of intervals.
- Parameters
-
[in] xm Minimal value for x
[in] xM Maximal value for x
[in] ym Minimal value for y
[in] yM Maximal value for y
[in] zm Minimal value for z
[in] zM Maximal value for z
[in] npx Number of grid intervals in the x
-direction[in] npy Number of grid intervals in the y
-direction[in] npz Number of grid intervals in the z
-direction
Construct a 3-D structured grid given its extremal coordinates and number of intervals.
- Parameters
-
[in] m Minimal coordinate value [in] M Maximal coordinate value [in] npx Number of grid intervals in the x
-direction[in] npy Number of grid intervals in the y
-direction[in] npz Number of grid intervals in the z
-direction
Member Function Documentation
Set min. coordinates of the domain.
- Parameters
-
[in] x Minimal values of coordinates
Set max. coordinates of the domain.
- Parameters
-
[in] x Maximal values of coordinates
Set Dimensions of the domain: 1-D case.
- Parameters
-
[in] xmin Minimal value of x
-coordinate[in] xmax Maximal value of x
-coordinate
Set Dimensions of the domain: 2-D case.
- Parameters
-
[in] xmin Minimal value of x
-coordinate[in] xmax Maximal value of x
-coordinate[in] ymin Minimal value of y
-coordinate[in] ymax Maximal value of y
-coordinate
Set Dimensions of the domain: 3-D case.
- Parameters
-
[in] xmin Minimal value of x
-coordinate[in] xmax Maximal value of x
-coordinate[in] ymin Minimal value of y
-coordinate[in] ymax Maximal value of y
-coordinate[in] zmin Minimal value of z
-coordinate[in] zmax Maximal value of z
-coordinate
Set Dimensions of the domain: 3-D case.
- Parameters
-
[in] xmin Minimal coordinate value [in] xmax Maximal coordinate value
void setN | ( | size_t | nx, |
size_t | ny = 0 , |
||
size_t | nz = 0 |
||
) |
Set number of grid intervals in the x
, y
and z
-directions.
Number of points is the number of intervals plus one in each direction
- Parameters
-
[in] nx Number of grid intervals in the x
-direction[in] ny Number of grid intervals in the y
-direction (Default=0
: 1-D grid)[in] nz Number of grid intervals in the z
-direction (Default=0
: 1-D or 2-D grid)
- Remarks
- : The size of the grid (
xmin
andxmax
) must have been defined before.
size_t getNy | ( | ) | const |
Return number of grid intervals in the y
-direction.
ny=0
for 1-D domains (segments)
size_t getNz | ( | ) | const |
Return number of grid intervals in the z-direction.
nz=0
for 1-D (segments) and 2-D domains (rectangles)
void setCode | ( | string | exp, |
int | code | ||
) |
Set a code for some grid points.
- Parameters
-
[in] exp Regular expression that determines the set of grid points on which the code is applied. [in] code Code to assign.
void setCode | ( | int | side, |
int | code | ||
) |
Set a code for grid points on sides.
- Parameters
-
[in] side Side for which code is assigned. Possible values are: MIN_X
,MAX_X
,MIN_Y
,MAX_Y
,MIN_Z
,MAX_Z
[in] code Code to assign.
int getCode | ( | int | side | ) | const |
Return code for a side number.
- Parameters
-
[in] side Side for which code is returned. Possible values are: MIN_X
,MAX_X
,MIN_Y
,MAX_Y
,MIN_Z
,MAX_Z
int getCode | ( | size_t | i, |
size_t | j | ||
) | const |
Return code for a grid point.
- Parameters
-
[in] i i
-th index for node for which code is to be returned.[in] j j
-th index for node for which code is to be returned.
int getCode | ( | size_t | i, |
size_t | j, | ||
size_t | k | ||
) | const |
Return code for a grid point.
- Parameters
-
[in] i i
-th index for node for which code is to be returned.[in] j j
-th index for node for which code is to be returned.[in] k k
-th index for node for which code is to be returned.
void Deactivate | ( | size_t | i | ) |
Change state of a cell from active to inactive (1-D grid)
- Parameters
-
[in] i grid cell to remove
void Deactivate | ( | size_t | i, |
size_t | j | ||
) |
Change state of a cell from active to inactive (2-D grid)
- Parameters
-
[in] i i
-th index for grid cell to remove. If this value is0
, all cells(*,j)
are deactivated[in] j j
-th index for grid cell to remove If this value is0
, all cells(i,*)
are deactivated
- Remarks
- if
i
andj
have value0
all grid cells are deactivated !!
void Deactivate | ( | size_t | i, |
size_t | j, | ||
size_t | k | ||
) |
Change state of a cell from active to inactive (2-D grid)
- Parameters
-
[in] i i
-th index for grid cell to remove. If this value is0
, all cells(*,j,k)
are deactivated[in] j j
-th index for grid cell to remove If this value is0
, all cells(i,*,k)
are deactivated[in] k k
-th index for grid cell to remove If this value is0
, all cells(i,j,*)
are deactivated
int isActive | ( | size_t | i | ) | const |
Say if cell is active or not (1-D grid)
- Parameters
-
[in] i Index of cell
- Returns
1
if cell is active,0
if not
int isActive | ( | size_t | i, |
size_t | j | ||
) | const |
Say if cell is active or not (2-D grid)
- Parameters
-
[in] i i
-th index of cell[in] j j
-th index of cell
- Returns
1
if cell is active,0
if not
int isActive | ( | size_t | i, |
size_t | j, | ||
size_t | k | ||
) | const |
Say if cell is active or not (3-D grid)
- Parameters
-
[in] i i
-th index of cell[in] j j
-th index of cell[in] k k
-th index of cell
- Returns
1
if cell is active,0
if not