CGNS and elsA

Poinot Marc
DSNA/ELSA
poinot@onera.fr
http://elsa.onera.fr

Motivations

CGNS related developments

An ISO Data Representation

Chart showing CGNS within ISO data structure

Application side features/ concerns

Architecture

Chart showing elsA and other applications interfacing a tree on disk


Chart showing elsA and other applications interfacing a tree on disk, and a tree in memory

pyCGNS Status

Code example - pyCGNS

#!/usr/bin/env python
# CFD General Notation System - CGNS lib wrapper
# ONERA/DSNA/ELSA - poinot@onera.fr
# User's Guide to CGNS - C.L.Rumsey et al. examples translation
#
from CGNS      import midlevel
from CGNS.wrap import *
from Numeric   import *
#
# open CGNS file for read-only
file=pyCGNS('grid.cgns',midlevel.MODE_READ)
index_base=1
index_zone=1
index_flow=1
isize=file.zoneread(index_base,index_zone)[3]
irmin=[1,1,1]
irmax=[isize[0],isize[1],isize[2]]
(loc,name)=file.solinfo(index_base,index_zone,index_flow)
if (loc != midlevel.Vertex):
  print "Error, GridLocation must be Vertex! Currently:",
  print midlevel.GridLocation[loc]
# read flow solution
r=file.fieldread(index_base,index_zone,index_flow,'Density',midlevel.RealSingle,irmin,irmax)
p=file.fieldread(index_base,index_zone,index_flow,'Pressure',midlevel.RealSingle,irmin,irmax)
# close CGNS file
del file
print "Successfully read flow solution from file 'grid.cgns'"
print "For example, r,p(21,17,9)=",r[20,16,8],p[20,16,8]
print "Program successful... ending now"