Presentation is loading. Please wait.

Presentation is loading. Please wait.

CGNS And pyCGNS, its Python binding Poinot Marc ONERA - DSNA/ELSA /ELSA/PRS-02036

Similar presentations


Presentation on theme: "CGNS And pyCGNS, its Python binding Poinot Marc ONERA - DSNA/ELSA /ELSA/PRS-02036"— Presentation transcript:

1 CGNS And pyCGNS, its Python binding Poinot Marc ONERA - DSNA/ELSA /ELSA/PRS-02036 poinot@onera.fr http://www.onera.fr

2 /ELSA/PRS-02036 Overview CGNS Goals History Actors/ Components Examples Future/ ISO process pyCGNS Goals/ Status Interoperability architecture Examples Proprietary data format and semantics ISO data format and semantics

3 /ELSA/PRS-02036 CFD ( Computational Fluid Dynamics ) General Notation System CFD standard We want to use a common data representation for interoperability Data semantics Physical representation  Grid creation/ Solvers/ Visualizers  Pre/Post processing of very large amount of data We want to ensure our data a long life format Consistency Timelessness Provide a general, portable and extensible standard for storage and retrieval of CFD analysis data.

4 /ELSA/PRS-02036 Brief history Started 1994 NASA + Boeing to improve technology transfert NASA contract 1995-1998 SIDS document written by S.Allmaras, Boeing Library implementation (+ICEM +NPARC Alliance) Steering Committee 1999… Gather people 17 members +500 users web site Software and documentation releases ISO Process Initiated and supported by Boeing

5 /ELSA/PRS-02036 Steering Committee Airbus Boeing commercial Boeing Phantom Works Boeing Space & Communications CD ADAPCO Group Fluent, Inc. ICEM CFD Engineering Intelligent Light NASA Ames NASA Langley NASA Glenn NUMECA International ONERA Pointwise, Inc. Pratt & Whitney Aircraft Rolls-Royce Allison US Air Force Mission Ensure the continuation of CGNS Responsabilities Software devt., maintenance, test… Documentation Insure a soft. and doc. free distribution Provide expertise and extensions proposals Promote acceptance of the standard Organization Main meeting once per year One chairperson per organization Governs by consensus Welcomes participation of all parties, members or not

6 /ELSA/PRS-02036 Overall architecture Data semantics and Syntax CGNSLib File format Node API Specific Sub-trees API

7 /ELSA/PRS-02036 Components Documentation SIDS document API and users documentation Technical papers Libraries/ sources MLL and ADF libraries (Fortran +C) Binaries Sources User tutorial examples Data file examples

8 /ELSA/PRS-02036 Data exchange example - An informal view Fluid solverMesh generator Communication layer Post processor WB234 wing body coordX bodyConnectivity wingZones solution#1 pressuredensity drag

9 /ELSA/PRS-02036 Example - A CGNS tree WB234 wing coordX Solution#1 density drag WB234 CGNSBase_t Description Wing and body test case 234 Descriptor_t Date 13/03/2002 Descriptor_t Zone_t wing ZoneType_t Structured GridCoordinates_t CoordinateX solution#1 FlowSolution_t DataArray_t Density UserDefined_t Drag DimensionalUnits_t DimensionalUnits DataArray_t dragCoef

10 /ELSA/PRS-02036 Example - An ADF node WB234 wing coordX Solution#1 density drag Name: Density Label: DataArray_t DataType: DataType Dimensions: IndexDimension Parameters: DataType, IndexDimension, DataSize Cardinality: 0,N DimensionValues: DataSize[] Data: [values] Children: [nodes]

11 /ELSA/PRS-02036 Development process Community Mailing list+ Web site+ Users Meeting in Reno (AIAA annual conf.) Teleconferences (every 2 months) Actors Started with ICEM CFD as main developper Now Intelligent Light also Members/ users contributions Means/ process CVS server Heavy testing/ Insure compatibility/ Check portability

12 /ELSA/PRS-02036 Extension process Extending the standard The SIDS and its implementation has been though extensible from start Documentation and consensus first Process Extension submission and discussions using mailing lists Sub-group creation, seek for expertise, document drafting Proposal for extension, implementation Some in-progress extensions Periodic boundary condition/ Interfaces/ Rotating coordinates Chemical species/ Multi-Phase and liquid spray/ Gravity Object-oriented API/ In-memory tree representation

13 /ELSA/PRS-02036 ISO process ISO/STEP Application Protocol 237 - Fluid dynamics Part 110 - Computational Fluid Dynamics Part 52 - Mesh-based topology Part 53 - Numerical analysis Schedule Approval as IS in the second half of 2003 for parts 110, 52 and 53 AP 237 second quarter of 2005 Drafts comments PDF files + CGNS mailing list See CGNS web site

14 /ELSA/PRS-02036 Our users Users Aerospace community Industry Research (Academy, Govt.) Software editors CAD, mesh generation Post-processing tools, viewers Up to 500 registered users (25 countries) No declared user in Asia or Japan Sample users Boeing Adopted CFD data format Many benefits –Common data semantics –Improved modularity –Workflow optimization Conformance to CGNS for new CFD tools Pratt & Whitney Translation tools between proprietary format and CGNS Improve workflow Automation of design processes NASA Langley Add CGNS capabalities to CFL3D code

15 /ELSA/PRS-02036 Future directions Evolve/ Maintain Use web site to scatter/gather information, examples, tools Adds extension to meet users needs Document more and more, tutorial, practical guides Provide or refer to open source tools Spread ISO AIAA recommended practice Emphasize on the use of CGNS in actual computations Participate to conferences (including NASA/ESA Aerospace PDE workshop) Keep source and docs as Open Source

16 /ELSA/PRS-02036 ONERA The French aeronautics and space research center From basic research to flight testing All disciplines involved in aircraft, spacecraft and missile design DSNA Computational Fluid Dynamics and Aeroacoustics Dept. ELSA: Software unit in charge of elsA software elsA New generation CFD solver Industrial tool Framework for research Gather 20 years of CFD methods and software expertise Technologies leading edge OO design and implementation (C++, Python) Efficiency (scalar/vector, space/time) High level QA

17 /ELSA/PRS-02036 CGNS related developments at ONERA elsA Main I/O data representation SIDS compliant Interoperability / Multi-processing –In-memory and disk tree low level Validation resources pyCGNS A Python binding to CGNS Used as gluing language for application framework e.g. translators to CGNS trees –From/To Tecplot and Aerospace actors data format Open source

18 /ELSA/PRS-02036 elsA Software Interoperability Multi-platform/ Multi-applications Fluid/ Structures/ Optimization/ Thermics/ pre/post processing know how Technologies OO design/ implementation C++ kernel Fortran for computation leaves Python user interface A single representation for I/O XDT trees + parsers for subset translation from/to  CGNS/ XML/ Python

19 /ELSA/PRS-02036 Python programming langage Interpreted and OO script language Easy to learn Powerful and extensible Shared libraries Package system Very large scope of applications Portable Including NEC, Cray, Fujitsu Efficient modules for numerical applications Address numerical simulation interoperability concerns Contiguous memory arrays Can point to an already allocated zone Optimized operations on whole data

20 /ELSA/PRS-02036 Ease of use example a=1.4+0.2 b=[1.2, 0.3E-10, 1.4] import Numeric c=Numeric.ones([3])*a+b print "Values :", c import math for d in c: print math.cos(d) Values : array([2.8, 1.6, 3.]) -0.942222340669 -0.0291995223313 -0.9899924966

21 /ELSA/PRS-02036 In-memory trees Goal Have a in-memory representation of trees Communicate semantics using trees Have a contiguous memory zone –share –transfert Use memory buffer based systems –MPI/ SHM/ RPC/ Fast dump to disk/ recovery Implementation ADF API unchanged New implementation Thanks the two layers design of CGNS libraries

22 /ELSA/PRS-02036 Architecture with Python modules Tree on disk: File system/DBMS Tree in-memory: Python interpreter RPC SHM MPI TCP/IP

23 /ELSA/PRS-02036 Interoperability example Two solvers and glue Structure solver Glue FFT+CGNS tree Fluid solver Visualization Main loop Structure computation Translator HOST/ CGNS SPARK parser Numerical Python (arrays+FFT) pyCGNS tree Fluid computation Full CGNS Tecplot viewer Read CGNS

24 /ELSA/PRS-02036 Semantic/structure & efficiency Same tree Data consistency "Blind" interoperability Space/time efficiency Ease of use

25 /ELSA/PRS-02036 Archival example Validation database RDBMS+ proprietary tool Store CGNS file as binary large object –PostgreSQL blob Add attributes Extracted from tree Hidden to MLL RDBMS extra features Access control Query Clever archival server

26 /ELSA/PRS-02036 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"

27 /ELSA/PRS-02036 Parts of XML tree (ADF tree dump using parseTree.py on web site example multi.cgns ) 19926 FILES: challenge.cgns... 2 123 25

28 /ELSA/PRS-02036 pyCGNS Status v0.4 Binding Full ADF wrapper + 60% MLL wrapper Experimental OOL layer Python + Numerical Python Standard package Documentation+ test suite In-memory representation Python/C/C++/Fortran in-memory tree sharing Tools SIFT - SIDS instance description check ParseTree - Tree dump/display as XML tree StampNode - Add sub-nodes with specific stamps (date, ownership…)

29 /ELSA/PRS-02036 pyCGNS v1.0 commitments v1.0 (4Q2002) Binding Full ADF+MLL wrapper Full OOL layer Documentation Features 100% documented + tutorial Design partly documented Test suite Complete test suite for OOL/MLL/ADF Tools Tree parser + XML I/O with DTD DBMS interface for blobs Translators

30 /ELSA/PRS-02036 CGNS and pyCGNS references summary CGNS http://www.cgns.org AIAA 2002-0752 - CFD General Notation System (CGNS): Status and future directions - S.Legensky, D.Edwards, R.Bush, D.Poirier, C.Rumsey, R.Cosner, C.Towne ONERA DSNA/ELSA http://www.onera.fr http://elsa.onera.fr AIAA 2002-0108 - An efficient Object-Oriented solution to CFD complexity - L.Cambier, M.Gazaix pyCGNS http://elsa.onera.fr/CGNS/releases Python http://www.python.org


Download ppt "CGNS And pyCGNS, its Python binding Poinot Marc ONERA - DSNA/ELSA /ELSA/PRS-02036"

Similar presentations


Ads by Google