[Paraview] Getting File Names from PVD File

Nahshon, Ken Dr. CIV NSWCCD West Bethesda MD, 664 ken.nahshon at navy.mil
Wed Feb 25 09:30:07 EST 2015


Utkarsh,
Thank you for your reply. I realize I can open the .pvtr or .pvt files directly and parse the time data from the .pvd file but that is a round-about way of doing things. What I am looking for is how to return, within the Python Paraview shell, the 'file' attribute of the .pvd file I have open. Unfortunately, I can only locate the attribute containing the filename of the .pvd file itself. 
Best,
Ken

-----Original Message-----
From: Utkarsh Ayachit [mailto:utkarsh.ayachit at kitware.com] 
Sent: Wednesday, February 25, 2015 9:23 AM
To: Nahshon, Ken Dr. CIV NSWCCD West Bethesda MD, 664
Cc: paraview at paraview.org
Subject: Re: [Paraview] Getting File Names from PVD File

Ken,

> I am trying to recover the file names of the .vtu files that are contained within a .pvd XML file that I am reading in. I am only able to see the timestep data and file name of the PVD itself. Does anyone know where the file= attribute located in the .pvd file stored within Paraview?

The files are placed in the path indicated by the 'file" attribute relative to the location of the pvd file itself.

> Ultimately I am trying to read in a series of .pvtr files (pointing to vtr files) and export the data as a series of Exodus files with one .e file per timestep. Trying to generate one big .e file directly generates an error due to what appears to be a format error (I assume from the lack of timestep associated the core data beyond the pvd file). Any advice would be appreciated.

You should try using the Python scripting API to open the files and write them out. Something like this could work:

for i in range(100):
   r  = OpenDataFile("foo_%s..." % i)
   UpdatePipeline(r)
   SaveData("foo_%s.e" % i, r)
   Delete(r)

Utkarsh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5602 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview/attachments/20150225/8928fcf8/attachment.bin>


More information about the ParaView mailing list