pttype=CGK.PointList_s) g = CGL.newGridLocation(n, value=CGK.FaceCenter_s) TESTS.append((tag, T, diag)) # ------------------------------------------------------------------------- tag = 'indexarray InwardNormalList' diag = True (T, b, z, zbc) = makeCorrectTree(vertexsize, cellsize) n = CGL.newBoundary(zbc, 'BC', [range(1, cellsize + 1)], btype=CGK.Null_s, family=None, pttype=CGK.PointList_s) g = CGL.newGridLocation(n, value=CGK.CellCenter_s) inl = CGL.newIndexArray(n, CGK.InwardNormalList_s, value=NPY.ones([3, cellsize])) TESTS.append((tag, T, diag)) # ------------------------------------------------------------------------- tag = 'indexarray InwardNormalList bad shape #1' diag = False (T, b, z, zbc) = makeCorrectTree(vertexsize, cellsize) n = CGL.newBoundary(zbc, 'BC', [range(1, cellsize + 1)], btype=CGK.Null_s, family=None, pttype=CGK.PointList_s) g = CGL.newGridLocation(n, value=CGK.CellCenter_s) inl = CGL.newIndexArray(n, CGK.InwardNormalList_s,
# --------------------------------------------------------------------------- # 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.newBC(None, "{BC}") C.newIndexArray(data, K.InwardNormalList_s) C.newReferenceState(data) C.newDataClass(data) C.newDimensionalUnits(data) C.newUserDefinedData(data, '{UserDefinedData}') C.newDescriptor(data, '{Descriptor}') C.newOrdinal(data) # status = '9.3' comment = 'Full SIDS with all optionals' pattern = [data, status, comment] #
b[2].append(z4) z = [z1, z2, z3, z4] return (T, b, z) (T, b, z) = makeCorrectTree() zgc = CGL.newZoneGridConnectivity(z[0]) gc = CGL.newGridConnectivity(zgc, 'join1_3', 'Zone3', ctype=CGK.Abutting1to1_s) CGL.newPointRange(gc, value=NPY.array([[1, 1], [1, 7], [1, 9]], order='F')) CGL.newPointRange(gc, name=CGK.PointRangeDonor_s, value=NPY.array([[1, 1], [1, 7], [1, 9]], order='F')) gc = CGL.newGridConnectivity(zgc, 'join1_2', 'Zone2', ctype=CGK.Abutting1to1_s) CGL.newPointRange(gc, value=NPY.array([[1, 5], [1, 1], [1, 9]], order='F')) CGL.newIndexArray(gc, CGK.PointListDonor_s, value=NPY.array([range(cellsize + 1, cellsize + ntris + 1)], order='F')) CGL.newGridLocation(gc, value=CGK.FaceCenter_s) TESTS.append((tag, T, diag)) # ------------------------------------------------------------------------- tag = 'gridconnectivity bad datatype' diag = False (T, b, z) = makeCorrectTree() zgc = CGL.newZoneGridConnectivity(z[0]) gc = CGL.newGridConnectivity(zgc, 'join1_2', 'Zone2', ctype=CGK.Abutting1to1_s) CGL.newPointRange(gc, value=NPY.array([[1, 5], [1, 1], [1, 9]], order='F')) CGL.newIndexArray(gc, CGK.PointListDonor_s, value=NPY.array([range(cellsize + 1, cellsize + ntris + 1)], order='F'))
z, 'TRIS', CGK.TRI_3_s, NPY.ones((ntris * 3), dtype='int32'), NPY.array([[cellsize + 1, cellsize + ntris]], 'i', order='F')) tris[1][1] = ntris zbc = CGL.newZoneBC(z) n = CGL.newBoundary(zbc, 'BC', [range(cellsize + 1, cellsize + ntris + 1)], btype=CGK.Null_s, family=None, pttype=CGK.PointList_s) g = CGL.newGridLocation(n, value=CGK.FaceCenter_s) z2 = CGU.copyNode(z, 'Zone2') b[2].append(z2) zgc = CGL.newZoneGridConnectivity(z) gc = CGL.newGridConnectivity(zgc, 'join1_2', 'Zone2', ctype=CGK.Abutting1to1_s) CGL.newIndexArray(gc, CGK.PointList_s, value=NPY.array([range(cellsize + 2, cellsize + ntris)], order='F')) CGL.newIndexArray(gc, CGK.PointListDonor_s, value=NPY.array([range(cellsize + 2, cellsize + ntris)], order='F')) CGL.newGridLocation(gc, value=CGK.FaceCenter_s) zgc = CGL.newZoneGridConnectivity(z2) gc = CGL.newGridConnectivity(zgc, 'join2_1', 'Zone', ctype=CGK.Abutting1to1_s) CGL.newIndexArray(gc, CGK.PointList_s, value=NPY.array([range(cellsize + 2, cellsize + ntris)], order='F')) CGL.newIndexArray(gc, CGK.PointListDonor_s, value=NPY.array([range(cellsize + 2, cellsize + ntris)],