To manipulate structured grids. More...
Public Member Functions | |
| Grid () | |
| Construct a default grid with 10 intervals in each direction. | |
| Grid (double xm, double xM, size_t npx) | |
| Construct a 1-D structured grid given its extremal coordinates and number of intervals. | |
| Grid (double xm, double xM, double ym, double yM, size_t npx, size_t npy) | |
| Construct a 2-D structured grid given its extremal coordinates and number of intervals. | |
| Grid (Point< double > m, Point< double > M, size_t npx, size_t npy) | |
| Construct a 2-D structured grid given its extremal coordinates and number of intervals. | |
| Grid (double xm, double xM, double ym, double yM, double zm, double zM, size_t npx, size_t npy, size_t npz) | |
| Construct a 3-D structured grid given its extremal coordinates and number of intervals. | |
| Grid (Point< double > m, Point< double > M, size_t npx, size_t npy, size_t npz) | |
| Construct a 3-D structured grid given its extremal coordinates and number of intervals. | |
| void | setXMin (const Point< double > &x) |
| Set min. coordinates of the domain. | |
| void | setXMax (const Point< double > &x) |
| void | setDomain (double xmin, double xmax) |
| Set Dimensions of the domain: 1-D case. | |
| void | setDomain (double xmin, double xmax, double ymin, double ymax) |
| Set Dimensions of the domain: 2-D case. | |
| void | setDomain (double xmin, double xmax, double ymin, double ymax, double zmin, double zmax) |
| Set Dimensions of the domain: 3-D case. | |
| void | setDomain (Point< double > xmin, Point< double > xmax) |
| Set Dimensions of the domain: 3-D case. | |
| const Point< double > & | getXMin () const |
| Return min. Coordinates of the domain. | |
| const Point< double > & | 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. | |
| 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. | |
| size_t | getNz () const |
| double | getHx () const |
| Return grid size in the x-direction. | |
| double | getHy () const |
| Return grid size in the y-direction. | |
| double | getHz () const |
| Return grid size in the z-direction. | |
| Point< double > | getCoord (size_t i) const |
| Return coordinates a point with label i in a 1-D grid. | |
| Point< double > | getCoord (size_t i, size_t j) const |
| Return coordinates a point with label (i,j) in a 2-D grid. | |
| Point< double > | 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. | |
| double | getX (size_t i) const |
| Return x-coordinate of point with index i. | |
| double | getY (size_t j) const |
| Return y-coordinate of point with index j. | |
| double | getZ (size_t k) const |
| Return z-coordinate of point with index k. | |
| Point2D< double > | getXY (size_t i, size_t j) const |
| Return coordinates of point with indices (i,j) | |
| Point< double > | getXYZ (size_t i, size_t j, size_t k) const |
| Return coordinates of point with indices (i,j,k) | |
| void | setCode (int side, int code) |
| Set a code for grid points. | |
| int | getCode (int side) const |
| Return code for a side number. | |
| int | getCode (size_t i, size_t j) const |
| Return code for a grid point. | |
| int | getCode (size_t i, size_t j, size_t k) const |
| Return code for a grid point. | |
| size_t | getDim () const |
| Return space dimension. | |
Detailed Description
To manipulate structured grids.
Constructor & Destructor Documentation
| Grid | ( | double | xm, |
| double | xM, | ||
| size_t | npx | ||
| ) |
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
| Grid | ( | double | xm, |
| double | xM, | ||
| double | ym, | ||
| double | yM, | ||
| size_t | npx, | ||
| size_t | npy | ||
| ) |
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 | ( | double | xm, |
| double | xM, | ||
| double | ym, | ||
| double | yM, | ||
| double | zm, | ||
| double | 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
| void setDomain | ( | double | xmin, |
| double | xmax | ||
| ) |
Set Dimensions of the domain: 1-D case.
- Parameters:
-
[in] xmin Minimal value of x-coordinate [in] xmax Maximal value of x-coordinate
| void setDomain | ( | double | xmin, |
| double | xmax, | ||
| double | ymin, | ||
| double | ymax | ||
| ) |
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
| void setDomain | ( | double | xmin, |
| double | xmax, | ||
| double | ymin, | ||
| double | ymax, | ||
| double | zmin, | ||
| double | zmax | ||
| ) |
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 (
xminandxmax) 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 | ( | int | side, |
| int | code | ||
| ) |
Set a code for grid points.
- 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.
- OFELI
- Grid