Exemplo n.º 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.cgnserrors as E
import CGNS.PAT.cgnskeywords as K
import numpy as N

data = C.newZone(None, '{Zone}',
                 N.array([[5, 4, 0], [7, 7, 0], [9, 8, 0]], order='F'))

g1 = C.newGridCoordinates(data, "GridCoordinates")
C.newRigidGridMotion(data, "{RigidGridMotion}")
C.newArbitraryGridMotion(data, "{ArbitraryGridMotion}")
C.newFlowSolution(data, "{FlowSolution}")
C.newDiscreteData(data, "{DiscreteData}")
C.newIntegralData(data, "{IntegralData}")
C.newZoneGridConnectivity(data, "{GridConnectivity}")
C.newBoundary(data, "{BC}", N.array([[0, 0, 0], [0, 0, 0]]))
C.newZoneIterativeData(data, "{ZoneIterativeData}")
C.newReferenceState(data)
C.newRotatingCoordinates(data)
C.newDataClass(data)
C.newDimensionalUnits(data)
C.newFlowEquationSet(data)
C.newConvergenceHistory(data, K.ZoneConvergenceHistory_s)
C.newUserDefinedData(data, '{UserDefinedData}')
C.newDescriptor(data, '{Descriptor}')
Exemplo n.º 2
0
c = CGL.newBCData(s, CGK.Dirichlet_s)
d = CGL.newDataClass(c, CGK.NondimensionalParameter_s)
r = CGL.newReferenceState(b)
d = CGL.newDataClass(r, CGK.NondimensionalParameter_s)
a = CGL.newAxisymmetry(b)
d = CGL.newDataClass(a, CGK.NondimensionalParameter_s)
a = CGL.newRotatingCoordinates(b)
d = CGL.newDataClass(a, CGK.NondimensionalParameter_s)
a = CGL.newDiscreteData(z, '{DiscreteData}')
d = CGL.newDataClass(a, CGK.NondimensionalParameter_s)
i = CGL.newBaseIterativeData(b, '{BaseIterativeData}')
d = CGL.newDataClass(i, CGK.NondimensionalParameter_s)
i = CGL.newZoneIterativeData(z, '{ZoneIterativeData}')
d = CGL.newDataClass(i, CGK.NondimensionalParameter_s)
m = CGL.newRigidGridMotion(z,
                           '{RigidGridMotion}',
                           vector=NPY.array([[0.0, 0.0], [0.0, 0.0],
                                             [0.0, 0.0]]))
d = CGL.newDataClass(m, CGK.NondimensionalParameter_s)
m = CGL.newArbitraryGridMotion(z, '{ArbitraryGridMotion}')
d = CGL.newDataClass(m, CGK.NondimensionalParameter_s)
x = CGL.newZoneGridConnectivity(z)
x = CGL.newGridConnectivity(x, '{GridConnectivity}', z[0])
CGL.newPointRange(x,
                  value=NPY.array([[1, 1], [1, 1], [1, 1]],
                                  dtype=NPY.int32,
                                  order='Fortran'))
p = CGL.newGridConnectivityProperty(x)
m = CGL.newPeriodic(p)
d = CGL.newDataClass(m, CGK.NondimensionalParameter_s)
w = CGL.newConvergenceHistory(b)
d = CGL.newDataClass(w, CGK.NondimensionalParameter_s)