CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Paraview & paraFoam

Update data in ParaView

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 13, 2010, 17:01
Default Update data in ParaView
  #1
New Member
 
Join Date: Jul 2010
Posts: 8
Rep Power: 7
hpon is on a distinguished road
Hi,

How do I update the data in ParaView? I'm currently designing a mesh and I need to repeatedly update the visual representation in ParaView to check the results, and I'm hoping there is a convenient "update" button hidden somewhere.

/hpon
hpon is offline   Reply With Quote

Old   July 13, 2010, 18:19
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,488
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi hpon,

If I'm not mistaken, you are using the ParaView version that is provided with OpenFOAM for Ubuntu 10.04.

So, you will need 2 clicks:
  1. Click once in the check box "Update GUI" - once is enough to trigger the "Apply" button;
  2. Then click once in the Apply button.
And voilá! Mesh updated! Oh, I forgot, this will only work if your current selected item is the "case.OpenFOAM" entry in the "Pipeline Browser". If you have glyphs or streamlines derived from it, it should automatically reflect on them all!

And there is also a "Refresh Times" button, in case you want to keep up-to-date with a running simulation

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   July 14, 2010, 17:04
Default
  #3
New Member
 
Join Date: Jul 2010
Posts: 8
Rep Power: 7
hpon is on a distinguished road
Thank you Bruno,

You are correct, -that is the paraView version I am using. But strangely I cannot update the data the way you described.

The case which I have called "Spalt.OpenFoam" is highlighted. I click the "Update GUI" box to put a marker in it, and the "Apply" botton subsequently becomes green. I then click the "Apply" button. ...and nothing happens. If instead, I open an new instance of "Spalt.OpenFoam" I get the updated mesh.

Is there something else I need to do in order to make it work?

/hpon
hpon is offline   Reply With Quote

Old   July 14, 2010, 18:16
Default
  #4
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,488
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi hpon,

Sorry about that, I should have tested too before posting. It's simple nonetheless: uncheck the check box "Cache Mesh", and then you can use the "Update GUI" check box to induce a refresh!

"Cache Mesh" is quite useful for when you are seeing results from non dynamic meshes, but it doesn't do any good when you are running trial-and-error with mesh generation.


Oh, by the way, be careful when updating the mesh! If you try to update in ParaView while the mesh is being generated by the mesher, you might be able to make ParaView crash!

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   July 16, 2010, 04:07
Default
  #5
New Member
 
Join Date: Jul 2010
Posts: 8
Rep Power: 7
hpon is on a distinguished road
Perfect. Thank you!

/hpon
hpon is offline   Reply With Quote

Old   August 8, 2013, 04:07
Default any progress...?
  #6
New Member
 
Eric Lorenz
Join Date: Aug 2013
Location: Amsterdam, NL
Posts: 4
Rep Power: 4
elorenz is on a distinguished road
Hi,

Is there any progress in this matter? Has a generic "refresh data" button for every file reader finally found its way into a paraview release?

I find it outmost annoying that every time a new state has been written out by a running simulation, or the simulation has been restarted - which is 99% of all cases if you're a cfd developer, I need to start from scratch setting up all the filters and glyphs. Of course you can trace your setup and then modify the python script but I think a simple refresh button would be an immense improvement in usability. And I'm not the only one, a refresh button has been requested for so long and at so many places.

Maybe I'm missing something and simple solutions have been proposed already. Maybe it's in the latest release? I'm using 3.14.1 on ubuntu 12.04 64bit and I also have a version 3.12.0 that comes with OpenFoam (using (legacy) vtk data) and I'd say there's nothing.

Edit: This is the corresponding "bug report" http://paraview.org/Bug/view.php?id=7314 Seems that since 2010 no one ever looked into this again so it just expired????

Cheers,
Eric
elorenz is offline   Reply With Quote

Old   August 8, 2013, 04:38
Default
  #7
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 919
Rep Power: 17
akidess will become famous soon enough
Quote:
Originally Posted by elorenz View Post
I find it outmost annoying that every time a new state has been written out by a running simulation, or the simulation has been restarted - which is 99% of all cases if you're a cfd developer, I need to start from scratch setting up all the filters and glyphs.
Eric, starting from scratch was never neccessary. Just save the state file and reload it - voila, you're view is updated. It doesn't matter if the underlying data changed if you had loaded a *.foam file with the native reader. This saves you lots of work, but still isn't as comfortable, so the developers of paraview did add a reload button in the newest release (PV4) Still, start using the state files as this lets you continue work fairly seamlessly even after you close pv!
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
*Help define the OpenFOAM stackexchange Q&A site: http://area51.stackexchange.com/prop...oam-technology
akidess is offline   Reply With Quote

Old   August 8, 2013, 04:54
Default
  #8
New Member
 
Eric Lorenz
Join Date: Aug 2013
Location: Amsterdam, NL
Posts: 4
Rep Power: 4
elorenz is on a distinguished road
thanks fro your quick reply, akidess!

Using the state files is what I do when I have restarted the simulations (existing files are overwritten) but unfortunately it doesn't help when new data files are added to a time series. It seems that the state also fixes the list of files that belong to a series. It doesn't load all data.timestep*.vtk files.

So PV4 has a reload button now? Nice, will check it out!

Cheers,
Eric
elorenz is offline   Reply With Quote

Old   August 8, 2013, 05:07
Default
  #9
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 919
Rep Power: 17
akidess will become famous soon enough
Indeed, if you open vtk files thats true. However, if you create a *.foam file and load that the issue will disappear, i.e. it will also read time steps that were not there previously! It also spares you a call of foamToVTK.

- Anton
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
*Help define the OpenFOAM stackexchange Q&A site: http://area51.stackexchange.com/prop...oam-technology
akidess is offline   Reply With Quote

Old   August 8, 2013, 05:43
Default
  #10
New Member
 
Eric Lorenz
Join Date: Aug 2013
Location: Amsterdam, NL
Posts: 4
Rep Power: 4
elorenz is on a distinguished road
I've data in (legacy) vtk format only. I know this is the forum for OpenFOAM paraview, sorry, but this discussion thread was the one matching my problem best.

I've tried PV4 now and I see some changes but nothing like a "refresh/reload" button. Where would I have to look for it or what would be the way to trigger the reload?

Cheers,
Eric
elorenz is offline   Reply With Quote

Old   August 8, 2013, 05:54
Default
  #11
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 919
Rep Power: 17
akidess will become famous soon enough
Ok, that wasn't clear to me. It might be that the reload button is only available when using the OpenFOAM loader.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
*Help define the OpenFOAM stackexchange Q&A site: http://area51.stackexchange.com/prop...oam-technology
akidess is offline   Reply With Quote

Old   August 16, 2013, 21:10
Default
  #12
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,488
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings to all!

I do love a good challenge And managing to win the challenge is a nice feeling as well

A few hours ago I was playing around with ParaView, trying to hookup the position of a slice to a "python annotation" filter, which resulted in this: Slice origin as annotation in animation post #5


And now I've managed to figure out how to override the default XML Server Proxy options for the Legacy VTK Reader. The instructions are as follows:
  1. I used ParaView 4.0.1.
  2. Download the attached file "ModedFileSeriesLegacyReader.xml.zip" and unpack it wherever you want, although I advise you to keep the extracted file somewhere personal and permanent, such as inside the "Documents" folder.
  3. Start ParaView 4.0.1.
  4. Go to the menu "Tools -> Manage Plugins ...".
  5. In the dialogue window that just opened, click on "Load New".
  6. Another dialogue window appears for selecting the plugin. You first need to change the "Files of type" entry to "Server Manager XML (*.xml)" and only then browse to where you extracted the attached file.
  7. Select the file "ModedFileSeriesLegacyReader.xml" and click on the "OK"/"Open" button.
  8. On the first dialogue window for the plugins, the item "ModedFileSeriesLegacyReader" should now be listed and you should click on the + symbol and check the option "Auto Load", so that whenever ParaView starts, it should always use this modified plugin.
  9. You can now close this dialogue window for managing the plugins.
  10. Optional - You can now close ParaView.
  11. Now, whenever you have ParaView 4.0.1 running, you can open legacy VTK file series or just a single VTK file and have the two new controls shown in the attached picture. Namely:
    • the "Modified" button, which should reload the currently loaded time snapshot. Clicking more than once on this button can lead to pre-scheduled reloads; in other words, as soon as the file is modified, the data is reloaded without us clicking on the button. The other detail is that the reload is not instantaneous...
    • and the full file path to the currently loaded file, along with the ellipsis "..." button for browsing for another file or series of files.
References:

So, after reading this, my guess is that people will like ParaView a little bit more! Allowing users to hack into plugins without having to rebuild from source code, is a very big bonus!

Best regards,
Bruno


PS: I did spend some time chasing my own tail, because while I was investigating inside the file "readers.xml", I stopped looking at the "legacyreader" entry, which only provides the VTK reader for a single file. This is only accessible through the Python scripting "paraview.simple.LegacyVTKReader"... until I stumbled upon the "vtkFileSeriesReader" classes in the "readers.xml" and searched for the one for legacy VTK files... and BOOM, it's this post you've read above .
Attached Images
File Type: jpg Screenshot from 2013-08-17 01:55:43.jpg (47.3 KB, 97 views)
Attached Files
File Type: zip ModedFileSeriesLegacyReader.xml.zip (1.0 KB, 89 views)

Last edited by wyldckat; August 16, 2013 at 21:22. Reason: ellipsis, not ellipses
wyldckat is offline   Reply With Quote

Old   August 30, 2013, 05:06
Default Great!!!
  #13
New Member
 
Eric Lorenz
Join Date: Aug 2013
Location: Amsterdam, NL
Posts: 4
Rep Power: 4
elorenz is on a distinguished road
Hey wyldckat,

THANK YOU SO MUCH for this plugin!! It does exactly what's needed! Life is so much easier now!!! You're a hero!

For all users that don't read your post I hope your plugin will find its way into the next paraview release.

All the best,
Eric

PS: If you have some spare minutes in the future, a button that causes all data sets (time series) to be updated/reloaded in one go would be the icing on the cake
elorenz is offline   Reply With Quote

Old   August 31, 2013, 09:39
Default
  #14
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,488
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Eric,

This was kind of thing was suggest some time ago on the bug tracker, but unfortunately it was never implemented. In addition, the solution I gave on the previous post is just a hack, since the button seems to be out-of-place on the GUI :S

Quote:
Originally Posted by elorenz View Post
PS: If you have some spare minutes in the future, a button that causes all data sets (time series) to be updated/reloaded in one go would be the icing on the cake
Do you mean that you want to reload all VTK items that are open in the "Pipeline Browser"?
If so, that can easily be done with a macro:
  1. Place the following code inside a file named "RefreshAllVTKItems.py":
    Code:
    from paraview.simple import *
    
    for px in GetSources().values():
        if hasattr(px,'Modified'):
            px.Modified()
    
    Render()
  2. Save the file next to the other file from the previous post, just to keep things close to each other.
  3. Then in ParaView, in the "Macros" menu and select the menu entry "Add new macro". Browse to where you have the Python script created in step #1 and chosse that script file.
  4. Now, every time you need to refresh all, you should have a button named "RefreshAllVTKItems" in the "Macros" toolbar (menu "View -> Toolbars") or you you have the macros in the "Macros" menu, after the last horizontal separator.
Best regards,
Bruno

References:
wyldckat is offline   Reply With Quote

Old   July 17, 2014, 16:57
Default For VTU files or animations?
  #15
New Member
 
Join Date: Oct 2011
Posts: 1
Rep Power: 0
mnajafiyazdi is on a distinguished road
Does this plugin work for VTU files or animations saved with .pvd?
mnajafiyazdi is offline   Reply With Quote

Old   August 17, 2014, 12:17
Default
  #16
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,488
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings mnajafiyazdi and welcome (back) to the forum!

Quote:
Originally Posted by mnajafiyazdi View Post
Does this plugin work for VTU files or animations saved with .pvd?
I don't know Probably not.
But if you can provide one example file or a set of example files, I can have a look into this.

Furthermore, I suspect that the code and XML files above will not fully work with the latest ParaView 4.1.0

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   May 5, 2015, 03:36
Smile
  #17
New Member
 
rahulksoni's Avatar
 
Rahul Kumar Soni
Join Date: Oct 2013
Location: Bhubaneswar, India
Posts: 2
Rep Power: 0
rahulksoni is on a distinguished road
Thanks a lot Bruno, it worked like a charm

Quote:
Originally Posted by wyldckat View Post
Greetings to all!

I do love a good challenge And managing to win the challenge is a nice feeling as well

A few hours ago I was playing around with ParaView, trying to hookup the position of a slice to a "python annotation" filter, which resulted in this: Slice origin as annotation in animation post #5


And now I've managed to figure out how to override the default XML Server Proxy options for the Legacy VTK Reader. The instructions are as follows:
  1. I used ParaView 4.0.1.
  2. Download the attached file "ModedFileSeriesLegacyReader.xml.zip" and unpack it wherever you want, although I advise you to keep the extracted file somewhere personal and permanent, such as inside the "Documents" folder.
  3. Start ParaView 4.0.1.
  4. Go to the menu "Tools -> Manage Plugins ...".
  5. In the dialogue window that just opened, click on "Load New".
  6. Another dialogue window appears for selecting the plugin. You first need to change the "Files of type" entry to "Server Manager XML (*.xml)" and only then browse to where you extracted the attached file.
  7. Select the file "ModedFileSeriesLegacyReader.xml" and click on the "OK"/"Open" button.
  8. On the first dialogue window for the plugins, the item "ModedFileSeriesLegacyReader" should now be listed and you should click on the + symbol and check the option "Auto Load", so that whenever ParaView starts, it should always use this modified plugin.
  9. You can now close this dialogue window for managing the plugins.
  10. Optional - You can now close ParaView.
  11. Now, whenever you have ParaView 4.0.1 running, you can open legacy VTK file series or just a single VTK file and have the two new controls shown in the attached picture. Namely:
    • the "Modified" button, which should reload the currently loaded time snapshot. Clicking more than once on this button can lead to pre-scheduled reloads; in other words, as soon as the file is modified, the data is reloaded without us clicking on the button. The other detail is that the reload is not instantaneous...
    • and the full file path to the currently loaded file, along with the ellipsis "..." button for browsing for another file or series of files.
References:

So, after reading this, my guess is that people will like ParaView a little bit more! Allowing users to hack into plugins without having to rebuild from source code, is a very big bonus!

Best regards,
Bruno


PS: I did spend some time chasing my own tail, because while I was investigating inside the file "readers.xml", I stopped looking at the "legacyreader" entry, which only provides the VTK reader for a single file. This is only accessible through the Python scripting "paraview.simple.LegacyVTKReader"... until I stumbled upon the "vtkFileSeriesReader" classes in the "readers.xml" and searched for the one for legacy VTK files... and BOOM, it's this post you've read above .
rahulksoni is offline   Reply With Quote

Old   May 6, 2015, 00:04
Exclamation
  #18
New Member
 
rahulksoni's Avatar
 
Rahul Kumar Soni
Join Date: Oct 2013
Location: Bhubaneswar, India
Posts: 2
Rep Power: 0
rahulksoni is on a distinguished road
Quote:
Originally Posted by rahulksoni View Post
Thanks a lot Bruno, it worked like a charm
Hi Bruno

Your xml plugin is really helpful, making life easier. As a result of plugin, I get a button 'modified' and a link to update the individual file series. However, if multiple series of files are there (vtk for geometry, vtk for particles etc.) then one has to update them one by one. Can you add some piece of code that can update things with a single click.
rahulksoni is offline   Reply With Quote

Old   May 10, 2015, 14:55
Default
  #19
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,488
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Quote:
Originally Posted by rahulksoni View Post
Can you add some piece of code that can update things with a single click.
Quick answer: Did you see post #14?
wyldckat 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
Paraview: Cell data and Point Data? vitor OpenFOAM Paraview & paraFoam 4 May 15, 2015 17:56
export data from paraview lions85 OpenFOAM 4 June 2, 2011 13:33
extracting data from paraview tharem OpenFOAM Paraview & paraFoam 1 January 18, 2011 00:45
Visualize Star-CCM+ data in Paraview peresah STAR-CCM+ 0 January 14, 2010 11:52
paraFoam reader for OpenFOAM 1.6 smart OpenFOAM Installation 13 November 16, 2009 22:41


All times are GMT -4. The time now is 03:24.