CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > ParaView

Question about VTK Format, Time and ParaView

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree4Likes
  • 1 Post By wyldckat
  • 1 Post By ngj
  • 2 Post By ngj

Reply
 
LinkBack Thread Tools Display Modes
Old   April 5, 2013, 05:20
Default Question about VTK Format, Time and ParaView
  #1
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Rotterdam, The Netherlands
Posts: 1,595
Rep Power: 24
ngj will become famous soon enoughngj will become famous soon enough
Dear all,

I am working on a small conversion tool for a specific mesh type in OF into VTK format (UNSTRUCTURED_GRID). The file names are given a name and a incrementing index, though, I would also like to be able to put a string with the actual time in animations, etc.

Therefore, I have added this part into the VTK file:

Code:
FIELD FieldData 1
TIME 1 1 double
204.0048
and this makes it possible for me to see this variable in the Information tab in ParaView.

My question is how I can get this data in a string in paraview, i.e. similar to the Annotate Time filter, though, this does not work on my case. I have uploaded a small VTK sample for your convenience here:

http://www.student.dtu.dk/~ngja/vtkSample.tar.gz

Thank you for your attention,

Niels
ngj is online now   Reply With Quote

Old   April 7, 2013, 11:55
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,258
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Niels,

I gave it a few shots in ParaView and Googled around to check on this topic... and I think I've seen where you've gotten this idea: http://www.visitusers.org/index.php?...e_in_VTK_files

Problem is that this specific time information is something that VisIt implemented:
Quote:
Since VTK files do not have a specific construct for doing so, VisIt implements a convention where CYCLE and TIME values can be added as FieldData in the file.
If you do switch to VisIt, I think you should move the time information closer to the beginning of the file:
Code:
# vtk DataFile Version 2.0
faMesh
ASCII
DATASET UNSTRUCTURED_GRID
FIELD FieldData 1
TIME 1 1 double
204.0028
POINTS 1763 float
Because the wiki page clearly states that:
Quote:
Pay attention that the field data comes right after the DATASET type in the VTK file.
If you do want time associated with your VTK files, you'll have to use the XML version of VTK files, as presented here: http://paraview.org/Wiki/images/2/20...n-ParaView.ppt

Best regards,
Bruno
ngj likes this.
wyldckat is offline   Reply With Quote

Old   April 7, 2013, 16:22
Default
  #3
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Rotterdam, The Netherlands
Posts: 1,595
Rep Power: 24
ngj will become famous soon enoughngj will become famous soon enough
Hi Bruno,

Thank you very much. This have given me some directions to work with. Most appreciated.

Kind regards,

Niels
ngj is online now   Reply With Quote

Old   December 17, 2013, 10:05
Default
  #4
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Rotterdam, The Netherlands
Posts: 1,595
Rep Power: 24
ngj will become famous soon enoughngj will become famous soon enough
Good afternoon,

I wanted to follow up on this. I finally had the time to re-visit the time stamp for VTK files in ParaView, and the hint by Bruno worked beautifully. Now, I merely have to clean up my code (a lot).

Thanks again,

Niels
wyldckat likes this.
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is online now   Reply With Quote

Old   July 12, 2014, 18:07
Default
  #5
New Member
 
Bruno Bellier
Join Date: Jul 2014
Posts: 2
Rep Power: 0
brun is on a distinguished road
Hello,
I am very interesting by using the time in a VTK file but I don't succeed to do that yet.

Is-it possible to give me a sample ?

Thank you in advance.
brun is offline   Reply With Quote

Old   July 13, 2014, 06:32
Default
  #6
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Rotterdam, The Netherlands
Posts: 1,595
Rep Power: 24
ngj will become famous soon enoughngj will become famous soon enough
Good morning,

Yes, please find an example attached to this post. All you need to do is to open the file collection.pvd in paraFoam/paraView and you are set. You see a deforming sand bed and the VTK-format is for the faMesh of my computational domain. Now you will be able to insert the "Time Annotation", and it will change the time, when you go through the indices.

The writer itself, however, utilises some code, which we have decided to keep in-house for the moment, so I can unfortunately not share the code itself.

One thing, which I was unsuccessful in doing, was to write in binary format, so if you get around to understand the formatting of the *vtp files in binary, please share your knowledge.

Kind regards,

Niels
Attached Files
File Type: gz faMeshVTK.tar.gz (39.0 KB, 24 views)
wyldckat and brun like this.
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is online now   Reply With Quote

Old   July 13, 2014, 13:02
Default
  #7
New Member
 
Bruno Bellier
Join Date: Jul 2014
Posts: 2
Rep Power: 0
brun is on a distinguished road
Ok Thank you, don't worry I have yet done the Writer is yet done. I wanted to improve it and thank to you I will succeed.

For the binary file I don't use it because I have to read data in the text file if I want. good lucke
brun is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Legacy VTK for time dependent variables. Splatzo ParaView 1 February 22, 2013 05:02
pisoFoam with k-epsilon turb blows up - Some questions Heroic OpenFOAM Running, Solving & CFD 26 December 17, 2012 04:34
paraview ignores SPACING in STRUCTURED_POINTS vtk data? jaffar ParaView 0 November 27, 2012 10:36
AMI speed performance danny123 OpenFOAM 19 October 24, 2012 07:44
paraFoam reader for OpenFOAM 1.6 smart OpenFOAM Installation 13 November 16, 2009 22:41


All times are GMT -4. The time now is 13:51.