CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Paraview & paraFoam (http://www.cfd-online.com/Forums/openfoam-paraview/)
-   -   Update data in ParaView (http://www.cfd-online.com/Forums/openfoam-paraview/78129-update-data-paraview.html)

hpon July 13, 2010 17:01

Update data in ParaView
 
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

wyldckat July 13, 2010 18:19

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

hpon July 14, 2010 17:04

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

wyldckat July 14, 2010 18:16

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

hpon July 16, 2010 04:07

Perfect. Thank you!

/hpon

elorenz August 8, 2013 04:07

any progress...?
 
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

akidess August 8, 2013 04:38

Quote:

Originally Posted by elorenz (Post 444516)
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!

elorenz August 8, 2013 04:54

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

akidess August 8, 2013 05:07

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

elorenz August 8, 2013 05:43

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

akidess August 8, 2013 05:54

Ok, that wasn't clear to me. It might be that the reload button is only available when using the OpenFOAM loader.

wyldckat August 16, 2013 21:10

2 Attachment(s)
Greetings to all!

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

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 :D.

elorenz August 30, 2013 05:06

Great!!!
 
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 :)

wyldckat August 31, 2013 09:39

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 (Post 448855)
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:

mnajafiyazdi July 17, 2014 16:57

For VTU files or animations?
 
Does this plugin work for VTU files or animations saved with .pvd?

wyldckat August 17, 2014 12:17

Greetings mnajafiyazdi and welcome (back) to the forum!

Quote:

Originally Posted by mnajafiyazdi (Post 502042)
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

rahulksoni May 5, 2015 03:36

Thanks a lot Bruno, it worked like a charm :):):)

Quote:

Originally Posted by wyldckat (Post 446239)
Greetings to all!

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

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 :D.


rahulksoni May 6, 2015 00:04

Quote:

Originally Posted by rahulksoni (Post 545012)
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. :confused::confused:

wyldckat May 10, 2015 14:55

Quote:

Originally Posted by rahulksoni (Post 545153)
Can you add some piece of code that can update things with a single click. :confused::confused:

Quick answer: Did you see post #14?


All times are GMT -4. The time now is 02:39.