The CGNS System
Standard for Aerodynamic Data

Armin Wulf
ICEM CFD Engineering
January 13 1999

Overview

Introduction

Brief History of the CGNS Project

CGNS Conceptual Entity:
The Standard Interface Data Structures (SIDS)

CGNS High Levels Chart

Chart showing high-level structures (i.e., nodes) in a CGNS file

Grid Coordinates, Flow Solutions and Zone Connectivity Data Structures

Chart showing grid coordinate, zone connectivity, and flow solution nodes with their children

Zone Boundary Conditions Data Structure

Chart showing zone boundary conditions node with its children

Globally Applicable Data and Precedence

Chart illustrating precedence rules and scope within the hierarchy

CGNS Physical Entities

ADF Core Characteristics

ADF Core

Chart illustrating ADF file structure with links

ADF Node Content

Functions of the ADF Core

The ADF Core is composed of 34 low level functions performing the following operations:

SIDS-to-ADF Mapping of Upper Levels

Chart illustrating contents of upper-level nodes

The Library Reflects Precisely the SIDS and Mapping

  1. SIDS
       CGNSBase_t: = {
       int IndexDimension;
       List (Zone_tZone1,...ZoneN);
       ...}
    
       Zone_t : = {
          int[IndexDimension] VertexSize, CellSize;
          ...}
    
  2. Mapping SIDS to ADF

    For CGNSBase_t,

    For Zone_t,


  3. Mid-Level Library Functions
       int cg_nbases(int FileNo, int *nbases);
    
       int cg_base_read(int FileNo, int BaseNo, char *BaseName, int *IndexDimension);
    
       int cg_nzones(int FileNo, int BaseNo, int *nzones);
    
       int cg_zone_read(int FileNo, int BaseNo, int ZoneNo, char *ZoneName, int *ZoneSize);
    

CGNS Library Design Philosophy

Data Flow

Chart illustrating data flow between a user application and CGNS software

CGNS Library: General Remarks

Examples of Implementation

  1. Read bases, zones & coordinates
       cg_open(filename, MODE_READ, &fn);
    
       cg_nbases(fn, &nbases);
    
       for (B=1; B<=nbases; B++) {
          cg_base_read(fn, B, BaseName, &IndexDim);
          cg_nzones(fn, B, &nzones);
          for (Z=1; Z<=nzones; Z++) {
    
             cg_zone_read(fn, B, Z, ZoneName, ZoneSize)
    
             cg_coord_read(fn, B, Z, "CoordinateX", RealSingle,
                           RangeMin, RangeMax, X);
          }
       }
       cg_close(fn);
    
  2. Read solutions

    Given fn, B, Z:

       cg_nsols(fn, B, Z, nsolutions);
    
       for (S=1, S<=nsolutions, S++) {
    
          cg_sol_info(fn, B, Z, S, SolutionName, GridLocation);
    
          cg_nfields(fn, B, Z, S, nfields);
    
          for (F=1; F<=nfields; F++) {
             cg_field_info(fn, B, Z, S, F, DataType, FieldName);
    
             cg_field_read(fn, B, Z, S, FieldName, RealDouble,
                           RangeMin, RangeMax, DataArray);
          }
       }
    

Status

Current Development

  1. Extension to Unstructured Meshes

    Chart showing ZoneUnstructured_t node with its children

    Unstructured Zone

    Element Sections

  2. Add Geometry-to-Mesh Association

    Chart illustrating geometry-to-mesh association

Future Actions

  1. Build a User Base

  2. Future Development Issues

Conclusion