【正文】
1 for vector magnitude Readers ? Available in the submodule ? Specify the filename (or filenames) using the FileName or FileNames parameter ? Readers may provides options to select which attribute arrays to load ? Soon a method will be available to create choose a reader give the filename. Currently, user has to select which reader to create to read the file Common Readers Reader File Format Description PVDReader *.pvd ParaView Data Files XMLUnstructuredGridReader *.vtu VTK unstructured grid files (xml) XMLPUnstructuredGridReader *.pvtu Parallel VTK unstructured grid files (xml) LegacyVTKFileReader *.vtk Legacy VTK files Ensight *.case EnSight files ExodusIIReader *.ex2, exo .. Exodus files Extensive readers list: Reading a *.vtk file () Create the reader and set the filename. reader = (FileNames=filename) view = () repr = (reader, view) () dataInfo = () pointDataInfo = () arrayInfo = (displacement9) if arrayInfo: range = (1) get the range for the magnitude of displacement9 lut = () = [range[0], , , , range[1], , , ] = Magnitude = lut = displacement9 = POINT_DATA Reading a file series () filenames = […] reader = (FileNames=filenames) warpVector = (Input=reader) [4] = displacement view = () repr = (warpVector, view) This is a helper function to animate over the timesteps provided by the reader. (reader, view) Read an Exodus file () ? Create reader reader = () = “…/” ? Update the reader information: causes the reader to read metadata from the file () ? List available point arrays Property name= PointResultArrayInfo value=[?DISPL?, ?0?, ?VEL?, ?0?, ?ACCL?, ?0?] ? Turn on a few arrays = [?DISPL?, ?1?, ?VEL?, ?1?] Datasets with Time ? Readers which provide timesupport have TimestepValues parameter Property name= TimestepValues value = [, , , ...] ? To request a particular time ? (time) can be used to force the pipeline to update with the given time ? View has a ViewTime parameter which is the time the view will request from all visible pipelines Animating through available time steps reader = (…) … tsteps = for cur_time in tsteps: = cur_time () () ? AnimateReader() can be used to animate through time steps. If optional filename is specified then the animation will be saved out as an avi or a series of images. (reader, view, “c:/temp/”) Writers ? Available in submodule. ? Name of the file to write is specified using FileName attribute. ? Writers may provide additional attributes eg. DataMode to write ASCII or binary files etc. ? Similar to readers, we will soon add API to automatically choose the writer based on the file extension specified. Common Writers Reader File Format Description PVDWriter *.pvd ParaView Data Files XMLUnstructuredGridWriter *.vtu VTK unstructured grid files (xml) XMLPUnstructuredGridWriter *.pvtu Parallel VTK unstructured grid files (xml) DataSetWriter *.vtk Legacy VTK files ExodusIIWriter *.ex2, exo.. Exodus files Extensive writers list: Writing a file series () Essential to call UpdatePipelineInformation() so that reader reads me