CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[OpenFOAM] Update data in ParaView

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 13, 2010, 18:01
Default Update data in ParaView
  #1
New Member
 
Join Date: Jul 2010
Posts: 8
Rep Power: 16
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, 19:19
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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, 18:04
Default
  #3
New Member
 
Join Date: Jul 2010
Posts: 8
Rep Power: 16
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, 19:16
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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, 05:07
Default
  #5
New Member
 
Join Date: Jul 2010
Posts: 8
Rep Power: 16
hpon is on a distinguished road
Perfect. Thank you!

/hpon
hpon is offline   Reply With Quote

Old   August 8, 2013, 05:07
Default any progress...?
  #6
New Member
 
Eric Lorenz
Join Date: Aug 2013
Location: Amsterdam, NL
Posts: 4
Rep Power: 13
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, 05:38
Default
  #7
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
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.
akidess is offline   Reply With Quote

Old   August 8, 2013, 05:54
Default
  #8
New Member
 
Eric Lorenz
Join Date: Aug 2013
Location: Amsterdam, NL
Posts: 4
Rep Power: 13
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, 06:07
Default
  #9
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
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.
akidess is offline   Reply With Quote

Old   August 8, 2013, 06:43
Default
  #10
New Member
 
Eric Lorenz
Join Date: Aug 2013
Location: Amsterdam, NL
Posts: 4
Rep Power: 13
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, 06:54
Default
  #11
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
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.
akidess is offline   Reply With Quote

Old   August 16, 2013, 22:10
Default
  #12
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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: http://www.cfd-online.com/Forums/par...tml#post446231 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, 170 views)
Attached Files
File Type: zip ModedFileSeriesLegacyReader.xml.zip (1.0 KB, 147 views)
Nucleophobe likes this.
__________________

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

Old   August 30, 2013, 06:06
Default Great!!!
  #13
New Member
 
Eric Lorenz
Join Date: Aug 2013
Location: Amsterdam, NL
Posts: 4
Rep Power: 13
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, 10:39
Default
  #14
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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, 17: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, 13:17
Default
  #16
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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, 04:36
Smile
  #17
Member
 
rahulksoni's Avatar
 
Rahul Kumar Soni
Join Date: Oct 2013
Location: Bhubaneswar, India
Posts: 68
Rep Power: 13
rahulksoni is on a distinguished road
Send a message via Skype™ to rahulksoni
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: http://www.cfd-online.com/Forums/par...tml#post446231 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, 01:04
Exclamation
  #18
Member
 
rahulksoni's Avatar
 
Rahul Kumar Soni
Join Date: Oct 2013
Location: Bhubaneswar, India
Posts: 68
Rep Power: 13
rahulksoni is on a distinguished road
Send a message via Skype™ to rahulksoni
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, 15:55
Default
  #19
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Generating binary data files in fortran to read in paraview nadeem_malik Main CFD Forum 6 May 24, 2017 08:47
Run OpenFoam in 2 nodes of a cluster WhiteW OpenFOAM Running, Solving & CFD 16 December 20, 2016 01:51
[General] problem with extracting data from paraview a.hajisharifi ParaView 5 April 29, 2016 12:38
[OpenFOAM] saving data in paraview aylalisa ParaView 3 May 31, 2014 12:38
[General] paraview - plotting difference to reference data joewe ParaView 0 August 30, 2010 19:01


All times are GMT -4. The time now is 21:14.