Home | Project | Software | Gallery | News | Development | Use | Documentation | Search/Ask
 
Page contents
Last release
Online docs
Python stuff
pyCGNS example
 
Tools
ADF implementations
 
Links
CGNS
Python
HDF5
 
 
© 1999-2011 ONERA Terms of use
  

pyCGNS home page


Intro

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.

pyCGNS Downloads

The v2.0 is the last release. I has all the CGNS v2.3 wrapped functions and uses now the numarray python package.
pyCGNS-v2.0.tar.gz (805Kb)
pyCGNS-v1.1.tar.gz (645Kb)
pyCGNS-v1.0.tar.gz (1.3Mb)
pyCGNS-v0.6.tar.gz (817kb)
pyCGNS-v0.5.tar.gz (570kb)
pyCGNS-v0.4.tar.gz (550 kb)
pyCGNS-v0.3.tar.gz (230 kb)
pyCGNS-v0.2.tar.gz (180 kb)
pyCGNS-v0.1.tar.gz (117 kb)

ADF extensions Downloads

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.
CGNSLib-ADFX-v0.2.tar.gz (670 kb)
CGNSLib-ADFM-v0.1.tar.gz (24 kb)

Online docs

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.
CGNS and its Python binding (NASA/ESA workshop, 2002) (1.3Mb)
pyCGNS (Europython, 2002) (670kb)

Python Stuff

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.
Python en 100 tranches + examples (0.4Mb)

Example

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])



(updated $Date: 2011/01/07 16:19:23 $)Home Site map Contacts