(self)
| 9 | |
| 10 | class TestPlot3D(Testing.vtkTest): |
| 11 | def testReader3D(self): |
| 12 | names = [("multi-ascii.xyz", "multi-ascii.q"), ("multi-bin-C.xyz", "multi-bin-C.q"), ("multi-bin.xyz", "multi-bin.q"), ("multi-bin.xyz", "multi-bin-oflow.q")] |
| 13 | |
| 14 | for name in names: |
| 15 | r = vtkMultiBlockPLOT3DReader() |
| 16 | print("Testing ", name[0], name[1]) |
| 17 | if name[0] == "multi-ascii.xyz": |
| 18 | r.BinaryFileOff() |
| 19 | r.MultiGridOn() |
| 20 | else: |
| 21 | r.AutoDetectFormatOn() |
| 22 | r.SetFileName(VTK_DATA_ROOT + "/Data/" + name[0]) |
| 23 | r.SetQFileName(VTK_DATA_ROOT + "/Data/" + name[1]) |
| 24 | r.Update() |
| 25 | |
| 26 | output = r.GetOutput() |
| 27 | self.assertEqual(output.GetNumberOfBlocks(), 2) |
| 28 | |
| 29 | b0 = output.GetBlock(0) |
| 30 | self.assertEqual(int(b0.GetFieldData().GetArray("Properties").GetValue(0)), 2) |
| 31 | pd = b0.GetPointData() |
| 32 | self.assertEqual(int(pd.GetArray("Momentum").GetComponent(10, 2)), 0) |
| 33 | self.assertEqual(int(pd.GetArray("StagnationEnergy").GetValue(3)), 9) |
| 34 | |
| 35 | b1 = output.GetBlock(1) |
| 36 | self.assertEqual(int(b1.GetFieldData().GetArray("Properties").GetValue(0)), 2) |
| 37 | pd = b1.GetPointData() |
| 38 | self.assertEqual(int(pd.GetArray("Momentum").GetComponent(10, 2)), 0) |
| 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")] |
nothing calls this directly
no test coverage detected