示例#1
0
#  ---------------------------------------------------------------------------
#  pyCGNS - Python package for CFD General Notation System -
#  See license.txt file in the root directory of this Python module source
#  ---------------------------------------------------------------------------
#
import CGNS.PAT.cgnslib as C
import CGNS.PAT.cgnserrors as E
import CGNS.PAT.cgnskeywords as K
import numpy as N

#
data = C.newDataArray(None, '{DataArray}')
C.newDataClass(data)
C.newDimensionalUnits(data)
C.newDimensionalExponents(data)
C.newDataConversion(data)
C.newDescriptor(data, '{Descriptor}')
#
status = '7.1'
comment = 'Full SIDS with all optionals'
pattern = [data, status, comment]
#
示例#2
0
#  ---------------------------------------------------------------------------
#  pyCGNS - Python package for CFD General Notation System -
#  See license.txt file in the root directory of this Python module source
#  ---------------------------------------------------------------------------
#
import CGNS.PAT.cgnslib as C
import CGNS.PAT.cgnserrors as E
import CGNS.PAT.cgnskeywords as K
import numpy as N

#
data = C.newDimensionalExponents(None)
C.newRind(data, N.array([0, 0, 0, 0, 1, 1]))
C.newDataClass(data)
C.newDimensionalUnits(data)
C.newUserDefinedData(data, '{UserDefinedData}')
C.newDescriptor(data, '{Descriptor}')
#
status = '4.4'
comment = 'Full SIDS with all optionals'
pattern = [data, status, comment]
#
示例#3
0
b = CGL.newBase(T, '{Base}', 3, 3)
d = CGL.newFamily(b, '{Family}')
z = CGL.newZone(b, '{Zone}',
                NPY.array([[5, 4, 0], [7, 6, 0], [9, 8, 0]], order='F'))
g = CGL.newGridCoordinates(z, CGK.GridCoordinates_s)
w = CGL.newDataArray(g, CGK.CoordinateX_s,
                     NPY.ones((5, 7, 9), dtype='float64', order='F'))
w = CGL.newDataArray(g, CGK.CoordinateY_s,
                     NPY.ones((5, 7, 9), dtype='float64', order='F'))
w = CGL.newDataArray(g, CGK.CoordinateZ_s,
                     NPY.ones((5, 7, 9), dtype='float64', order='F'))
f = CGL.newFlowSolution(z)
a = CGL.newDataArray(f,
                     '{DataArray}',
                     value=NPY.ones((4, 6, 8), dtype='float64', order='F'))
d = CGL.newDimensionalExponents(a)
TESTS.append((tag, T, diag))

#  -------------------------------------------------------------------------
tag = 'dimensionalunits without dataclass'
diag = False
T = CGL.newCGNSTree()
b = CGL.newBase(T, '{Base}', 3, 3)
d = CGL.newFamily(b, '{Family}')
z = CGL.newZone(b, '{Zone}',
                NPY.array([[5, 4, 0], [7, 6, 0], [9, 8, 0]], order='F'))
g = CGL.newGridCoordinates(z, CGK.GridCoordinates_s)
w = CGL.newDataArray(g, CGK.CoordinateX_s,
                     NPY.ones((5, 7, 9), dtype='float64', order='F'))
w = CGL.newDataArray(g, CGK.CoordinateY_s,
                     NPY.ones((5, 7, 9), dtype='float64', order='F'))