############################################
#      CREATING CYLINDRICAL VECTOR DATA
############################################
VelocityVec = input0.PointData['Velocity'].Arrays[0]

CylVec = [radVec, thetaVec, zVec]
VectorDict = {
    "VelCyl": VelocityVec,
    "VelCylMean": VelMeanVec,
    "VelCylRMSE": VelRMSEVec
}

VectorCylDict = {}
for key in VectorDict.keys():
    VectorCylDict[key] = algs.make_vector(
        algs.dot(VectorDict[key], radVec), algs.dot(VectorDict[key], thetaVec),
        algs.dot(VectorDict[key], zVec))

###########################################
#        SPECIALIZED DATA OUTPUT
###########################################

# Dynamic Pressure
DynPres = algs.mag(VelocityVec)**2 * 0.5 * input0.PointData['Density'].Arrays[0]

###########################################
#            OUTPUTING DATA
###########################################

# Cylindrical Coordinate Points
output.PointData.append(radius, "r")
예제 #2
0
g2 = vtk.vtkMultiBlockDataGroupFilter()
g2.AddInputData(output)
g2.AddInputData(output)

g2.Update()

sphere = dsa.CompositeDataSet(g2.GetOutput())

vn = algs.vertex_normal(sphere)
compare(algs.mag(vn) - 1, 1E-6)

sn = algs.surface_normal(sphere)
compare(algs.mag(sn) - 1, 1E-6)

dot = algs.dot(vn, vn)
assert dot.DataSet is sphere
compare(dot - 1, 1E-6)
assert algs.all(algs.cross(vn, vn) == [0, 0, 0])

fd = sphere.FieldData['field array']
assert algs.all(fd == 5)
assert algs.shape(fd) == (22,)

assert vn.DataSet is sphere

# --------------------------------------

na = dsa.NoneArray

# Test operators
예제 #3
0
g2 = vtk.vtkMultiBlockDataGroupFilter()
g2.AddInputData(output)
g2.AddInputData(output)

g2.Update()

sphere = dsa.CompositeDataSet(g2.GetOutput())

vn = algs.vertex_normal(sphere)
assert algs.all(algs.mag(vn) - 1 < 1E-6)

sn = algs.surface_normal(sphere)
assert algs.all(algs.mag(sn) - 1 < 1E-6)

dot = algs.dot(vn, vn)
assert dot.DataSet is sphere
assert algs.all(dot == 1)
assert algs.all(algs.cross(vn, vn) == [0, 0, 0])

fd = sphere.FieldData['field array']
assert algs.all(fd == 5)
assert algs.shape(fd) == (22,)

assert vn.DataSet is sphere

# --------------------------------------

na = dsa.NoneArray

# Test operators