|
[Sponsors] |
[OpenFOAM] Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 24, 2013, 09:49 |
Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12
|
#1 |
Senior Member
David Long
Join Date: May 2012
Location: Germany
Posts: 104
Rep Power: 14 |
Hi Foamers,
It seems that "Automatically Rescale to Fit Data Range" does not work in compiled ParaView 3.12 for OpenFoam 2.1.1. This issue was always bugging me, especially when comes to saving "Animation". System: Ubuntu 12.04 32-bit, OF 2.1.1, paraview 3.12 PV settings: 1) Edit --> Settings: Rescale Data Range Mode -->Grow every timestep 2) Color scale editor: Automatically Rescale to Fit Data Range is on When playing saved results, the value of selected colour legend is rising while the max. exceeds the current max.. However, when the current max value drops, the max. value of the colour legend does not change! This causes saved animations has same colour of selected fields (pressure or velocity) especially a very high value of magnitude takes places in few timesteps. For example, if i wanna make a animation of propagation of water waves over slope, the max. velocity of wave during the overall simulation is c.a 12 m/s, while the estimated average velocity is 4~6 m/s, so the contour colour of most screen-shots looks the same and could not figure out the Velocity Fields. 1. Animation screenshot (It is difficult to find out the max velocity.) 2. Manually press the "Rescale to Data Range" button (expected output) Having searched through the forum but could not find the solution. Has some one faced this annoying issue and solved it? Best, David |
|
May 25, 2013, 09:44 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings David,
Many thanks for the thorough explanation! Here's what I've managed to figure out:
Bruno
__________________
|
|
May 25, 2013, 16:55 |
|
#3 | |
Senior Member
David Long
Join Date: May 2012
Location: Germany
Posts: 104
Rep Power: 14 |
Quote:
Since the feature is not provided, is there any other hacking way to the source code that the "Rescale to Data Range" button is automatically pressed each time step? |
||
May 25, 2013, 17:07 |
|
#4 | ||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Quote:
Quote:
Another possibility is to do the animation purely through python scripts... ParaView does have the "Python Trace" feature, so it's just a matter of hacking the resulting macro script. But again, ParaView must be built with Python support. Said Python support depends on how you built/installed ParaView in the first place.
__________________
|
|||
August 3, 2013, 21:58 |
|
#5 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
hi Bruno
If 4 is better can i install Paraview 4.0 on ubuntu 11.10 or can't?! @David Hi There is a button for automatic scale change in options,check mark it.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
August 17, 2013, 14:24 |
|
#6 | |||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings to all!
Quote:
The problem comes when you actually need to use them, namely:
Quote:
Quote:
But back on the original topic - As I wrote in the past, one needs Python built into ParaView for making the following technique to work. I only managed to look into this today, because since yesterday I've been studying how to use some of of the missing ParaView features. So, to be able to get the animation to update the ranges on each iteration, one has to:
Bruno
__________________
Last edited by wyldckat; September 15, 2013 at 19:11. Reason: see "edit:"; Also fixed broken code for updating the pipeline |
||||
August 18, 2013, 11:32 |
|
#7 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
Hi dear Bruno
I did what you told except to using -builtin option and it didn't rescale data.should use -builttin necessarily? because I have reconstructed and deleted processor's folders.can't do anything?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
August 18, 2013, 11:52 |
|
#9 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
I used the code as this:
Code:
from paraview.simple import * def start_cue(self): pass def tick(self): source = FindSource("WR_3.OpenFOAM") source.UpdatePipeline(self.GetAnimationTime()) #The array and number of components #arrayName = "p" #arrayComponents = 1 #component = -1 #options for component: -1, 0, 1 and 2 => Mag, X, Y, Z # If it's a scalar field arrayName = "p" arrayComponents = 1 component = 0 #Get the look-up table for this array lookupTable = GetLookupTableForArray(arrayName, arrayComponents) #get the access to the cellData or pointData data = source.GetCellDataInformation() #data = source.GetPointDataInformation() #get the array and the respective min-max array = data.GetArray(arrayName) dataRange = array.GetRange(component) lookupTable.LockScalarRange = 1 #Now let's hack in the range values lookupTable.RGBPoints[0] = dataRange[0] #min lookupTable.RGBPoints[4] = dataRange[1] #max def end_cue(self): pass is it incorrect to use .OpeFOAM extension?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
August 18, 2013, 12:00 |
|
#10 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
No, the ".OpenFOAM" file is not the problem.
We've exchanged so many emails and posts, and you still don't provide enough information... What ParaView version are you using and is there any error message?
__________________
|
|
August 18, 2013, 12:25 |
|
#11 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
paraView 3.12.0
and each time use start paraView should add the code again?it doesn't save for me. p increases and should decrease after a time but maximum doesn't decrease to real time maximum,no there isn't any error except that paraview is closed when reaches the last time folder but saves previous images to the path. is the field with a circle on left in a point representation not cell represent,right?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
August 18, 2013, 12:55 |
|
#12 | |||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Quote:
Quote:
Quote:
__________________
|
||||
August 18, 2013, 13:54 |
|
#13 | ||
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
then I should use "save state" and "load state" after I start paraView?
Quote:
Quote:
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|||
August 18, 2013, 14:03 |
|
#14 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Quote:
I've edit the other post at the other thread, with a more clear indication of which is which.
__________________
|
||
August 18, 2013, 14:17 |
|
#15 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
I forgot to say this error occurs when playing or animating in paraView in all time snapshots not only first time step due to #'s in 0 folder:
Code:
ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/IO/vtkOpenFOAMReader.cxx, line 6481 vtkOpenFOAMReaderPrivate (0x1ad5ec0): Error reading line 19 of /home/ehsan/Desktop/WR_4/0/T: Expected number, string or (, found Temperature ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/IO/vtkOpenFOAMReader.cxx, line 6481 vtkOpenFOAMReaderPrivate (0x1ad5ec0): Error reading line 19 of /home/ehsan/Desktop/WR_4/0/U: Expected number, string or (, found Velocity ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/IO/vtkOpenFOAMReader.cxx, line 6481 vtkOpenFOAMReaderPrivate (0x1ad5ec0): Error reading line 20 of /home/ehsan/Desktop/WR_4/0/k: Expected number, string or (, found turbulentK ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/IO/vtkOpenFOAMReader.cxx, line 6481 vtkOpenFOAMReaderPrivate (0x1ad5ec0): Error reading line 20 of /home/ehsan/Desktop/WR_4/0/omega: Expected number, string or (, found turbulentOmega ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/IO/vtkOpenFOAMReader.cxx, line 6481 vtkOpenFOAMReaderPrivate (0x1ad5ec0): Error reading line 19 of /home/ehsan/Desktop/WR_4/0/p: Expected number, string or (, found Pressure Traceback (most recent call last): File "<string>", line 4, in <module> File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/servermanager.py", line 43, in <module> import paraview, re, os, os.path, new, sys, vtk File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/vtk/__init__.py", line 1, in <module> from vtkCommonPython import * ImportError: No module named vtkCommonPython Traceback (most recent call last): File "<string>", line 2, in <module> File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/simple.py", line 39, in <module> import servermanager File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/servermanager.py", line 43, in <module> import paraview, re, os, os.path, new, sys, vtk File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/vtk/__init__.py", line 1, in <module> from vtkCommonPython import * ImportError: No module named vtkCommonPython Traceback (most recent call last): File "<string>", line 1, in <module> File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/simple.py", line 39, in <module> import servermanager File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/servermanager.py", line 43, in <module> import paraview, re, os, os.path, new, sys, vtk File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/vtk/__init__.py", line 1, in <module> from vtkCommonPython import * ImportError: No module named vtkCommonPython Traceback (most recent call last): File "<string>", line 2, in <module> File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/simple.py", line 39, in <module> import servermanager File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/servermanager.py", line 43, in <module> import paraview, re, os, os.path, new, sys, vtk File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/vtk/__init__.py", line 1, in <module> from vtkCommonPython import * ImportError: No module named vtkCommonPython Traceback (most recent call last): File "<string>", line 1, in <module> File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/simple.py", line 39, in <module> import servermanager File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/servermanager.py", line 43, in <module> import paraview, re, os, os.path, new, sys, vtk File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/vtk/__init__.py", line 1, in <module> from vtkCommonPython import * ImportError: No module named vtkCommonPython Traceback (most recent call last): File "<string>", line 2, in <module> File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/simple.py", line 39, in <module> import servermanager File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/servermanager.py", line 43, in <module> import paraview, re, os, os.path, new, sys, vtk File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/vtk/__init__.py", line 1, in <module> from vtkCommonPython import * ImportError: No module named vtkCommonPython Traceback (most recent call last): File "<string>", line 2, in <module> File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/simple.py", line 39, in <module> import servermanager File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/servermanager.py", line 43, in <module> import paraview, re, os, os.path, new, sys, vtk File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/vtk/__init__.py", line 1, in <module> from vtkCommonPython import * ImportError: No module named vtkCommonPython Traceback (most recent call last): File "<string>", line 1, in <module> File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/simple.py", line 39, in <module> import servermanager File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/servermanager.py", line 43, in <module> import paraview, re, os, os.path, new, sys, vtk File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/vtk/__init__.py", line 1, in <module> from vtkCommonPython import * ImportError: No module named vtkCommonPython Traceback (most recent call last): File "<string>", line 2, in <module> File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/simple.py", line 39, in <module> import servermanager File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/servermanager.py", line 43, in <module> import paraview, re, os, os.path, new, sys, vtk File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/vtk/__init__.py", line 1, in <module> from vtkCommonPython import * ImportError: No module named vtkCommonPython Traceback (most recent call last): File "<string>", line 1, in <module> File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/simple.py", line 39, in <module> import servermanager File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/servermanager.py", line 43, in <module> import paraview, re, os, os.path, new, sys, vtk File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/vtk/__init__.py", line 1, in <module> from vtkCommonPython import * ImportError: No module named vtkCommonPython ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/IO/vtkOpenFOAMReader.cxx, line 6481 vtkOpenFOAMReaderPrivate (0x1ad5ec0): Error reading line 19 of /home/ehsan/Desktop/WR_4/0/T: Expected number, string or (, found Temperature ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/IO/vtkOpenFOAMReader.cxx, line 6481 vtkOpenFOAMReaderPrivate (0x1ad5ec0): Error reading line 19 of /home/ehsan/Desktop/WR_4/0/U: Expected number, string or (, found Velocity ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/IO/vtkOpenFOAMReader.cxx, line 6481 vtkOpenFOAMReaderPrivate (0x1ad5ec0): Error reading line 20 of /home/ehsan/Desktop/WR_4/0/k: Expected number, string or (, found turbulentK ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/IO/vtkOpenFOAMReader.cxx, line 6481 vtkOpenFOAMReaderPrivate (0x1ad5ec0): Error reading line 20 of /home/ehsan/Desktop/WR_4/0/omega: Expected number, string or (, found turbulentOmega ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/IO/vtkOpenFOAMReader.cxx, line 6481 vtkOpenFOAMReaderPrivate (0x1ad5ec0): Error reading line 19 of /home/ehsan/Desktop/WR_4/0/p: Expected number, string or (, found Pressure Traceback (most recent call last): File "<string>", line 2, in <module> File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/simple.py", line 39, in <module> import servermanager File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/servermanager.py", line 43, in <module> import paraview, re, os, os.path, new, sys, vtk File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/vtk/__init__.py", line 1, in <module> from vtkCommonPython import * ImportError: No module named vtkCommonPython Traceback (most recent call last): File "<string>", line 1, in <module> File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/simple.py", line 39, in <module> import servermanager File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/servermanager.py", line 43, in <module> import paraview, re, os, os.path, new, sys, vtk File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/vtk/__init__.py", line 1, in <module> from vtkCommonPython import * ImportError: No module named vtkCommonPython Traceback (most recent call last): File "<string>", line 2, in <module> File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/simple.py", line 39, in <module> import servermanager File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/servermanager.py", line 43, in <module> import paraview, re, os, os.path, new, sys, vtk File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/vtk/__init__.py", line 1, in <module> from vtkCommonPython import * ImportError: No module named vtkCommonPython Traceback (most recent call last): File "<string>", line 1, in <module> File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/simple.py", line 39, in <module> import servermanager File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/servermanager.py", line 43, in <module> import paraview, re, os, os.path, new, sys, vtk File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/vtk/__init__.py", line 1, in <module> from vtkCommonPython import * ImportError: No module named vtkCommonPython Traceback (most recent call last): File "<string>", line 2, in <module> File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/simple.py", line 39, in <module> import servermanager File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/servermanager.py", line 43, in <module> import paraview, re, os, os.path, new, sys, vtk File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/vtk/__init__.py", line 1, in <module> from vtkCommonPython import * ImportError: No module named vtkCommonPython Traceback (most recent call last): File "<string>", line 1, in <module> File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/simple.py", line 39, in <module> import servermanager File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/servermanager.py", line 43, in <module> import paraview, re, os, os.path, new, sys, vtk File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/vtk/__init__.py", line 1, in <module> from vtkCommonPython import * ImportError: No module named vtkCommonPython Traceback (most recent call last): File "<string>", line 2, in <module> File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/simple.py", line 39, in <module> import servermanager File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/servermanager.py", line 43, in <module> import paraview, re, os, os.path, new, sys, vtk File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/vtk/__init__.py", line 1, in <module> from vtkCommonPython import * ImportError: No module named vtkCommonPython Traceback (most recent call last): File "<string>", line 1, in <module> File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/simple.py", line 39, in <module> import servermanager File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/servermanager.py", line 43, in <module> import paraview, re, os, os.path, new, sys, vtk File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/vtk/__init__.py", line 1, in <module> from vtkCommonPython import * ImportError: No module named vtkCommonPython Traceback (most recent call last): File "<string>", line 2, in <module> File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/simple.py", line 39, in <module> import servermanager File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/servermanager.py", line 43, in <module> import paraview, re, os, os.path, new, sys, vtk File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/vtk/__init__.py", line 1, in <module> from vtkCommonPython import * ImportError: No module named vtkCommonPython
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
August 18, 2013, 16:13 |
|
#16 | ||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
For other readers, I've already explained this one:
Quote:
As for this error: Quote:
I'm currently trying to figure out if there a simple fix for this. Best regards, Bruno
__________________
|
|||
August 18, 2013, 17:15 |
|
#17 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
OK, as implied in the previous post, the bug is related to the missing "vtk*Python.so" library files. This post is meant to fix this problem.
In my DropBox account is the following file (130kB): https://www.dropbox.com/s/edbrvd6xps...so.tar.gz?dl=0 - it provides the aforementioned library binaries for x86_64, built on a virtual machine with OpenSUSE 12.1 x86_64 and Python 2.7.2, which where built for this post: http://www.cfd-online.com/Forums/ope...tml#post435470 post #5 WARNING: Given that these binaries are in my DropBox account and not signed as in Ubuntu, so there is always a risk of the binaries being contaminated with something Nonetheless, the SHA256 of this file is: Code:
0acb36947b1f85bf8f3e6d0d6b2958bd602527cee00a15953fd32de566a1fc4e ParaView-3.12.0-vtk_Python_so.tar.gz Code:
sha256sum ParaView-3.12.0-vtk_Python_so.tar.gz Code:
sudo tar -xf ParaView-3.12.0-vtk_Python_so.tar.gz -C/opt/paraviewopenfoam3120/lib/paraview-3.12 -------------------- At the request sent to me over private message, here is the 32bit version of the "vtk*Python.so" library files: https://www.dropbox.com/s/xeon94tor1...so-i686.tar.gz - it was built in Ubuntu 12.04 i686, which uses Python 2.7.3. The SHA256 of this file is: Code:
2874b682999075462dd131aa0aa81994fc10a273e4e7ea8253d53752089d9910 ParaView-3.12.0-vtk_Python_so-i686.tar.gz
__________________
Last edited by wyldckat; March 26, 2017 at 16:37. Reason: Added link and info for the 32bit | fixed link |
|
August 18, 2013, 17:28 |
|
#18 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
With the previous post, the bug is fixed. The post #6 has been updated with instructions on how to use the script in ParaView 3.12.0.
@Ehsan: As a result, the code you should be using is this: Code:
from paraview.simple import * def start_cue(self): pass def tick(self): source = FindSource("WR_3.OpenFOAM") source.UpdatePipeline(GetAnimationScene().TimeKeeper.Time) #The array and number of components #arrayName = "p" #arrayComponents = 1 #component = -1 #options for component: -1, 0, 1 and 2 => Mag, X, Y, Z # If it's a scalar field arrayName = "p" arrayComponents = 1 component = 0 #Get the look-up table for this array lookupTable = GetLookupTableForArray(arrayName, arrayComponents) #get the access to the cellData or pointData data = source.GetCellDataInformation() #data = source.GetPointDataInformation() #get the array and the respective min-max array = data.GetArray(arrayName) dataRange = array.GetRange(component) lookupTable.LockScalarRange = 1 #Now let's hack in the range values lookupTable.RGBPoints[0] = dataRange[0] #min lookupTable.RGBPoints[4] = dataRange[1] #max def end_cue(self): pass
__________________
|
|
August 18, 2013, 18:11 |
|
#19 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
this kind of errors is shown when play and the minimum and maximum are not correct,I have set poinData in the code:
Code:
File "<string>", line 27 data = source.GetPointDataInformation() ^ IndentationError: unexpected indent
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. Last edited by wyldckat; August 18, 2013 at 18:16. Reason: fixed long post. there was no need to post the same error message several times |
|
August 18, 2013, 18:19 |
|
#20 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
It means that your code is broken. This is why I don't completely like Python
The reason is because for Python, this: Code:
def tick(self): #... #get the access to the cellData or pointData #data = source.GetCellDataInformation() data = source.GetPointDataInformation() Code:
def tick(self): #... #get the access to the cellData or pointData #data = source.GetCellDataInformation() data = source.GetPointDataInformation() Therefore, the correct complete code you want should be: Code:
from paraview.simple import * def start_cue(self): pass def tick(self): source = FindSource("WR_3.OpenFOAM") source.UpdatePipeline(GetAnimationScene().TimeKeeper.Time) #The array and number of components #arrayName = "p" #arrayComponents = 1 #component = -1 #options for component: -1, 0, 1 and 2 => Mag, X, Y, Z # If it's a scalar field arrayName = "p" arrayComponents = 1 component = 0 #Get the look-up table for this array lookupTable = GetLookupTableForArray(arrayName, arrayComponents) #get the access to the cellData or pointData #data = source.GetCellDataInformation() data = source.GetPointDataInformation() #get the array and the respective min-max array = data.GetArray(arrayName) dataRange = array.GetRange(component) lookupTable.LockScalarRange = 1 #Now let's hack in the range values lookupTable.RGBPoints[0] = dataRange[0] #min lookupTable.RGBPoints[4] = dataRange[1] #max def end_cue(self): pass
__________________
|
|
Tags |
paraview, rescale to data range |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Automatic Data Export (ascii format) | A Kourm | FLUENT | 4 | March 7, 2021 15:08 |
Issue Writing Out Surface Data | rufuscws89 | Tecplot | 1 | May 6, 2019 14:52 |
Parallel Block Size Issue | ChiefSeaBiscuit | CONVERGE | 5 | July 22, 2016 15:03 |
[OpenFOAM] Automatic range in paraview animations | arno | ParaView | 1 | August 29, 2006 05:00 |
How to update polyPatchbs localPoints | liu | OpenFOAM Running, Solving & CFD | 6 | December 30, 2005 18:27 |