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

#
#
data = C.newArbitraryGridMotion(None, '{ArbitraryGridMotion}')
C.newRind(data, N.array([0, 0, 0, 0, 1, 1]))
C.newGridLocation(data)
C.newDataArray(data, K.GridVelocityX_s)
C.newDataArray(data, K.GridVelocityY_s)
C.newDataArray(data, K.GridVelocityZ_s)
C.newDataClass(data)
C.newDimensionalUnits(data)
C.newUserDefinedData(data, '{UserDefinedData}')
C.newDescriptor(data, '{Descriptor}')
#
status = '11.3'
comment = 'Full SIDS with all optionals'
pattern = [data, status, comment]
#
예제 #2
0
    return (T, b, z)


vertexsize = [5, 7, 9]
cellsize = [i - 1 for i in vertexsize]
(T, b, z) = makeStTree(vertexsize, cellsize)
sol1 = CGL.newFlowSolution(z, name='sol1', gridlocation=CGK.Vertex_s)
CGL.newDataArray(sol1,
                 'var',
                 value=NPY.ones(tuple(vertexsize), dtype='float64', order='F'))
sol2 = CGL.newFlowSolution(z, name='sol2', gridlocation=CGK.CellCenter_s)
CGL.newDataArray(sol2,
                 'var',
                 value=NPY.ones(tuple(cellsize), dtype='float64', order='F'))
sol3 = CGL.newFlowSolution(z, name='sol3', gridlocation=CGK.Vertex_s)
CGL.newRind(sol3, NPY.ones(2 * 3, dtype='int32', order='F'))
dsize = [i + 1 + 1 for i in vertexsize]
CGL.newDataArray(sol3,
                 'var',
                 value=NPY.ones(tuple(dsize), dtype='float64', order='F'))
sol4 = CGL.newFlowSolution(z, name='sol4', gridlocation=CGK.CellCenter_s)
CGL.newRind(sol4, NPY.ones(2 * 3, dtype='int32', order='F'))
dsize = [i + 1 + 1 for i in cellsize]
CGL.newDataArray(sol4,
                 'var',
                 value=NPY.ones(tuple(dsize), dtype='float64', order='F'))
TESTS.append((tag, T, diag))

#  -------------------------------------------------------------------------
tag = 'flowsolution bad dataarray dim'
diag = False