Location and PositionΒΆ

These functions usually are found the the preamble or the epilog of your application code using the CGNS/MLL.

CGNS Mid-Level Library - Location and Position

Location and Position

  • Grid Location
    • cg_gridlocation_write - Write grid location
    • cg_gridlocation_read - Read grid location
  • Point Sets
    • cg_ptset_write - Write point set data
    • cg_ptset_info - Get point set information
    • cg_ptset_read - Read point set data
  • Rind Layers
    • cg_rind_write - Write number of rind layers
    • cg_rind_read - Read number of rind layers

Grid Location

Node: GridLocation_t (SIDS, File Mapping)

Functions Modes
ier = cg_gridlocation_write(GridLocation_t GridLocation); - w m
ier = cg_gridlocation_read(GridLocation_t *GridLocation); r - m
call cg_gridlocation_write_f(GridLocation, ier) - w m
call cg_gridlocation_read_f(GridLocation, ier) r - m


    GridLocation   Location in the grid. The admissible locations are CG_Null, CG_UserDefined, Vertex, CellCenter, FaceCenter, IFaceCenter, JFaceCenter, KFaceCenter, and EdgeCenter.
ier Error status.

Point Sets

Node: IndexArray_t, IndexRange_t (SIDS, File Mapping)

Functions Modes
ier = cg_ptset_write(PointSetType_t ptset_type, cgsize_t npnts,
      cgsize_t *pnts);
- w m
ier = cg_ptset_info(PointSetType_t *ptset_type, cgsize_t *npnts); r - m
ier = cg_ptset_read(cgsize_t *pnts); r - m
call cg_ptset_write_f(ptset_type, npnts, pnts, ier) - w m
call cg_ptset_info_f(ptset_type, npnts, ier) r - m
call cg_ptset_read_f(pnts, ier) r - m


    ptset_type   The point set type; either PointRange for a range of points or cells, or PointList for a list of discrete points or cells.
npnts The number of points or cells in the point set. For a point set type of PointRange, npnts is always two. For a point set type of PointList, npnts is the number of points or cells in the list.
pnts The array of point or cell indices defining the point set. There should be npnts values, each of dimension IndexDimension (i.e., 1 for unstructured grids, and 2 or 3 for structured grids with 2-D or 3-D elements, respectively).
ier Error status.

These functions may be used to write and read point set data (i.e., an IndexArray_t node named PointList, or an IndexRange_t node named PointRange). They are only applicable at nodes that are descendents of a Zone_t node.

Rind Layers

Node: Rind_t (SIDS, File Mapping)

Functions Modes
ier = cg_rind_write(int *RindData); - w m
ier = cg_rind_read(int *RindData); r - m
call cg_rind_write_f(RindData, ier) - w m
call cg_rind_read_f(RindData, ier) r - m


    RindData   Number of rind layers for each computational direction (structured grid) or number of rind points or elements (unstructured grid). For structured grids, the low/high sides have unit stride in the array (e.g., [NRindLowI, NRindHighI, NRindLowJ, NRindHighJ, NRindLowK, NRindHighK]).
ier Error status.

When writing rind data for elements, cg_section_write must be called first, followed by cg_goto to access the Elements_t node, and then cg_rind_write.