|
|
|
This page contains various stuff related to CGNS. If you don't know
what means and contains CGNS, you should refer to the links on the left
margin of the page, before any further reading.
The pyCGNS Python package is a Python binding to the CGNS library.
The package contains a wrapper on top of the ADF and MLL APIs, some tools,
demos, tests, and examples taken from the CGNS tutorial.
The package is a standard Python package, it has to be installed with
DistUtils as described into the doc.
The v2.0 is the last release. I has all the CGNS v2.3
wrapped functions and uses now the numarray python package.
These are prototypes for the ADF storage layer implementation. The ADF
interface in unchanged, thus all the MLL (cgnslib.h) calls
in your applications won't change. You have to re-link your applications
if you want to test these prototypes.
- ADFM is an in-memory storage of the ADF tree. It makes it
possible to built, read, write your ADF tree in memory, send it using
memory buffer based systems (such as MPI), and load/dump it to a plain ADF
file.
- ADFH is a HDF mapping example for ADF.
This proto has still some main problems, you can have a look at it, try
it, and wait for next version if you want something more robust.
Now the two implementations, ADFM and ADFH,
are in the same source tree ADFX.
All these docs have been generated using the Python documentation system,
thanks to F.Drake et al.
You can download the
v2.0 PDF
doc, or read the
HTML version of this manual.
You can read the
source code HTML docs, generated using HappyDoc.
One can also find here two slide shows, one presented at the
NASA/ESA workshop on
data, the second one at Europython.
The first is more CGNS oriented, the second is more Python oriented.
You can find here the french tutorial
given at Libre Software Meeting 2001.
To be upgraded to LSM 2002 soon, there are some typos in 2001.
The tar file contains the pdf and PostScript files, together
with the sources of examples.
The following lines show an example of the use of the Python binding:
import CGNS
from Numeric import *
imax=21
jmax=17
kmax=9
file=CGNS.pyCGNS('grid.cgns',CGNS.MODE_READ)
index_base=1
index_zone=1
(base_index,index_zone,zonename,isize)=file.zoneread(index_base,index_zone)
irmin=[1,1,1]
irmax=[isize[0],isize[1],isize[2]]
x=file.coordread(index_base,index_zone,CGNS.CoordinateX)
y=file.coordread(index_base,index_zone,CGNS.CoordinateY)
z=file.coordread(index_base,index_zone,CGNS.CoordinateZ)
del file
print '(Successfully read grid from file grid.cgns)'
print '(For example, x,y,z(21,17,9)=(%g,%g,%g)'%\
(x[20,16,8],y[20,16,8],z[20,16,8])
|