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)

(Tools) (CGNSview) (CGNSplot) (Utilities)

Supplied CGNS Tools

A number of useful CGNS tools are available in the tools subdirectory of the CGNS library distribution, are are documented here.

cgnscheck a CGNS file validator
cgnscompress compress (remove extra space) from a CGNS file
cgnsdiff compare 2 CGNS files
cgnslist list the contents of a CGNS file
cgnsnames display all the standard data-name identifiers
cgnsupdate script to update a CGNS file to the current version
cgnsconvert convert a CGNS file to/from ADF/HDF5 format
adf2hdf script to convert a CGNS file from ADF to HDF5
hdf2adf script to convert a CGNS file from HDF5 to ADF


cgnscheck

Checks a CGNS file for validity and if it conforms to the CGNS standard.

Command Line

The program is executed from the command line as:

cgnscheck options CGNSfile newCGNSfile

The command line options are:

option description
-v verbose output. Print node information
-V more verbose. Also print out descriptors
-w level Level for warning messages, from 0 (no messages) to 3 (for all messages). default is 3
-e don't print out error messages (done by default)
-u update CGNS version and check file
-U update CGNS version only

The input CGNS file, CGNSfile is required. If option -u or -U is given, then the file will be updated to the current CGNS version and rewritten. If the output CGNS file, newCGNSfile, is specified the modified CGNS data file will be written to it, otherwise CGNSfile will be modified.


cgnscompress

Rewrites a CGNS file to remove any unused space. This may happen when a file is opened in modify mode and nodes deleted or rewritten. In previous versions of the library, the entire file was automatically rewritten in this case, thus unused space did not occur. In the current version this is no longer done since problems may occur when doing paralllel I/O.

Command Line

The program is executed from the command line as:

cgnscompress CGNSfile newCGNSfile

The input CGNS file, CGNSfile is the file to be compressed. If an output CGNS file, newCGNSfile, is specified the compressed file will be written to it, otherwise CGNSfile will be compressed.


cgnsdiff

Compares 2 CGNS files and lists the differences.

Command Line

The program is executed from the command line as:

cgnsdiff options CGNSfile1 dataset1 CGNSfile2 dataset2

The command line options are:

option description
-c compare node names as case insensitive
-i ignore white space in node names wihile comparing
-q quiet mode. print only if the files differ
-f follow links while comparing
-r compare child nodes also. This is only used when dataset1 is specified. Normally, only the specified node is compared
-d compare the data for a node also. Normally, only the node headers are compared (i.e. label, data type and dimensions.
-t tolerance Tolerance for comparing floating point data when -d is used. The default is 0

The CGNS files to be compared are given by CGNSfile1 and CGNSfile1. The files will be compared by matching node (dataset) names. If dataset1 is specified, then only that node (and it's children if option -r is given) will be compared. Two different named nodes may be compared be specifying dataset2, in which case dataset1 in file CGNSfile1 will be compared with dataset2 in file CGNSfile2. The actual data contained in the nodes is not compared by default, rather just the header information. The -d option will case the node data to be compared also if the headers match. When comparing floating point data, the tolerance given by option -t will be used.

On output:

< dataset1 indicates node is only in CGNSfile1
> dataset2 indicates node is only in CGNSfile2
dataset1<>dataset2 - what indicates that the nodes differ and what indicates the difference


cgnslist

Lists th contents of a CGNS file in a tree structure.

Command Line

The program is executed from the command line as:

cgnslist options CGNSfile

The command line options are:

option description
-b brief output. File summary only
-i indent amount to indent when printing tree. (default is 2)
-f follow links
-l print the node label
-t print the node data type
-d print the node dimensions
-s print the node size in bytes
-a print all the above. implies -ltds

The input CGNS file, CGNSfile is required. The file contents will be listed (node names) in a tree structure, where children nodes are indented 2 from their parent nodes. The information printed for a node, and the indent amount, may be set with the command line options. The option -b will print only a file summary, rather than the entire tree.


cgnsnames

Prints the list on the standardized CGNS data-name identifiers along with their dimensional units (if any).

Command Line

The program is executed from the command line as:

cgnsnames

and writes the output to the console.


cgnsupdate

This is a script that calls cgnscheck with the -U option to update a file to the current CGNS version.

Command Line

The script is executed from the command line as:

cgnsupdate CGNSfile newCGNSfile

The input CGNS file, CGNSfile is the file to be converted. If an output CGNS file, newCGNSfile, is specified the modified CGNS data file will be written to it, otherwise CGNSfile will be modified.


cgnsconvert

Converts a CGNS file to or from ADF or HDF5 format.

Command Line

The program is executed from the command line as:

cgnsconvert options CGNSfile newCGNSfile

The command line options are:

option description
-a write ADF file
-h write HDF5 format
-f force output if input format is the same as the output format
-l expand links in output file

The input CGNS file, CGNSfile is the file to be converted. If an output CGNS file, newCGNSfile, is specified the converted CGNS file will be written to it, otherwise CGNSfile will be converted. The output format is given by the command line options -a to write an ADF file, or -h to write an HDF5 file. If neither option is given, then the output format is assumed to be the opposite of the input format. If the input and output formats are the same, nothing is done, unless the -f option is given to force the writing. The -l option will remove the links and create the corresponding data within the output file.


adf2hdf

Script to convert an ADF CGNS file to HDF5 format. Calls cgnsconvert with the -h option.

Command Line

The program is executed from the command line as:

adf2hdf -links CGNSfile newCGNSfile

The only command line option is -links which causes any linked data to be included in the output file. The input CGNS file, CGNSfile is the file to be converted. If an output CGNS file, newCGNSfile, is specified the converted CGNS file will be written to it, otherwise CGNSfile will be converted. If the input format is already in HDF5 format, nothing is done.


hdf2adf

Script to convert a HDF5 CGNS file to ADF format. Calls cgnsconvert with the -a option.

Command Line

The program is executed from the command line as:

hdf2adf -links CGNSfile newCGNSfile

The only command line option is -links which causes any linked data to be included in the output file. The input CGNS file, CGNSfile is the file to be converted. If an output CGNS file, newCGNSfile, is specified the converted CGNS file will be written to it, otherwise CGNSfile will be converted. If the input format is already in ADF format, nothing is done.