PVDReader#
- class PVDReader(*args, **kwargs)[source]#
PVD Reader for .pvd files.
Reading a time point returns a
pyvista.MultiBlock, even when it contains only one dataset. This differs from ParaView, which returns the dataset directly for PVD files with one dataset per time point. Index the returned blocks to access an individual dataset. Selecting the first block does not combine multiple blocks.
Examples#
Download Python source code | Download Jupyter notebook
>>> import pyvista as pv
>>> from pyvista import examples
>>> from pathlib import Path
>>> filename = examples.download_wavy(load=False)
>>> Path(filename).name
'wavy.pvd'
>>> reader = pv.get_reader(filename)
>>> reader.time_values
[0.0, 1.0, 2.0, 3.0, ... 12.0, 13.0, 14.0]
>>> reader.set_active_time_point(5)
>>> reader.active_time_value
5.0
>>> blocks = reader.read()
>>> blocks.n_blocks
1
>>> mesh = blocks[0]
>>> isinstance(mesh, pv.StructuredGrid)
True
>>> mesh.plot(scalars='z')
Used In#
API Examples
download_dual_sphere_animation(1 use)download_single_sphere_animation(1 use)
Inheritance#
Inherited members are documented on BaseReader, _FileIOBase, TimeReader.
See them all under Inherited Attributes and Inherited Methods.
Attributes#
Return all active datasets. |
|
Return the active readers. |
|
Active time or iteration value. |
|
Return all datasets. |
|
Return number of time points or iterations available to read. |
|
All time or iteration values. |
Inherited Attributes#
Return mapping from regex pattern matching associated with this class. |
|
Return the file extensions associated with this class. |
|
Return or set the filename or directory of the reader. |
|
Return the vtk Reader object. |
Methods#
|
Set active time or iteration by index. |
|
Set active time or iteration value. |
|
Value of time point or iteration by index. |
Inherited Methods#
Hide the progress bar when loading the file. |
|
Read data in file. |
|
Show a progress bar when loading the file. |