GridCoordinates_t nodes are used to describe grids associated
with a particular zone.
The original grid must be described by a GridCoordinates_t node
named GridCoordinates.
Additional GridCoordinates_t nodes may be used, with user-defined
names, to store grids at multiple time steps or iterations.
In addition to the discussion of the GridCoordinates_t node
in the SIDS and
File Mapping manuals,
see the discussion of the
ZoneIterativeData_t
and ArbitraryGridMotion_t
nodes in the SIDS manual.
| Functions | Modes |
|---|---|
|
ier = cg_grid_write(int fn, int B, int Z, char *GridCoordName, int *G); | - w m |
| ier = cg_ngrids(int fn, int B, int Z, int *ngrids); | - w m |
|
ier = cg_grid_read(int fn, int B, int Z, int G, char *GridCoordName); | r - m |
| call cg_grid_write_f(fn, B, Z, GridCoordName, G, ier) | - w m |
| call cg_ngrids_f(fn, B, Z, ngrids, ier) | - w m |
| call cg_grid_read_f(fn, B, Z, G, GridCoordName, ier) | r - m |
| fn | CGNS file index number. | ||
| B | Base index number, where 1 ≤ B ≤ nbases. | ||
| Z | Zone index number, where 1 ≤ Z ≤ nzones. | ||
| G | Grid index number, where 1 ≤ G ≤ ngrids. | ||
| ngrids | Number of GridCoordinates_t nodes for zone Z. | ||
| GridCoordinateName | Name of the GridCoordinates_t node. Note that the name "GridCoordinates" is reserved for the original grid and must be the first GridCoordinates_t node to be defined. | ||
| ier | Error status. |
The above functions are applicable to any GridCoordinates_t node.
| Functions | Modes |
|---|---|
|
ier = cg_coord_write(int fn, int B, int Z, DataType_t datatype, char *coordname, void *coord_array, int *C); | - w m |
|
ier = cg_coord_partial_write(int fn, int B, int Z, DataType_t datatype, char *coordname, int *range_min, int *range_max, void *coord_array, int *C); | - w m |
| ier = cg_ncoords(int fn, int B, int Z, int *ncoords); | r - m |
|
ier = cg_coord_info(int fn, int B, int Z, int C, DataType_t *datatype, char *coordname); | r - m |
|
ier = cg_coord_read(int fn, int B, int Z, char *coordname, DataType_t datatype, int *range_min, int *range_max, void *coord_array); | r - m |
|
call cg_coord_write_f(fn, B, Z, datatype, coordname, coord_array, C, ier) | - w m |
|
call cg_coord_partial_write_f(fn, B, Z, datatype, coordname, range_min, range_max, coord_array, C, ier) | - w m |
| call cg_ncoords_f(fn, B, Z, ncoords, ier) | r - m |
| call cg_coord_info_f(fn, B, Z, C, datatype, coordname, ier) | r - m |
|
call cg_coord_read_f(fn, B, Z, coordname, datatype, range_min, range_max, coord_array, ier) | r - m |
| fn | CGNS file index number. | ||
| B | Base index number, where 1 ≤ B ≤ nbases. | ||
| Z | Zone index number, where 1 ≤ Z ≤ nzones. | ||
| C | Coordinate array index number, where 1 ≤ C ≤ ncoords. | ||
| ncoords | Number of coordinate arrays for zone Z. | ||
| datatype | Data type in which the coordinate array is written. Admissible data types for a coordinate array are RealSingle and RealDouble. | ||
| coordname | Name of the coordinate array. It is strongly advised to use the SIDS nomenclature conventions when naming the coordinate arrays to insure file compatibility. | ||
| range_min | Lower range index (eg., imin, jmin, kmin). | ||
| range_max | Upper range index (eg., imax, jmax, kmax). | ||
| coord_array | Array of coordinate values for the range prescribed. | ||
| ier | Error status. |
The above functions are applicable only to the GridCoordinates_t node named GridCoordinates, used for the original grid in a zone. Coordinates for additional GridCoordinates_t nodes in a zone must be read and written using the cg_array_xxx functions.
When writing, the function cg_coord_write will automatically write the full range of coordinates (i.e., the entire coord_array). The function cg_coord_partial_write may be used to write only a subset of coord_array.
If the file was opened in "write mode", using cg_coord_partial_write will overwrite existing coordinates only for the specified range. In "modify mode", the existing coordinates will first be deleted, then replaced by the new coordinates.
The function cg_coord_read returns the coordinate array coord_array, for the range prescribed by range_min and range_max. The array is returned to the application in the data type requested in datatype. This data type does not need to be the same as the one in which the coordinates are stored in the file. A coordinate array stored as double precision in the CGNS file can be returned to the application as single precision, or vice versa.
In Fortran, when using cg_coord_read_f to read 2D or 3D coordinates, the extent of each dimension of coord_array must be consistent with the requested range. When reading a 1D solution, the declared size can be larger than the requested range. For example, for a 2D zone with 100 × 50 vertices, if range_min and range_max are set to (11,11) and (20,20) to read a subset of the coordinates, then coord_array must be dimensioned (10,10). If coord_array is declared larger (e.g., (100,50)) the indices for the returned coordinates will be wrong.
| Functions | Modes | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
ier = cg_section_write(int fn, int B, int Z, char *ElementSectionName, ElementType_t type, int start, int end, int nbndry, int *Elements, int *S); | - w m | ||||||||||||||||||||
|
ier = cg_section_partial_write(int fn, int B, int Z, char *ElementSectionName, ElementType_t type, int rmin_elems, int rmax_elems, int nbndry, int *Elements, int *S); | - w m | ||||||||||||||||||||
|
ier = cg_parent_data_write(int fn, int B, int Z, int S, int *ParentData); | - w m | ||||||||||||||||||||
|
ier = cg_parent_data_partial_write(int fn, int B, int Z, int S, int rmin_parent, int rmax_parent, int *ParentData); | - w m | ||||||||||||||||||||
| ier = cg_nsections(int fn, int B, int Z, int *nsections); | r - m | ||||||||||||||||||||
|
ier = cg_section_read(int fn, int B, int Z, int S, char *ElementSectionName, ElementType_t *type, int *start, int *end, int *nbndry, int *parent_flag); | r - m | ||||||||||||||||||||
|
ier = cg_section_read_ext(int fn, int B, int Z, int S, char *ElementSectionName, ElementType_t *type, int *start, int *end, int *nbndry, int *parent_flag, int *rmin_parent, int *rmax_parent); | r - m | ||||||||||||||||||||
|
ier = cg_ElementDataSize(int fn, int B, int Z, int S, int *ElementDataSize); | r - m | ||||||||||||||||||||
|
ier = cg_elements_read(int fn, int B, int Z, int S, int *Elements, int *ParentData); | r - m | ||||||||||||||||||||
|
ier = cg_elements_read_ext(int fn, int B, int Z, int S, int *Elements, int rmin_elems, int rmax_elems, int *ParentData, int rmin_parent, int rmax_parent); | r - m | ||||||||||||||||||||
| ier = cg_npe(ElementType_t type, int *npe); | r w m | ||||||||||||||||||||
|
call cg_section_write_f(fn, B, Z, ElementSectionName, type, start, end, nbndry, Elements, S, ier)
- w m
|
call cg_section_partial_write_f(fn, B, Z, ElementSectionName, type, | rmin_elems, rmax_elems, nbndry, Elements, S, ier)
- w m
|
call cg_parent_data_write_f(fn, B, Z, S, ParentData, ier) |
- w m
|
call cg_parent_data_partial_write_f(fn, B, Z, S, rmin_parent, | rmax_parent, ParentData, ier)
- w m
|
call cg_nsections_f(fn, B, Z, nsections, ier) |
r - m
|
call cg_section_read_f(fn, B, Z, S, ElementSectionName, type, | start, end, nbndry, parent_flag, ier)
r - m
|
call cg_section_read_ext_f(fn, B, Z, S, ElementSectionName, type, | start, end, nbndry, parent_flag, rmin_parent, rmax_parent, ier)
r - m
|
call cg_ElementDataSize_f(fn, B, Z, S, ElementDataSize, ier) |
r - m
|
call cg_elements_read_f(fn, B, Z, S, Elements, ParentData, ier) |
r - m
|
call cg_elements_read_ext_f(fn, B, Z, S, Elements, rmin_elems, | rmax_elems, ParentData, rmin_parent, rmax_parent, ier)
r - m
|
call cg_npe_f(type, npe, ier)
|
r w m
| |
| fn | CGNS file index number. | ||
| B | Base index number, where 1 ≤ B ≤ nbases. | ||
| Z | Zone index number, where 1 ≤ Z ≤ nzones. | ||
| ElementSectionName | Name of the Elements_t node. | ||
| type | Type of element. See the eligible types for ElementType_t in the Typedefs section. | ||
| start | Index of first element in the section. | ||
| end | Index of last element in the section. | ||
| rmin_elems | Lower element index. | ||
| rmax_elems | Upper element index. | ||
| rmin_parent | Lower element index for parent data. | ||
| rmax_parent | Upper element index for parent data. | ||
| nbndry | Index of last boundary element in the section. Set to zero if the elements are unsorted. | ||
| nsections | Number of element sections. | ||
| S | Element section index, where 1 ≤ S ≤ nsections. | ||
| parent_flag | Flag indicating if the parent data are defined. If the parent data exist, parent_flag is set to 1; otherwise it is set to 0. | ||
| ElementDataSize | Number of element connectivity data values. | ||
| Elements | Element connectivity data. | ||
| ParentData | For boundary or interface elements, this array contains information on the cell(s) and cell face(s) sharing the element. | ||
| npe | Number of nodes for an element of type type. | ||
| ier | Error status. |
If the specified Elements_t node doesn't yet exist, it may be created using either cg_section_write or cg_section_partial_write. If the Elements_t node does exist (created by using either cg_section_write or cg_section_partial_write), calls to cg_section_partial_write will replace the existing connectivity data with the union of the existing and new data, with the new data overwriting the old data for common indices. The resulting index range for the new data must be continuous.
The function cg_parent_data_write will automatically write the full range of parent data (i.e., the entire ParentData array). If parent data does not exist for the specified Elements_t node, the first use of cg_parent_data_partial_write will add it. If parent data does exist (created by using either cg_parent_data_write or cg_parent_data_partial_write), calls to cg_parent_data_partial_write will replace the existing parent data with the union of the existing and new data, with the new data overwriting the old data for common indices. The resulting index range for the new data must be continuous.
The "partial write" capability described above requires that the file be opened in "write mode". For both cg_section_partial_write and cg_parent_data_partial_write, if the file was opened in "modify mode", the existing connectivity or parent data will first be deleted, then replaced by the new data.
The function cg_section_read_ext returns the same information as cg_section_read, plus the index range for the parent data.
The function cg_elements_read returns all of the element connectivity and parent data. Specified subsets of the element connectivity and parent data may be read using cg_elements_read_ext.
| Functions | Modes |
|---|---|
|
ier = cg_axisym_write(int fn, int B, float *ReferencePoint, float *AxisVector); | - w m |
|
ier = cg_axisym_read(int fn, int B, float *ReferencePoint, float *AxisVector); | r - m |
| call cg_axisym_write_f(fn, B, ReferencePoint, AxisVector, ier) | - w m |
| call cg_axisym_read_f(fn, B, ReferencePoint, AxisVector, ier) | r - m |
| fn | CGNS file index number. | ||
| B | Base index number, where 1 ≤ B ≤ nbases. | ||
| ReferencePoint | Origin used for defining the axis of rotation. | ||
| AxisVector | Direction cosines of the axis of rotation, through the reference point. | ||
| ier | Error status. |
This node can only be used for a bi-dimensional model, i.e., PhysicalDimension must equal two.
| Functions | Modes |
|---|---|
|
ier = cg_rotating_write(float *RotationRateVector, float *RotationCenter); | - w m |
|
ier = cg_rotating_read(float *RotationRateVector, float *RotationCenter); | r - m |
| call cg_rotating_write_f(RotationRateVector, RotationCenter, ier) | - w m |
| call cg_rotating_read_f(RotationRateVector, RotationCenter, ier) | r - m |
| RotationRateVector | Components of the angular velocity of the grid about the center of rotation. | ||
| RotationCenter | Coordinates of the center of rotation. | ||
| ier | Error status. |