MCPcopy Create free account
hub / github.com/Kitware/VTK / testReader2D

Method testReader2D

IO/Geometry/Testing/Python/Plot3D.py:41–65  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

39 self.assertEqual(int(pd.GetArray("StagnationEnergy").GetValue(3)), 3)
40
41 def testReader2D(self):
42 names = [("multi-bin-2D.xyz", "multi-bin-2D.q")]
43
44 for name in names:
45 r = vtkMultiBlockPLOT3DReader()
46 print("Testing ", name[0])
47 r.AutoDetectFormatOn()
48 r.SetFileName(VTK_DATA_ROOT + "/Data/" + name[0])
49 r.SetQFileName(VTK_DATA_ROOT + "/Data/" + name[1])
50 r.Update()
51
52 output = r.GetOutput()
53 self.assertEqual(output.GetNumberOfBlocks(), 2)
54
55 b0 = output.GetBlock(0)
56 self.assertEqual(int(b0.GetFieldData().GetArray("Properties").GetValue(0)), 2)
57 pd = b0.GetPointData()
58 self.assertEqual(int(pd.GetArray("Momentum").GetComponent(10, 2)), 0)
59 self.assertEqual(int(pd.GetArray("StagnationEnergy").GetValue(3)), 9)
60
61 b1 = output.GetBlock(1)
62 self.assertEqual(int(b1.GetFieldData().GetArray("Properties").GetValue(0)), 2)
63 pd = b1.GetPointData()
64 self.assertEqual(int(pd.GetArray("Momentum").GetComponent(10, 2)), 0)
65 self.assertEqual(int(pd.GetArray("StagnationEnergy").GetValue(3)), 1)
66
67 def testMetaReader(self):
68 r = vtkPlot3DMetaReader()

Callers

nothing calls this directly

Calls 13

SetQFileNameMethod · 0.80
GetBlockMethod · 0.80
printFunction · 0.50
SetFileNameMethod · 0.45
UpdateMethod · 0.45
GetOutputMethod · 0.45
GetNumberOfBlocksMethod · 0.45
GetValueMethod · 0.45
GetArrayMethod · 0.45
GetFieldDataMethod · 0.45
GetPointDataMethod · 0.45

Tested by

no test coverage detected