2 if not ('servermanager' in dir()):
7 def demo8(fname, impth):
8 """This method demonstrates the Glyph filter."""
10 reader = ExodusIIReader(FileName=fname)
13 camera = GetActiveCamera()
14 camera.SetPosition(0, 5, -45)
17 #Change the can to be wireframe so we can see the glyphs
18 dp1 = GetDisplayProperties(reader, view=v)
19 dp1.Representation = 'Wireframe'
20 glyphFilter = Glyph(reader)
22 #We won't see much if we don't move forward in the animation a little bit
23 tsteps = reader.TimestepValues
25 v.ViewTime = tsteps[20]
27 ## ['POINTS', 'DISPL']
29 #Set the glyphs to use the acceleration vectors and adjust scale factor
30 glyphFilter.Vectors = 'ACCL'
31 ##glyphFilter.GetScaleFactor
33 glyphFilter.SetScaleFactor = 0.0000002
37 WriteImage(filename = (impth + "glyphFilter_1.png"), view=v, Magnification=2)
39 #Set the glyphs to use the velocity vectors and adjust scale factor
40 glyphFilter.Vectors = 'VEL'
41 glyphFilter.SetScaleFactor = 3e-4
44 dp2 = GetDisplayProperties(glyphFilter)
45 glyphFilter.PointData[:]
46 ##[Array: PedigreeNodeId, Array: DISPL, Array: VEL, Array: ACCL, Array: GlobalNodeId, Array: GlyphVector]
48 #We'll color by velocity so use that array.
49 vel = glyphFilter.PointData[2]
54 ##(-2479.9521484375, 1312.5040283203125)
55 dp2.LookupTable = MakeBlueToRedLT(-2479.9521,1312.5)
56 dp2.ColorAttributeType = 'POINT_DATA'
57 dp2.ColorArrayName = 'VEL'
59 WriteImage(filename = (impth + "glyphFilter_2.png"), view=v, Magnification=2)
61 testdir = os.getenv("TESTDIR")
62 pvdata = os.getenv("PVDATA")
64 if __name__ == "__main__":
65 demo8(fname=pvdata+"/Data/can.ex2", impth=testdir+"/Pic/")