XMDF  2.2
4.9.2. API functions

The following function is used to define the type of grid. Gridtype is one of the following constants:

C/C++
int xfSetGridType(xid GroupId, int GridType);
FORTRAN
SUBROUTINE XF_SET_GRID_TYPE (GroupId, GridType, Error)
INTEGER(XID), INTENT(IN) :: GroupId
INTEGER, INTENT(IN) :: GridType
INTEGER, INTENT(OUT) :: Error

The following function is used only for extruded grids to define the type of extrusion taking place. Extrudetype must be one of the following constants:

C/C++
int xfSetExtrusionType(xid GroupId, int ExtrudeType);
FORTRAN
SUBROUTINE XF_SET_EXTRUSION_TYPE(GroupId, ExtrudeType, Error)
INTEGER(XID), INTENT(IN) :: GroupId
INTEGER, INTENT(IN) :: ExtrudeType
INTEGER, INTENT(OUT) :: Error

These functions are used to set attributes for a grid. The number of dimensions must be 2 or 3. Orientation must be one of the following constants ORIENTATION_RIGHT_HAND, ORIENTATION_LEFT_HAND. The computational origin is a number between 1 and 4 for 2D grids and between 1 and 8 for 3D grids. The number corresponds to the corner of the grid that will be the origin. The figures in the table below show the corresponding values. The u direction must be 1, 2, 3, -1, -2, or -3. This corresponds to the grid direction as labeled in the table. Negative direction values indicate the origin is at the other side of the grid. (For more information on the grid computational origin, see Appendix Grid).

Two Dimensional
Grid direction 1 - location 1 to location 2
Grid direction 2 - location 1 to location 4
image021_2d4.gif
Three Dimensional
Grid direction 1 - location 1 to location 2
Grid direction 2 - location 1 to location 4
Grid direction 3 - location 1 to location 5
image031_3d8.gif
C/C++
int xfSetNumberOfDimensions(xid GroupId, int NumDimensions);
int xfSetOrigin(xid GroupId, double x, double y, double z);
int xfSetOrientation(xid GroupId, int Orientation);
int xfSetBearing(xid GroupId, double Bearing);
int xfSetDip(xid GroupId, double Dip);
int xfSetComputationalOrigin(xid GroupId, int Origin);
int xfSetUDirection(xid GroupId, int Direction);
int xfSetNumberCellsInI(xid GroupId, int NumI);
int xfSetNumberCellsInJ(xid GroupId, int NumJ);
int xfSetNumberCellsInK(xid GroupId, int NumK);
FORTRAN
SUBROUTINE XF_SET_NUMBER_OF_DIMENSIONS(GroupId, NumDimensions, Error)
INTEGER(XID), INTENT(IN) :: GroupId
INTEGER, INTENT(IN) :: NumDimensions
INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_SET_ORIGIN(GroupId, x, y, z, Error)
INTEGER(XID), INTENT(IN) :: GroupId
REAL(DOUBLE), INTENT(IN) :: x, y, z
INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_SET_ORIENTATION(GroupId, Orientation, Error)
INTEGER(XID), INTENT(IN) :: GroupId
INTEGER, INTENT(IN) :: Orientation
INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_SET_BEARING(GroupId, Bearing, Error)
INTEGER(XID), INTENT(IN) :: GroupId
REAL(DOUBLE), INTENT(IN) :: Bearing
INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_SET_DIP(GroupId, Dip, Error)
INTEGER(XID), INTENT(IN) :: GroupId
REAL(DOUBLE), INTENT(IN) :: Dip
INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_SET_COMPUTATIONAL_ORIGIN (GroupId, Origin, Error)
INTEGER(XID), INTENT(IN) :: GroupId
INTEGER, INTENT(IN) :: Origin
INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_SET_U_DIRECTION (GroupId, Direction, Error)
INTEGER(XID), INTENT(IN) :: GroupId
INTEGER, INTENT(IN) :: Direction
INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_SET_NUM_CELLS_I(GroupId, NumCellsI, Error)
INTEGER(XID), INTENT(IN) :: GroupId
REAL(DOUBLE), INTENT(IN) :: NumCellsI
INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_SET_NUM_CELLS_J(GroupId, NumCellsJ, Error)
INTEGER(XID), INTENT(IN) :: GroupId
REAL(DOUBLE), INTENT(IN) :: NumCellsJ
INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_SET_NUM_CELLS_K(GroupId, NumCellsK, Error)
INTEGER(XID), INTENT(IN) :: GroupId
REAL(DOUBLE), INTENT(IN) :: NumCellsK
INTEGER, INTENT(OUT) :: Error

The following functions are used to retrieve information about a grid. Optional parameters have a function that can be used to determine if the parameter was set.

C/C++
int xfGetGridType(xid GroupId, int *GridType);
int xfGetExtrusionType(xid GroupId, int *ExtrudeType);
int xfGetNumberOfDimensions(xid GroupId, int *NumDimensions);
int xfOriginDefined(xid GroupId, xbool *bDefined);
int xfGetOrigin(xid GroupId, double *x, double *y, double *z);
int xfGetOrientation(xid GroupId, int *Orientation);
int xfBearingDefined(xid GroupId, xbool *bDefined);
int xfGetBearing(xid GroupId, double *bearing);
int xfDipDefined(xid GroupId, xbool *bDefined);
int xfGetDip(xid GroupId, double *dip);
int xfComputationalOriginDefined(xid GroupId, xbool *bDefined);
int xfGetComputationalOrigin (xid GroupId, int *Origin);
int xfGetUDirectionDefined(xid GroupId, xbool *bDefined);
int xfGetUDirection (xid GroupId, double *Direction);
int xfGetNumberCellsInI(xid GroupId, int *NumI);
int xfGetNumberCellsInJ(xid GroupId, int *NumJ);
int xfGetNumberCellsInK(xid GroupId, int *NumK);
FORTRAN
SUBROUTINE XF_GET_GRID_TYPE(GroupId, GridType, Error)
INTEGER(XID), INTENT(IN) :: GroupId
INTEGER, INTENT(OUT) :: GridType
INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_GET_EXTRUSION_TYPE(GroupId, ExtrudeType, Error)
INTEGER(XID), INTENT(IN) :: GroupId
INTEGER, INTENT(OUT) :: ExtrudeType
INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_GET_NUMBER_OF_DIMENSIONS(GroupId, NumDimensions, Error)
INTEGER(XID), INTENT(IN) :: GroupId
INTEGER, INTENT(OUT) :: NumDimensions
INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_ORIGIN_DEFINED(GroupId, Defined, Error)
INTEGER(XID), INTENT(IN) :: GroupId
LOGICAL, INTENT(OUT) :: Defined
INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_GET_ORIGIN(GroupId, x, y, z, Error)
INTEGER(XID), INTENT(IN) :: GroupId
REAL(DOUBLE), INTENT(OUT) :: x, y, z
INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_GET_ORIENTATION(GroupId, Orientation, Error)
INTEGER(XID), INTENT(IN) :: GroupId
INTEGER, INTENT(OUT) :: Orientation
INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_BEARING_DEFINED(GroupId, Defined, Error)
INTEGER(XID), INTENT(IN) :: GroupId
LOGICAL, INTENT(OUT) :: Defined
INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_GET_BEARING(GroupId, Bearing, Error)
INTEGER(XID), INTENT(IN) :: GroupId
REAL(DOUBLE), INTENT(OUT) :: Bearing
INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_DIP_DEFINED(GroupId, Defined, Error)
INTEGER(XID), INTENT(IN) :: GroupId
LOGICAL, INTENT(OUT) :: Defined
INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_GET_DIP(GroupId, Dip, Error)
INTEGER(XID), INTENT(IN) :: GroupId
REAL(DOUBLE), INTENT(OUT) :: Dip
INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_COMPUTATIONAL_ORIGIN_DEFINED (GroupId, Defined, Error)
INTEGER(XID), INTENT(IN) :: GroupId
LOGICAL, INTENT(OUT) :: Defined
INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_GET_COMPUTATIONAL_ORIGIN (GroupId, Origin, Error)
INTEGER(XID), INTENT(IN) :: GroupId
INTEGER, INTENT(OUT) :: Origin
INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_U_DIRECTION_DEFINED (GroupId, Defined, Error)
INTEGER(XID), INTENT(IN) :: GroupId
LOGICAL, INTENT(OUT) :: Defined
INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_GET_U_DIRECTION (GroupId, Direction, Error)
INTEGER(XID), INTENT(IN) :: GroupId
INTEGER, INTENT(OUT) :: Direction
INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_GET_NUMBER_CELLS_IN_I(GroupId, NumI, Error)
INTEGER(XID), INTENT(IN) :: GroupId
INTEGER, INTENT(OUT) :: NumI
INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_GET_NUMBER_CELLS_IN_J(GroupId, NumJ, Error)
INTEGER(XID), INTENT(IN) :: GroupId
INTEGER, INTENT(OUT) :: NumJ
INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_GET_NUMBER_CELLS_IN_K(GroupId, NumK, Error)
INTEGER(XID), INTENT(IN) :: GroupId
INTEGER, INTENT(OUT) :: NumK
INTEGER, INTENT(OUT) :: Error