Skip navigation links
(CGNS Documentation Home Page) (Steering Committee Charter) (Overview and Entry-Level Document) (A User's Guide to CGNS) (Mid-Level Library) (Standard Interface Data Structures) (SIDS File Mapping Manual) (CGIO User's Guide) (Parallel CGNS User's Guide) (ADF Implementation) (HDF5 Implementation) (Python Implementation) (CGNS Tools and Utilities)

(General Remarks) (File Operations) (Navigating a CGNS File) (Error Handling) (Structural Nodes) (Descriptors) (Physical Data) (Location and Position) (Auxiliary Data) (Grid Specification) (Solution Data) (Grid Connectivity) (Boundary Conditions) (Equation Specification) (Families) (Time-Dependent Data) (Links)

Physical Data

Data Arrays

Node: DataArray_t (SIDS, File Mapping)

Functions Modes
ier = cg_array_write(char *ArrayName, DataType_t DataType,
      int DataDimension, cgsize_t *DimensionVector, void *Data);
- w m
ier = cg_narrays(int *narrays); r - m
ier = cg_array_info(int A, char *ArrayName, DataType_t *DataType,
      int *DataDimension, cgsize_t *DimensionVector);
r - m
ier = cg_array_read(int A, void *Data); r - m
ier = cg_array_read_as(int A, DataType_t DataType, void *Data); r - m
call cg_array_write_f(ArrayName, DataType, DataDimension,
     DimensionVector, Data, ier)
- w m
call cg_narrays_f(narrays, ier) r - m
call cg_array_info_f(A, ArrayName, DataType, DataDimension,
     DimensionVector, ier)
r - m
call cg_array_read_f(A, Data, ier) r - m
call cg_array_read_as_f(A, DataType, Data, ier) r - m

Input/Output

    narrays   Number of DataArray_t nodes under the current node.
A Data array index, where 1 ≤ Anarrays.
ArrayName Name of the DataArray_t node.
DataType Type of data held in the DataArray_t node. The admissible types are Integer, LongInteger, RealSingle, RealDouble, and Character.
DataDimension Number of dimensions (max 12). See Node Management Routines in CGIO User's Guide.
DimensionVector Number of data elements in each dimension.
Data The data array.
ier Error status.

Data Class

Node: DataClass_t (SIDS, File Mapping)

Functions Modes
ier = cg_dataclass_write(DataClass_t dataclass); - w m
ier = cg_dataclass_read(DataClass_t *dataclass); r - m
call cg_dataclass_write_f(dataclass, ier) - w m
call cg_dataclass_read_f(dataclass, ier) r - m

Input/Output

    dataclass   Data class for the nodes at this level. See below for the data classes currently supported in CGNS.
ier Error status.

The data classes currently supported in CGNS are:

    Dimensional   Regular dimensional data.
NormalizedByDimensional Nondimensional data that is normalized by dimensional reference quantities.
NormalizedByUnknownDimensional All fields and reference data are nondimensional.
NondimensionalParameter Nondimensional parameters such as Mach number and lift coefficient.
DimensionlessConstant Constant such as π.

These classes are declared within typedef DataClass_t in cgnslib.h, and as parameters in cgnslib_f.h.

Data Conversion Factors

Node: DataConversion_t (SIDS, File Mapping)

Functions Modes
ier = cg_conversion_write(DataType_t DataType,
      void *ConversionFactors);
- w m
ier = cg_conversion_info(DataType_t *DataType); r - m
ier = cg_conversion_read(void *ConversionFactors); r - m
call cg_conversion_write_f(DataType, ConversionFactors, ier) - w m
call cg_conversion_info_f(DataType, ier) r - m
call cg_conversion_read_f(ConversionFactors, ier) r - m

Input/Output

    DataType   Data type in which the conversion factors are recorded. Admissible data types for conversion factors are RealSingle and RealDouble.
ConversionFactors Two-element array containing the scaling and offset factors.
ier Error status.

The DataConversion_t data structure contains factors to convert the nondimensional data to "raw" dimensional data. The scaling and offset factors are contained in the two-element array ConversionFactors. In pseudo-Fortran, the conversion process is as follows:

   ConversionScale  = ConversionFactors(1)
   ConversionOffset = ConversionFactors(2)
   Data(raw) = Data(nondimensional)*ConversionScale + ConversionOffset

Dimensional Units

Nodes: DimensionalUnits_t (SIDS, File Mapping)

Functions Modes
ier = cg_units_write(MassUnits_t mass, LengthUnits_t length,
      TimeUnits_t time, TemperatureUnits_t temperature,
      AngleUnits_t angle);
- w m
ier = cg_unitsfull_write(MassUnits_t mass, LengthUnits_t length,
      TimeUnits_t time, TemperatureUnits_t temperature,
      AngleUnits_t angle, ElectricCurrentUnits_t current,
      SubstanceAmountUnits_t amount,
      LuminousIntensityUnits_t intensity);
- w m
ier = cg_nunits(int *nunits); r - m
ier = cg_units_read(MassUnits_t *mass, LengthUnits_t *length,
      TimeUnits_t *time, TemperatureUnits_t *temperature,
      AngleUnits_t *angle);
r - m
ier = cg_unitsfull_read(MassUnits_t *mass, LengthUnits_t *length,
      TimeUnits_t *time, TemperatureUnits_t *temperature,
      AngleUnits_t *angle, ElectricCurrentUnits_t *current,
      SubstanceAmountUnits_t *amount,
      LuminousIntensityUnits_t *intensity);
r - m
call cg_units_write_f(mass, length, time, temperature, angle, ier) - w m
call cg_unitsfull_write_f(mass, length, time, temperature, angle,
     current, amount, intensity, ier)
- w m
call cg_nunits_f(nunits, ier) r - m
call cg_units_read_f(mass, length, time, temperature, angle, ier) r - m
call cg_unitsfull_read_f(mass, length, time, temperature, angle,
     current, amount, intensity, ier)
r - m

Input/Output

    mass   Mass units. Admissible values are CG_Null, CG_UserDefined, Kilogram, Gram, Slug, and PoundMass.
length Length units. Admissible values are CG_Null, CG_UserDefined, Meter, Centimeter, Millimeter, Foot, and Inch.
time Time units. Admissible values are CG_Null, CG_UserDefined, and Second.
temperature Temperature units. Admissible values are CG_Null, CG_UserDefined, Kelvin, Celsius, Rankine, and Fahrenheit.
angle Angle units. Admissible values are CG_Null, CG_UserDefined, Degree, and Radian.
current Electric current units. Admissible values are CG_Null, CG_UserDefined, Ampere, Abampere, Statampere, Edison, and auCurrent.
amount Substance amount units. Admissible values are CG_Null, CG_UserDefined, Mole, Entities, StandardCubicFoot, and StandardCubicMeter.
intensity Luminous intensity units. Admissible values are CG_Null, CG_UserDefined, Candela, Candle, Carcel, Hefner, and Violle.
nunits Number of units used in the file (i.e., either 5 or 8).
ier Error status.

The supported units are declared within typedefs in cgnslib.h and as parameters in cgnslib_f.h.

When reading units data, either cg_units_read or cg_unitsfull_read may be used, regardless of the number of units used in the file. If cg_unitsfull_read is used, but only five units are used in the file, the returned values of current, amount, and intensity will be CG_Null.

Dimensional Exponents

Node: DimensionalExponents_t (SIDS, File Mapping)

Functions Modes
ier = cg_exponents_write(DataType_t DataType, void *exponents); - w m
ier = cg_expfull_write(DataType_t DataType, void *exponents); - w m
ier = cg_nexponents(int *nexponents); r - m
ier = cg_exponents_info(DataType_t *DataType); r - m
ier = cg_exponents_read(void *exponents); r - m
ier = cg_expfull_read(void *exponents); r - m
call cg_exponents_write_f(DataType, exponents, ier) - w m
call cg_expfull_write_f(DataType, exponents, ier) - w m
call cg_nexponents_f(nexponents, ier) r - m
call cg_exponents_info_f(DataType, ier) r - m
call cg_exponents_read_f(exponents, ier) r - m
call cg_expfull_read_f(exponents, ier) r - m

Input/Output

    DataType   Data type in which the exponents are recorded. Admissible data types for the exponents are RealSingle and RealDouble.
exponents Exponents for the dimensional units for mass, length, time, temperature, angle, electric current, substance amount, and luminous intensity, in that order.
nexponents Number of exponents used in the file (i.e., either 5 or 8).
ier Error status.

When reading exponent data, either cg_exponents_read or cg_expfull_read may be used, regardless of the number of exponents used in the file. If cg_exponents_read is used, but all eight exponents are used in the file, only the first five exponents are returned. If cg_expfull_read is used, but only five exponents are used in the file, the returned values of the exponents for electric current, substance amount, and luminous intensity will be zero.