Table of Contents

Class: pyCGNS CGNS/wrap.py

pyCGNS: wrapper to CGNS calls - pyCGNS creation opens a database - CGNS calls are partly implemented

Methods   
__del__
__getattr__
__init__
__repr__
adfroot
arbitrarymotionread
arbitrarymotionwrite
arrayinfo
arrayread
arraywrite
axisymread
axisymwrite
baseid
baseread
bases
basewrite
bcarearead
bcareawrite
bcdatasetread
bcdatasetwrite
bcdatawrite
bcid
bcinfo
bcnormalwrite
bcread
bcwallfunctionread
bcwallfunctionwrite
bcwrite
biterread
biterwrite
close
connaverageread
connaveragewrite
conninfo
connperiodicread
connperiodicwrite
connread
connwrite
convergenceread
convergencewrite
conversioninfo
conversionread
conversionwrite
coordid
coordinfo
coordread
coordwrite
dataclassread
dataclasswrite
deletenode
descriptorread
descriptors
descriptorwrite
diffusionread
diffusionwrite
discreteread
discretewrite
elementdatasize
elementsread
equationsetchemistryread
equationsetread
equationsetwrite
exponentsinfo
exponentsread
exponentswrite
familybocoread
familybocowrite
familynameread
familynamewrite
familyread
familywrite
fieldid
fieldinfo
fieldread
fieldwrite
georead
geowrite
goto
governingread
governingwrite
gravityread
gravitywrite
gridlocationread
gridlocationwrite
gridread
gridwrite
holeinfo
holeread
holewrite
id
integralread
integralwrite
islink
lasterror
libversion
linkread
linkwrite
modelread
modelwrite
name
narbitrarymotions
narrays
nbc
nconns
ncoords
ndiscrete
nfamilies
nfields
ngrids
nholes
nintegrals
none2one
none2oneglobal
npe
nrigidmotions
nsections
nsols
nuserdata
nzones
one2oneid
one2oneread
one2onereadglobal
one2onewrite
ordinalread
ordinalwrite
parentdatawrite
partread
partwrite
repr
rigidmotionread
rigidmotionwrite
rindread
rindwrite
rotatingread
rotatingwrite
sectionread
sectionwrite
simulationtyperead
simulationtypewrite
solid
solinfo
solwrite
stateread
statewrite
unitsread
unitswrite
userdataread
userdatawrite
ziterread
ziterwrite
zoneid
zoneread
zonetype
zonewrite
  __del__ 
__del__ ( self )

  __getattr__ 
__getattr__ ( self,  name )

  __init__ 
__init__ (
        self,
        name,
        mode=Mll.MODE_READ,
        )

-Creates a CGNS database -(pyCGNS)

''pyCGNS(file-name:S,file-mode:I)

The file mode is an enumerate. It can have the values: MODE_READ, MODE_WRITE, MODE_MODIFY

Exceptions   
CGNS_BadOpenMode, mode
  __repr__ 
__repr__ ( self )

  adfroot 
adfroot ( self )

-Get ADF root id -(pyCGNS)

root-id:D=adfroot()

The root attribute has the same contents.

  arbitrarymotionread 
arbitrarymotionread (
        self,
        bid,
        zid,
        mid,
        )

-Get info about an arbitrary motion node -Arbitrary Grid Motion

return-tuple=arbitrarymotionread(base-id:I,zone-id:I,motion-id:I)

The returned tuple contains: (name:S,ArbitraryGridMotionType:I)

  arbitrarymotionwrite 
arbitrarymotionwrite (
        self,
        bid,
        zid,
        name,
        type,
        )

-Create a new arbitrary motion node -Arbitrary Grid Motion

arbitrary-motion-id:I=arbitrarymotionwrite(base-id:I,zone-id:I,name:S,type:I)

type:ArbitraryGridMotionType

Exceptions   
CGNS_BadArbitraryGridMotionType, type
  arrayinfo 
arrayinfo ( self,  aid )

-Get infos about a given array -Data Array

(array-name:S,data-type:S,data-dim:I,data-vector:(I,...))=arrayinfo(array-id:I)

The current node is the parent node of the requested array. The data-type enumerate can be found using the cross dictionnary. There is redondancy of data-dim and data-vector, first can be deduced from the second.

  arrayread 
arrayread ( self,  aid )

-Get the array data -Data Array

data-array:A=arrayread(array-id:I)

The array id its index under the current node. See arrayinfo remarks.

  arraywrite 
arraywrite (
        self,
        name,
        dtype,
        dim,
        ddim,
        darray,
        )

-Create or update a new array -Data Array

array-id:I=arraywrite(array-name:S,d-type:S,d-dim:I,d-vector:(I,...),d-array:A)

All type, dim vector are refering to the array of data itself. See also arrayinfo remarks.

Exceptions   
CGNS_BadDataType, dtype
  axisymread 
axisymread ( self,  bid )

-Get the axisymmetry parameters -Axisymmetry

(reference-point:(D,D),axis-vector:(D,D))=axisymread(base-id:I)

Should be 2D.

  axisymwrite 
axisymwrite (
        self,
        bid,
        rv,
        rc,
        )

-Set the axisymmetry parameters -Axisymmetry

None=axisymwrite(base-id:I,reference-point:(D,D),axis-vector:(D,D))

Should be 2D.

  baseid 
baseid ( self,  id )

-Get the ADF id of a base -undocumented MLL

base-id:D=baseid(base-id:I)

The argument is the MLL id, the return value is the ADF id, it is a double float value. Such an id cannot be obtained if the CGNS/ADF file has been open as write only.

Exceptions   
CGNS_FileShouldBeReadable
  baseread 
baseread ( self,  id )

-Get infos about a given base -Base

(base-idx:I,base-name:S,cell-dim:I,phys-dim:I)=baseread(base-idx:I)

Arg is base id, returns a tuple with base information.

  bases 
bases ( self )

-Count number of bases -Base

nbases:I=bases()

The nbases attribute has the same contents.

  basewrite 
basewrite (
        self,
        name,
        cdim,
        pdim,
        )

-Create a new base in an existing CGNS file -Base

base-idx:I=basewrite(base-name:S,cell-dim:I,phys-dim:I)

Args are base name, cell and physical dimensions. Returns the new id of the created base

  bcarearead 
bcarearead (
        self,
        bid,
        zid,
        bcid,
        )

-Get the area parameters -Boundary Condition

(region:S,type:I,surf:D)=bcarearead(base-id:I,zone-id:I,bc-id:I)

Type is AreaType

  bcareawrite 
bcareawrite (
        self,
        bid,
        zid,
        bcid,
        type,
        surf,
        region,
        )

-Set the area parameters -Boundary Condition

None=bcareawrite(base-id:I,zone-id:I,bc-id:I,type:I,surf:D,region:S)

Type is AreaType

Exceptions   
CGNS_BadAreaType, type
  bcdatasetread 
bcdatasetread (
        self,
        bid,
        zid,
        bcid,
        dsid,
        )

-Read the dataset set of a given BC -Boundary Condition

return-tuple=bcdatasetread(base-id:I,zone-id:I,bc-id:I,dset-id:I)

The return tuple is the following. (dset-name:S,bc-data-type:I,dir-flag:I,neu-flag:I)

  bcdatasetwrite 
bcdatasetwrite (
        self,
        bid,
        zid,
        bcid,
        dsname,
        dstype,
        )

-Write the dataset set of a given BC -Boundary Condition

dset-id:I=bcdatasetwrite(base-id:I,zone-id:I,bc-id:I,dset-name:S,dset-type:I)

dset-type:BCType

Exceptions   
CGNS_BadBCType, dstype
  bcdatawrite 
bcdatawrite (
        self,
        bid,
        zid,
        bcid,
        dsid,
        bctype,
        )

-Write the data in a BC dataset -Boundary Condition

None=bcdatawrite(base-id:I,zone-id:I,bc-id:I,dset-id:I,bc-data-type:I)

bc-data-type:BCDataType

Exceptions   
CGNS_BadBCDataType, bctype
  bcid 
bcid (
        self,
        bid,
        zid,
        bcid,
        )

-Get the BC ADF id -undocumented MLL

bc-id:D=bcid(base-id:I,zone-id:I,bc-id:I)

Used for ADF functions

  bcinfo 
bcinfo (
        self,
        bid,
        zid,
        bcid,
        )

-Get info from a given BC -Boundary Condition

return-tuple=bcinfo(base-id:I,zone-id:I,bc-id:I)

The result tuple has the following members, in that order. The name:S of the node, its bc-type:I and its point-set-type:I. The number-of-points:I, the normal-index:(I,I,I), the data-type:I for the normals, the normal-flag:I and the number-of-bc-data-set:I.

  bcnormalwrite 
bcnormalwrite (
        self,
        bid,
        zid,
        bcid,
        nindex,
        nflags,
        dt,
        nlist,
        )

-Write the normals of a given BC -Boundary Condition

None=bcnormalwrite(base-id:I,zone-id:I,bc-id:I,args...)

The trailing args are the following, in this order. The normal-index:(I,I,I), normal-flag:I, data-type:I, 'normal-list:((D,D,D),...). Caution: normal-flag is forced to FALSE, normal-list is not taken into account.

Exceptions   
CGNS_BadDataType, dt
  bcread 
bcread (
        self,
        bid,
        zid,
        bcid,
        )

-Read point and normal lists from a given BC -Boundary Condition

(point-list:A,normal-list:A)=bcread(base-id:I,zone-id:I,bc-id:I)

Comment

  bcwallfunctionread 
bcwallfunctionread (
        self,
        bid,
        zid,
        bcid,
        )

-Get the type of BC wallfunction -Boundary Condition

WallFunctionType:I=bcwallfunctionread(base-id:I,zone-id:I,bc-id:I)

Comment

  bcwallfunctionwrite 
bcwallfunctionwrite (
        self,
        bid,
        zid,
        bcid,
        type,
        )

-Set the type of BC wallfunction -Boundary Condition

None=bcwallfunctionwrite(base-id:I,zone-id:I,bc-id:I,type:I)

Type is WallFunctionType

Exceptions   
CGNS_BadWallFunctionType, type
  bcwrite 
bcwrite (
        self,
        bid,
        zid,
        bcname,
        bctype,
        pttype,
        ptlist,
        )

-Create a new BC -Boundary Condition

bc-id:I=bcwrite(base-id:I,zone-id:I,args...)

The trailing arguments are the following, in that order. The bc-name:S, bc-type:I, bc-point-set-type:I, the point-set-list:((I,I,I),...). The number of points in the point set list is deduced from the length of the point list, except if the point set type is PointRange. In that case, the number of points is forced to 2.

Exceptions   
CGNS_BadBCType, bctype
CGNS_BadPointSetType, pttype
  biterread 
biterread ( self,  bid )

-Get the name of the iterative data base -Iterative Data

(name:S,number-of-it:I)=biterread(base-id:I)

No Comment

  biterwrite 
biterwrite (
        self,
        bid,
        name,
        it,
        )

-Create base iterative data -Iterative Data

None=biterwrite(base-id:I,name:S,iteration:I)

No Comment

  close 
close ( self )

-Close the current CGNS file -(pyCGNS)

None=close()

Close is performed by del if not already (explicitely) done.

  connaverageread 
connaverageread (
        self,
        bid,
        zid,
        cid,
        )

-Get special connect properties -Special Grid Connectivity

averate-type:I=connaverageread(base-id:I,zone-id:I,connect-id:I)

The type is AverageInterfaceType.

  connaveragewrite 
connaveragewrite (
        self,
        bid,
        zid,
        cid,
        at,
        )

-Set special connect properties -Special Grid Connectivity

None=connaveragewrite(base-id:I,zone-id:I,connect-id:I,averate-type:I)

The type is AverageInterfaceType.

Exceptions   
CGNS_BadAverageInterfaceType, at
  conninfo 
conninfo (
        self,
        bid,
        zid,
        cid,
        )

-Get information about generalized connect node -Grid Connectivity

return-tuple=conninfo(base-id:I,zone-id:I,connect-id:I)

The return tuple contains: connect-name:S, gridlocation:I, gridconnectivity:I, pointsettype:I, number-of-points:I, donor-name:S, donor-zone-type:I, donor-point-set-type:I', donor-data-type:I and donor-number-of-points:I

  connperiodicread 
connperiodicread (
        self,
        bid,
        zid,
        cid,
        )

-Get special connect properties -Special Grid Connectivity

return-tuple=connperiodicread(base-id:I,zone-id:I,connect-id:I)

The size of arrays is the base physical dimension. The reurn-tuple is (rot-center:A,rot-angle:A,translation:A).

  connperiodicwrite 
connperiodicwrite (
        self,
        bid,
        zid,
        cid,
        rc,
        ra,
        tt,
        )

-Set special connect properties -Special Grid Connectivity

None=connperiodicwrite(base-id:I,zone-id:I,connect-id:I,args...)

the trailing args are rot-center:A, rot-angle:A , translation:A. The size of these arrays is the base physical dimension.

  connread 
connread (
        self,
        bid,
        zid,
        cid,
        )

-Get generalized connectivity points -Grid Connectivity

return-tuple=connread(base-id:I,zone-id:I,connect-id:I)

The tuple contains two arrays of integers target-interface-points:A and donor-interface-oints:A.

  connwrite 
connwrite (
        self,
        bid,
        zid,
        name,
        gl,
        gt,
        pst,
        npt,
        pt,
        dname,
        dzt,
        dpst,
        ddt,
        dnpt,
        dpt,
        )

-Create a generalized connectivity node -Grid Connectivity

connect-id:I=connwrite(args)

The arguments are defining (in this order) the base-id:I,zone-id:I of the new node, its name:S, the gridlocation:I, gridconnectivitytype:I and point-set-type:I of the current (target) node interface. The number-of-points:I and interface-points:A which is an array of integers. Then the donor-name:S, its zonetype:I, point-set-type:I and data-type:I, the number-of-donor-points:I and the actual array of points donor-points:A.

Note the DataType is force to Integer.

Exceptions   
CGNS_BadDataType, ddt
CGNS_BadGridLocation, gl
CGNS_BadPointSetType, dpst
CGNS_BadPointSetType, pst
CGNS_GridConnectivityType, gt
CGNS_ZoneType, dzt
  convergenceread 
convergenceread ( self )

-Get the convergence under current node -Convergence

(number-of-iteration:I,node-name:S)=convergenceread()

No args, current node is used.

  convergencewrite 
convergencewrite (
        self,
        nit,
        name,
        )

-Craete of update a convergence node -Convergence

None=convergencewrite(number-of-iteration:I,node-name:S)

Uses the current node. Should return the node id.

  conversioninfo 
conversioninfo ( self )

-Get the conversion datatype -Units and Dimensionals

datatype:I=conversioninfo()

Python only handles double. Beware at write time, you can have double/single.

  conversionread 
conversionread ( self )

-Get the conversion values -Units and Dimensionals

(D,D)=conversionread()

See conversionwrite remarks.

  conversionwrite 
conversionwrite (
        self,
        dt,
        v,
        )

-Create or update the conversion factors -Units and Dimensionals

None=conversionwrite(data-type:I,(D,D))

Conversion values are: scale, offset

Exceptions   
CGNS_BadDataType, dt
  coordid 
coordid (
        self,
        bid,
        zid,
        cid,
        )

-Get the ADF id of a coordinate -undocumented MLL

coord-id:D=coordid(base-id:I,zone-id:I,coord-id:I)

See baseid remarks.

Exceptions   
CGNS_FileShouldBeReadable
  coordinfo 
coordinfo (
        self,
        bid,
        zid,
        cid,
        )

-Get infos about a given coordinate -Coordinates

(data-type:S,node-name:S)=coordinfo(base-id:I,zone-id:I,coord-id:I)

See coordwrite remarks.

  coordread 
coordread (
        self,
        bid,
        zid,
        cname,
        rmode=0,
        )

-Read the coordinate array -Coordinates

coord-array:A=coordread(base-id:I,zone-id:I,coord-name:S,read-mode:I)

The returned array is a pyArray containing the data with the required format. Unfair-remark: a zone name is required, but all requests to nodes are done using integer ids. The read mode is default to 0, that is a C-like read (i,j,k). The mode=1 is fortran like read (k,j,i). Please, take care of the dimensions in that case, see the zoneread remarks.

  coordwrite 
coordwrite (
        self,
        bid,
        zid,
        dtype,
        cname,
        darray,
        )

-Create a coordinate array node -Coordinates

coord-id:I=coordwrite(base-id:I,zone-id:I,data-type:S,node-name:S,data-array:A)

data-type:DataType

Exceptions   
CGNS_BadDataType, dtype
  dataclassread 
dataclassread ( self )

-Get the dataclass under current node -Units and Dimensionals

data-class:I=dataclassread()

See dataclasswrite remarks.

  dataclasswrite 
dataclasswrite ( self,  dt )

-Create or update the dataclass under current node -Units and Dimensionals

None=dataclasswrite(data-class:I)

The data-class is a DataClass enumerate.

Exceptions   
CGNS_BadDataClass, dt
  deletenode 
deletenode ( self,  name )

-Delete the given node -Node

None=delenode(name:S)

Removes the current node (and its children).

  descriptorread 
descriptorread ( self,  index )

-Get the descriptor contents -Descriptor

(desc-name:S,desc-text:S)=descriptorread(desc-id:I)

The current node is used.

  descriptors 
descriptors ( self )

-Count number of descriptors -Descriptor

ndescriptor:I=descriptors()

The ndescriptor attribute has the same contents.

  descriptorwrite 
descriptorwrite (
        self,
        nodename,
        text,
        )

-Create or update a descriptor under the current node -Descriptor

None=descriptorwrite(desc-name:S,desc-test:S)

Unfair-remark: We should get the descriptor id as returned argument.

  diffusionread 
diffusionread ( self )

-Get diffusion info -Flow Equation Set

(I,I,I,I,I)=diffusionread()

No Comment

  diffusionwrite 
diffusionwrite ( self,  d )

-Set diffusion info -Flow Equation Set

None=diffusionwrite(I,I,I,I,I)

No Comment

  discreteread 
discreteread (
        self,
        bid,
        zid,
        did,
        )

-Get the name of discrete node -Discrete Data

disc-name:S=discreteread(base-id:I,zone-id:I,disc-id:I)

No Comment

  discretewrite 
discretewrite (
        self,
        bid,
        zid,
        name,
        )

-Create a new discrete data node -Discrete Data

dics-id:I=discretewrite(base-id:I,zone-id:I,disc-name:S)

No Comment

  elementdatasize 
elementdatasize (
        self,
        bid,
        zid,
        sid,
        )

-Get the number of elements for this section -Element Connectivity

number:I=elementdatasize(base-id:I,zone-id:I,section-id:I)

See section-write

  elementsread 
elementsread (
        self,
        bid,
        zid,
        sid,
        )

-Get elements of a section -Element Connectivity

(elements:A,parents:A)=elementsread(base-id:I,zone-id:I,section-id:I)

Returns two arrays of I

  equationsetchemistryread 
equationsetchemistryread ( self )

-Read chemistry flags -Flow Equation Set

equation-flags:(I,I)=equationsetchemistryread()

No Comment

  equationsetread 
equationsetread ( self )

-Get equation set info -Flow Equation Set

equation-dim:(I,I,I,I,I)=equationsetread()

No Comment

  equationsetwrite 
equationsetwrite ( self,  d )

-Set equation set info -Flow Equation Set

None=equationsetwrite(equation-dim:I)

No Comment

  exponentsinfo 
exponentsinfo ( self )

-Get the exponents datatype -Units and Dimensionals

datatype:I=exponentsinfo()

Python only handles double. Beware at write time, you can have double/single.

  exponentsread 
exponentsread ( self )

-Get the exponents values -Units and Dimensionals

(D,D,D,D,D)=exponentsread()

See exponentswrite remarks.

  exponentswrite 
exponentswrite (
        self,
        dt,
        v,
        )

-Create or update the exponents -Units and Dimensionals

None=exponentswrite(data-type:I,(D,D,D,D,D))

Exponents values are: Mass, Length, Time, Temperature, Angle.

Exceptions   
CGNS_BadDataType, dt
  familybocoread 
familybocoread (
        self,
        bid,
        fid,
        bcid,
        )

-Get name of current node family for a given BC -Families

(bc-name:S,bc-type:I)=familybocoread(base-id:I,fam-id:I,bc-id:I)

No Comment

  familybocowrite 
familybocowrite (
        self,
        bid,
        fid,
        name,
        btype,
        )

-Create name of current node family for a given BC -Families

bc-id:I=familyboconamewrite(base-id:I,fam-id:I,bc-name:S,bc-type:I)

No Comment

Exceptions   
CGNS_BadBCType, btype
  familynameread 
familynameread ( self )

-Get name of current node family -Families

fam-name:S=familynameread()

No Comment

  familynamewrite 
familynamewrite ( self,  name )

-Creates name of current node family -Families

None=familynamewrite(fam-name:S)

No Comment

  familyread 
familyread (
        self,
        bid,
        fid,
        )

-Get info about a given family -Families

(fam-name:S,number-of-fam-bc:I,number-of-geo:I)=familyread(base-id:I,fam-id:I)

No Comment

  familywrite 
familywrite (
        self,
        bid,
        name,
        )

-Create a new family node -Families

fam-id:I=familywrite(base-id:I,fam-name:S)

No Comment

  fieldid 
fieldid (
        self,
        bid,
        zid,
        sid,
        fid,
        )

-Get the ADF id of a solution field -undocumented MLL

field-id:D=fieldid(base-id:I,zone-id:I,sol-id:I,field-id:I)

See baseid remarks.

Exceptions   
CGNS_FileShouldBeReadable
  fieldinfo 
fieldinfo (
        self,
        bid,
        zid,
        sid,
        fid,
        )

-Get infos about a given solution field -Flow Solution

(data-type:S,field-name:S)=fieldinfo(base-id:I,zone-id:I,sol-id:I,field-id:I)

See coordwrite remarks.

  fieldread 
fieldread (
        self,
        bid,
        zid,
        sid,
        fname,
        dtype,
        imin,
        imax,
        )

-Get the data array of a given solution field -Flow Solution

data-array:A=fieldread(base-id:I,zone-id:I,sol-id:I,field-name:S,args...)

The trailing args are data-type:S and tuples of indices: i-min:(I,I,I) i-max:(I,I,I). These imin and imax tuples are forced to 3D, but only relevant values are used. Other values can be set to zero. Unfair-remark: field name is required.

Exceptions   
CGNS_BadDataType, dtype
  fieldwrite 
fieldwrite (
        self,
        bid,
        zid,
        sid,
        dtype,
        fname,
        darray,
        )

-Create a data array for a solution field -Flow Solution

field-id:I=fieldwrite(base-id:I,zone-id:I,sol-id:I,args...)

The trailing args are data-type:S, field-name:S and the array of data data-array:A. See also coordwrite remarks.

Exceptions   
CGNS_BadDataType, dtype
  georead 
georead (
        self,
        bid,
        fid,
        gid,
        )

-Get geometry info -Families

(geo-name:S,file:S,CAD:S,parts:I)=georead(base-id:I,fam-id:I,geo-id:I)

No Comment

  geowrite 
geowrite (
        self,
        bid,
        fid,
        gname,
        fname,
        cadname,
        )

-Creates geometry info -Families

geo-id:I=geowrite(base-id:I,fam-id:I,geo-name:S,file:S,CAD:S)

No Comment

  goto 
goto (
        self,
        baseidx,
        path=(),
        )

-Set the current node -Node

node-id:D=goto(base-id:I,path:((node-type:S,node-id:I),...))

The goto sets the current node to the leaf of the given path. The path itself is a list of tuples. Each tuple contains the node type a first argument, its index as second arg. Note the returned id is not (yet) trustable.

  governingread 
governingread ( self )

-Get governing equations info -Flow Equation Set

governing-eq-type:I=governingread()

No Comment

  governingwrite 
governingwrite ( self,  d )

-Set governing equations info -Flow Equation Set

None=governingwrite(governing-eq-type:I)

No Comment

Exceptions   
CGNS_BadGoverningType, d
  gravityread 
gravityread ( self,  bid )

-Get the gravity vector -Auxiliary Data

(gravity-vector:(D,...))=gravityread(base-id:I)

Size depends on physical dimension of base.

  gravitywrite 
gravitywrite (
        self,
        bid,
        gv,
        )

-Set the gravity vector -Auxiliary Data

None=gravitywrite(base-id:I,gravity-vector:(D,...))

Size depends on physical dimension of base.

  gridlocationread 
gridlocationread ( self )

-Get the grid location info -Grid

grid-location:I=gridlocationread()

Under current node

  gridlocationwrite 
gridlocationwrite ( self,  gloc )

-Set the grid location info -Grid

None=gridlocationwrite(grid-location:I)

Under current node

Exceptions   
CGNS_BadGridLocation, glocation
  gridread 
gridread (
        self,
        bid,
        zid,
        did,
        )

-Get the grid name -Grid

grid-name:S=gridread(base-id:I,zone-id:I,grid-id:I)

Comment

  gridwrite 
gridwrite (
        self,
        bid,
        zid,
        name,
        )

-Create a new grid node -Grid

grid-id:I=function(base-id:I,zone-id:I,grid-name:S)

Comment

  holeinfo 
holeinfo (
        self,
        bid,
        zid,
        hid,
        )

-Get info from a given overset hole node -Overset Holes

return-tuple=holeinfo(base-id:I,zone-id:I,hole-id:I)

Returns a tuple containing name:S of the overset hole, grid-location:I of the returned set(s) of points, the point-set-type:I, the number-of-point-sets:I and the /number-of-points-per-point-set:I'. Should be called before holeread in order to have array dimensions before allocation.

  holeread 
holeread (
        self,
        bid,
        zid,
        hid,
        )

-Get info from a given overset hole node -Overset Holes

'point-array:A'='holeread(base-id:I,zone-id:I,hole-id:I)

Gets the array containing the points. Dimensions depens on the PointSetType (see holeinfo).

  holewrite 
holewrite (
        self,
        bid,
        zid,
        hname,
        gloc,
        psett,
        ar,
        )

-Create a new overset hole node -Overset Holes

hole-id:I=holewrite(base-id:I,zone-id:I,hole-name:S,g-location:S,point-array:A)

The grid location is a string. The corresponding enumerate can be found using the cross dictionnary.

Exceptions   
CGNS_BadGridLocation, glocation
CGNS_BadPointSetType, pttype
  id 
id (
        self,
        baseidx,
        path,
        )

-Get the ADF id of a given node -(pyCGNS)

node-id:D=id(base-id:I,path:((node-type:S,node-id:I),...))

Uses the same syntax as goto, but doesn't set the current node. This id call is not trustable, it has not beeen tested and probably has a destructive effect on cgnslib global variables... See goto remarks

  integralread 
integralread ( self,  id )

-Get the name of integral node -Integral Data

integral-name:S=integralread(integral-id:I)

Under current node.

  integralwrite 
integralwrite ( self,  name )

-Create a new integral node -Integral Data

integral-id:I=integralwrite(integral-name:S)

Under current node.

  islink 
islink ( self )

-Test if current node is a link -Link

true-if-is-link:I=islink()

Uses current node.

  lasterror 
lasterror ( self )

-Get the current error -(pyCGNS)

(error-code:I,error-message:S)=lasterror()

The error attribute has the same contents.

  libversion 
libversion ( self )

-Get library version -(pyCGNS)

version:D=libversion()

The version attribute has the same contents.

  linkread 
linkread ( self )

-Get infos about a given link -Link

(file-name:S,target-name:S))=linkread()

Uses the current node as argument node previously set by goto call.

  linkwrite 
linkwrite (
        self,
        sourcenode,
        destfile,
        destnode,
        )

-Create a link -Link

None=linkwrite(source-name:S,file-name:S,target-name:S)

Args are the link name, the destination file, destination node name. Returns None.

  modelread 
modelread ( self,  label )

-Get model info -Flow Equation Set

(model-name:S,model-type:I)=modelread(nodel-name:S)

No Comment

  modelwrite 
modelwrite (
        self,
        label,
        mt,
        )

-Set model info -Flow Equation Set

None=modelwrite(model-name:S,model-type:I)

No Comment

Exceptions   
CGNS_BadModelType, mt
  name 
name ( self )

-Get file name -(pyCGNS)

filename:S=name()

The name attribute has the same contents.

  narbitrarymotions 
narbitrarymotions (
        self,
        bid,
        zid,
        )

-Get number of arbitrary motion nodes -Arbitrary Grid Motion

number-of-motion:I=narbitrarymotions(base-id:I,zone-id:I)

No Comment

  narrays 
narrays ( self )

-Count arrays under the current node -Data Array

number-of-arrays:I=narrays()

Use goto to set the current node.

  nbc 
nbc (
        self,
        bid,
        zid,
        )

-Get the count of BC -Boundary Condition

number-of-bc:I=nbc(base-id:I,zone-id:I)

No comment

  nconns 
nconns (
        self,
        bid,
        zid,
        )

-Get number of generalized connectivities -Grid Connectivity

number:I=nconns(base-id:I,zone-id:I)

No comment.

  ncoords 
ncoords (
        self,
        bid,
        zid,
        )

-Count coordinates nodes in the zone -Coordinates

number-of-coords:I=ncoords(base-id:I,zone-id:I)

See nzones remarks.

  ndiscrete 
ndiscrete (
        self,
        bid,
        zid,
        )

-Get count of discrete node -Discrete Data

number-of-discrete:I=ndiscrete(base-id:I,zone-id:I)

No Comment

  nfamilies 
nfamilies ( self,  bid )

-Count families in the base -Families

number-of-families:I=nfamilies(base-id:I)

No Comment

  nfields 
nfields (
        self,
        bid,
        zid,
        sid,
        )

-Count fields in the solution -Flow Solution

number-of-fields:I=nfields(base-id:I,zone-id:I,sol-id:I)

See nzones remarks.

  ngrids 
ngrids (
        self,
        bid,
        zid,
        )

-Count the number of grids -Grid

number-of-grids:I=ngrids(base-id:I,zone-id:I)

Comment

  nholes 
nholes (
        self,
        bid,
        zid,
        )

-Get the count of overset holes -Overset Holes

number-of-holes:I=nholes(base-id:I,zone-id:I)

Returns the number of overset holes in the current zone

  nintegrals 
nintegrals ( self )

-Get count of integral data nodes -Integral Data

number-of-integral=nintegrals()

Counts under current node

  none2one 
none2one (
        self,
        bid,
        zid,
        )

-Count the one2one nodes -Grid Connectivity

number-of-one2one:I=none2one(base-id:I,zone-id:I)

Comment

  none2oneglobal 
none2oneglobal ( self,  bid )

-Count the one2one nodes for the whole base -Grid Connectivity

number-of-one2one:I=none2oneglobal(base-id:I)

Comment

  npe 
npe ( self,  t )

-Get the number of nodes for an element type -Element Connectivity

number:I=npe(element-type:I)

element-type is an enumerate.

  nrigidmotions 
nrigidmotions (
        self,
        bid,
        zid,
        )

-Get number of rigid motion nodes -Rigid Grid Motion

number-of-motion:I=nrigidmotions(base-id:I,zone-id:I)

No Comment

  nsections 
nsections (
        self,
        bid,
        zid,
        )

-Get lower range index -Element Connectivity

section-index:I=nsections(base-id:I,zone-id:I)

The lower range is (imin, jmin, kmin)

  nsols 
nsols (
        self,
        bid,
        zid,
        )

-Get count of solutions -Flow Solution

number-of-solutions:I=nsols(base-id:I,zone-id:I)

No Comment

  nuserdata 
nuserdata ( self )

-Count number of user data -User Data

number-of-userdata:I=nuserdata()

Under current node.

  nzones 
nzones ( self,  id )

-Count zones in the base -Zone

number-of-zones:I=nzones(base-id:I)

The zone count is a max, the zone ids are starting from 1 (one). Thus, using nzones with a range function should be done with range(1,file.nzones(base)+1)

  one2oneid 
one2oneid (
        self,
        bid,
        zid,
        id,
        )

-Get the ADF id of a one2one node -undocumented MLL

one2one-id:D=one2oneid(base-id:I,zone-id:I,one2one-id:I)

Comment

  one2oneread 
one2oneread (
        self,
        bid,
        zid,
        id,
        )

-Get the one2one node informations -Grid Connectivity

return-tuple=one2oneread(base-id:I,zone-id:I,one2one-id:I)

The return tuple has the following members, in that order. The name:S of the node, the donor-name:S, the range tuple and the donor-range tuple which are both six-integer tuples. Then the transform tuple is a three-integer tuple.

  one2onereadglobal 
one2onereadglobal ( self,  bid )

-Get the one2one node informations for whole base -Grid Connectivity

return-list=one2onereadglobal(base-id:I)

The return is a list of tuples, each tuple tuple has the following members, in that order. The name:S of the node, the zone:S name for which the conectivity information is related, the donor-name:S, the range tuple and the donor-range tuple which are both six-integer tuples. Then the transform tuple is a three-integer tuple.

  one2onewrite 
one2onewrite (
        self,
        bid,
        zid,
        name,
        donor,
        wrange,
        wdonorrange,
        transform,
        )

-Create a 1to1 connectivity node -Grid Connectivity

one2one-id:I=one2onewrite(base-id:I,zone-id:I,args...)

The trailing arguments are the following, in that order. The name:S of the node, the donor-name:S, the range tuple and the donor-range tuple which are both six-integer tuples. Then the transform tuple is a three-integer tuple.

  ordinalread 
ordinalread ( self )

-Get the ordinal under current node -Ordinal

ordinal:I=ordinalread()

Comment

  ordinalwrite 
ordinalwrite ( self,  o )

-Create or update an ordinal node under current node -Ordinal

None=ordinalwrite(ordinal:I)

Comment

  parentdatawrite 
parentdatawrite (
        self,
        bid,
        zid,
        sid,
        ar,
        )

-Write the parent data in a section -Element Connectivity

None=parentdatawrite(base-id:I,zone-id:I,section-id:I,parent-data:A)

No return

  partread 
partread (
        self,
        bid,
        fid,
        gid,
        pid,
        )

-Get part info -Families

part-name:S=partread(base-id:I,fam-id:I,geo-id:I,part-id:I)

No Comment

  partwrite 
partwrite (
        self,
        bid,
        fid,
        gid,
        pname,
        )

-Create part info -Families

part-id:I=partwrite(base-id:I,fam-id:I,geo-id:I,part-name:S)

No Comment

  repr 
repr ( self )

  rigidmotionread 
rigidmotionread (
        self,
        bid,
        zid,
        mid,
        )

-Get info about a rigid motion node -Rigid Grid Motion

return-tuple=rigidmotionread(base-id:I,zone-id:I,motion-id:I)

The returned tuple contains: (name:S,RigidGridMotionType:I)

  rigidmotionwrite 
rigidmotionwrite (
        self,
        bid,
        zid,
        name,
        type,
        )

-Create a new rigid motion node -Rigid Grid Motion

rigid-motion-id:I=rigidmotionwrite(base-id:I,zone-id:I,name:S,type:I)

type:RigidGridMotionType

Exceptions   
CGNS_BadRigidGridMotionType, type
  rindread 
rindread ( self )

-Get the rind indices under current node -Grid

(imin:I,imax:I,jmin:I,jmax:I,kmin,kmax:I)=rindread()

See rindwrite comment.

  rindwrite 
rindwrite ( self,  rind )

-Create of update the rind indices under current node -Grid

None=rindwrite((imin:I,imax:I,jmin:I,jmax:I,kmin,kmax:I))

Uses the current node. Tuple depends on dimensions, J or K could be unused in the case of 1D, 2D. Always give 6 integers, set them to zero if you are not 3D

  rotatingread 
rotatingread ( self )

-Get the rotation parameters -Rotating Coordinates

(rate-vector:(D,...),center:(D,...))=rotatingread()

The (D,...) have the base physical dimension (i.e. 2 in 2D and 3 in 3d).

  rotatingwrite 
rotatingwrite (
        self,
        rv,
        rc,
        )

-Set the rotation parameters -Rotating Coordinates

None=rotatingwrite(rate-vector:(D,...),center:(D,...))

See rotatingread

  sectionread 
sectionread (
        self,
        bid,
        zid,
        sid,
        )

-Get infos about a given section -Element Connectivity

return-tuple=sectionread(base-id:I,zone-id:I,section-id:I)

Returns a tuple containing name:S of the section, its type:I start:I and end:I, last-bnd-index:I, parent-flag:I.

  sectionwrite 
sectionwrite (
        self,
        bid,
        zid,
        name,
        type,
        start,
        end,
        nb,
        ar,
        )

-Write a section -Element Connectivity

section-id=sectionwrite(base-id:I,zone-id:I,section-name:S,args...)

The trailing args are the type:I of the section elements the start:I and end:I indices, last-bnd-index:I index and at last the elements:A array itself (of type 'type).

Exceptions   
CGNS_BadElementType, type
  simulationtyperead 
simulationtyperead ( self,  bid )

-Get simulation type info -Flow Equation Set

simulation-type:I=simulationtyperead(base-id:I)

No Comment

  simulationtypewrite 
simulationtypewrite (
        self,
        bid,
        simtype,
        )

-Set simulation type info -Flow Equation Set

None=simulationtypewrite(base-id:I,simulation-type:I)

No Comment

  solid 
solid (
        self,
        bid,
        zid,
        sid,
        )

-Get the ADF id of a solution -undocumented MLL

sol-id:D=solid(base-id:I,zone-id:I,sol-id:I)

See baseid remarks.

Exceptions   
CGNS_FileShouldBeReadable
  solinfo 
solinfo (
        self,
        bid,
        zid,
        sid,
        )

-Get infos about a given solution -Flow Solution

(grid-location:S,sol-name:S)=solinfo(base-id:I,zone-id:I,sol-id:I)

See solwrite remarks.

  solwrite 
solwrite (
        self,
        bid,
        zid,
        sname,
        glocation,
        )

-Create a new solution -Flow Solution

sold-id:I=solwrite(base-id:I,zone-id:I,sol-name:S,grid-location:S)

The grid location is a string. The corresponding enumerate can be found using the cross dictionnary.

Exceptions   
CGNS_BadGridLocation, glocation
  stateread 
stateread ( self )

-Get state info -Flow Equation Set

state-description:S=stateread()

No Comment

  statewrite 
statewrite ( self,  name )

-Set state info -Flow Equation Set

None=statewrite(state-description:S)

No Comment

  unitsread 
unitsread ( self )

-Get the units under current node -Units and Dimensionals

(mass-u:S,length-u:S,time-u:S,temp-u:S,angle-u:S)=unitsread()

See unitswrite remarks.

  unitswrite 
unitswrite (
        self,
        mass,
        leng,
        time,
        temp,
        angl,
        )

-Create or update a units set under current node -Units and Dimensionals

None=unitswrite(mass-u:S,length-u:S,time-u:S,temp-u:S,angle-u:S)

See remarks about the constants dictionnary, one can either use the defined strings, variables or their enumerates. should be much more documented/checked here

Exceptions   
CGNS_BadAngleUnit
CGNS_BadLengthUnit
CGNS_BadMassUnit
CGNS_BadTemperatureUnit
CGNS_BadTimeUnit
  userdataread 
userdataread ( self,  id )

-Get name of the given user data id -User Data

(userdata-id:i,userdata-name:S)=userdataread(userdata-id:I)

Under current node.

  userdatawrite 
userdatawrite ( self,  name )

-Create a new userdata node -User Data

userdata-id:I=userdatawrite(userdata-name:S)

Under current node.

  ziterread 
ziterread (
        self,
        bid,
        zid,
        )

-Get the name of the iterative data zone -Iterative Data

name:S=ziterread(base-id:I,zone-id:I)

No Comment

  ziterwrite 
ziterwrite (
        self,
        bid,
        zid,
        name,
        )

-Create zone iterative data -Iterative Data

None=ziterwrite(base-id:I,zone-id:I,name:S)

No Comment

  zoneid 
zoneid (
        self,
        bid,
        zid,
        )

-Get the ADF id of a zone -undocumented MLL

zone-id:D=zoneid(base-id:I,zone-id:I)

See baseid remarks.

Exceptions   
CGNS_FileShouldBeReadable
  zoneread 
zoneread (
        self,
        bid,
        zid,
        )

-Get infos about a given zone -Zone

(base-id:I,zone-id:I,zone-name:S,size-tuple(I,...)=zoneread(base-id:I,zone-id:I)

The tuple returns a useful informatinos, including arguments ids. The dimension tuple size depends on the zone size. To get this tuple size, use the len function.

  zonetype 
zonetype (
        self,
        bid,
        zid,
        )

-Get the type of a given zone -Zone

zone-type:S=zonetype(base-id:I,zone-id:I)

The returned string can be used as entry key into ZoneType dictionnary, in order to get the actual integer value for the corresponding enumerate.

  zonewrite 
zonewrite (
        self,
        baseidx,
        name,
        szlist,
        zonetype,
        )

-Create a new zone -Zone

zone-id:I=zonewrite(base-id:I,zone-name:S,size-tuple:(I,...),zone-type:S)

See zonetype remarks.

Exceptions   
CGNS_BadZoneType, zonetype
ValueError

Table of Contents

This document was automatically generated on Fri Feb 27 13:12:59 2004 by HappyDoc version 2.0.1