Re: [Paraview] extract location of minimum
For those interested, I will give here my script how to extract the minimum value and its location in a serie of time steps, write it to file and put spheres on the local minimum. Since my knowledge of VTK is quite limited, I didn't know how to access the data, so I use some tricking to get it. Probably a much cleaner way of doing this is possible. Be free to give suggestions In order to get the locations from the ProgrammableFilter, my trick is to write all the data with CSVWriter to separate files, and then loop over the time step and read each file which containt the vtkTable data. This can porbably as well obtained directory from the ProgrammableFilter, but how ? Also, I wonder if it is necessary to use the ProgramableFilter in the first place, because I am using pvbatch. So I am calling a python script from a python script. The reason was that this allow to create a vtkTable, but again, this can be done better I guess. Anyway, any comments are welcome. I am also still learning this batch programming in paraview. anyway, the version below works and I am quite satisfied about the result Regards Eelco try: paraview.simple except: from paraview.simple import * import os # file i/o tools import sys # system tools import re # regular expressions import subprocess import pv# load my own parafoam routines import math from optparse import OptionParser paraview.simple._DisableFirstRenderCameraReset() sm=servermanager sm.Connect() view = CreateRenderView() * U_pxy_z0_600_t0 = LegacyVTKReader( FileNames=[ List of filename ])* *Calculator2 = Calculator() Calculator2.AttributeMode = 'point_data' Calculator2.Function = 'U_Z' Calculator2.ResultArrayName = 'U_Z' # define the programmable filter here to extract the minimum and position UzMinProgFilter=ProgrammableFilter() UzMinProgFilter.OutputDataSetType='vtkTable' UzMinProgFilter.PythonPath = '' UzMinProgFilter.RequestInformationScript = '' UzMinProgFilter.Script = \ input=inputs[0]\n\ output=self.GetTableOutput()\n\ Uzdata = input.PointData['U_Z']\n\ uzmin = Uzdata[0]\n\ numPoints = input.GetNumberOfPoints()\n\ pts = vtk.vtkPoints()\n\ for i in range(numPoints):\n\ uz=Uzdata[i]\n\ if uz uzmin:\n\ minpos = input.GetPoint(i)\n\ uzmin = uz\n\ vtkTable_xpmin=vtk.vtkFloatArray()\n\ vtkTable_xpmin.InsertNextValue(minpos[0])\n\ vtkTable_xpmin.SetName('xpmin')\n\ vtkTable_ypmin=vtk.vtkFloatArray()\n\ vtkTable_ypmin.InsertNextValue(minpos[1])\n\ vtkTable_ypmin.SetName('ypmin')\n\ vtkTable_zpmin=vtk.vtkFloatArray()\n\ vtkTable_zpmin.InsertNextValue(minpos[2])\n\ vtkTable_zpmin.SetName('zpmin')\n\ vtkTable_uzmin=vtk.vtkFloatArray()\n\ vtkTable_uzmin.InsertNextValue(uzmin)\n\ vtkTable_uzmin.SetName('uzmin')\n\ output.AddColumn(vtkTable_xpmin)\n\ output.AddColumn(vtkTable_ypmin)\n\ output.AddColumn(vtkTable_zpmin)\n\ output.AddColumn(vtkTable_uzmin)\n\ csvfile=Minima.csv print Writing all minima to CSV file: ,csvfile writer_all=CSVWriter(UzMinProgFilter,FileName=csvfile,WriteAllTimeSteps=1) writer_all.UpdatePipeline() *cnt=0 print Writing images: for time in timesteps: # reading info from file cnt csvfile=Minima%d%s % (cnt,'.csv') fp=open(csvfile,r) lineList=fp.readlines() fp.close() xp,yp,zp,uz=lineList[-1].split(',') position=[float(xp),float(yp),float(zp)] print Put sphere at ,position MinSphere=Sphere() MinSphere.Radius=0.001 MinSphere.Center=position rep_sphere = Show(MinSphere,view) rep_sphere.DiffuseColor = [0.0, 0.0, 0.0] On Fri, Mar 4, 2011 at 5:10 PM, Eelco van Vliet eelc...@gmail.com wrote: Hi David, Many thanks for you suggestions. I was away for a while but had some time to look at this points this week again. The using the Python calculator brought me on the trail of using The Programmable Pythonscript filter. My quest: I want to extrate the minimum value and its position for a time series of VTK files and write the data for all the time step to one single file. With the advice so for, I now have the following construction. First I read a series of VTK files representating the velocity over a cross section *U_pxy_z0_600_t0 = LegacyVTKReader( FileNames=[ List of filename ])* Then I extract the U_z velocity component *Calculator2 = Calculator() Calculator2.AttributeMode = 'point_data' Calculator2.Function = 'U_Z' Calculator2.ResultArrayName = 'U_Z' *Then I create a Programmable Filter ProgrammableFilter2 = ProgrammableFilter() ProgrammableFilter2.RequestUpdateExtentScript = '' ProgrammableFilter2.PythonPath = '' ProgrammableFilter2.RequestInformationScript = '' ProgrammableFilter2.OutputDataSetType = 'vtkTable' ProgrammableFilter2.Script = 'blabla' For the script of the Programmable filter, I am
[Paraview] Paraview Python Build
Hi, I've been able to build Paraview on my x64 windows 7 machine using cmake/vs2010. I recently tried to build the python components of paraview on the same platform. I can create and generate the solution okay, but the build fails with: fatal error C1083: Cannot open source file: 'vtkAbstractArrayPython.cxx': No such file or directory I have x64 python 2.5.4 and have checked the cmake configuration carefully. Has anyone else experienced this problem? -- Scanned by iCritical. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
[Paraview] Applying filters in sample app
Hi, I'm working on a sample application and I've been trying to make a cut appear on the data that is being viewed. I've followed the methodology used in the QuickContour application in my application, but the cut never appears on the data view. I'm using the data file associated with the QuickContour application to test my application. I'm guessing I'm just not understanding the required setup logic for behaviors and reactions in order to get the cut to apply. If anyone can see where I'm being dumb, my code is located here: https://github.com/mareuter/PVMockupGui. The cut is being applied in the mpMainWindow class in mpMainWindow::onCutButtonClicked. I am currently compiling against the ParaView git master on Ubuntu. Thanks, M Dr. Michael Reuter Scientific Data Analysis Group Neutron Scattering Science Division Oak Ridge National Laboratory Office: 1-865-241-7216 Fax: 1-865-574-6080 Email: reute...@ornl.gov ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] CGNS Reader fails in 3.10.0 final release
David Partyka a écrit : I also went and re-tested the Windows and Mac binaries with CGNS data and they all work fine. Thank you for your patience! Hello, Dave. The CGNS reader works fine on PV 3.10.0 Linux 64 bit since you have re-packaged the binaries, but I can't get it working on PV 3.10.0 Windows 32 bit. I have re-dowloaded the Windows 32 bit binaries and I tried several examples from the CGNS data base (delta.cgns, delta_vertex.cgns and multi.cgns): PV always crashes when I select a cgns file. Otherwise, PV 3.10.0 is working fine with my Tecplot files. Could you take a look at this CGNS Windows problem? Best regards. -- Richard GRENON ONERA Departement d'Aerodynamique Appliquee - DAAP/ACI 8 rue des Vertugadins 92190 MEUDON - FRANCE phone : +33 1 46 73 42 17 fax : +33 1 46 73 41 46 mailto:richard.gre...@onera.fr http://www.onera.fr ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] CGNS Reader fails in 3.10.0 final release
Hi Richard, we fixed the issue with the 32bit Windows binary. It is actually a pretty serious bug in the VisIt code because it attempts to delete memory allocated in one library in another. Amazingly it only crashed on 32bit Windows. @@ -1073,7 +1073,7 @@ avtCGNSFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md, { md-SetDatabaseComment(refstate); debug4 mName Reference string = refstate endl; -free(refstate); +cg_free(refstate); } We are going to release a 3.10.1 that includes the fix as soon as we get feedback on several other fixes that we also will be including. Thank you for your patience. On Tue, Mar 15, 2011 at 1:18 PM, Richard GRENON richard.gre...@onera.frwrote: David Partyka a écrit : I also went and re-tested the Windows and Mac binaries with CGNS data and they all work fine. Thank you for your patience! Hello, Dave. The CGNS reader works fine on PV 3.10.0 Linux 64 bit since you have re-packaged the binaries, but I can't get it working on PV 3.10.0 Windows 32 bit. I have re-dowloaded the Windows 32 bit binaries and I tried several examples from the CGNS data base (delta.cgns, delta_vertex.cgns and multi.cgns): PV always crashes when I select a cgns file. Otherwise, PV 3.10.0 is working fine with my Tecplot files. Could you take a look at this CGNS Windows problem? Best regards. -- Richard GRENON ONERA Departement d'Aerodynamique Appliquee - DAAP/ACI 8 rue des Vertugadins 92190 MEUDON - FRANCE phone : +33 1 46 73 42 17 fax : +33 1 46 73 41 46 mailto:richard.gre...@onera.fr http://www.onera.fr ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] CGNS Reader fails in 3.10.0 final release
David Partyka a écrit : Hi Richard, we fixed the issue with the 32bit Windows binary. It is actually a pretty serious bug in the VisIt code because it attempts to delete memory allocated in one library in another. Amazingly it only crashed on 32bit Windows. Amazing ! Is this the curse of Windows ? :-D Indeed, it's not very annoying for me as I justed wanted to test the CGNS reader on both OS. In fact, I will have to work with cgns files only on my Linux workstation. On my Windows laptop, I am always using Tecplot files. We are going to release a 3.10.1 that includes the fix as soon as we get feedback on several other fixes that we also will be including. OK, I will have a look on the download page for the next release. Thank you very much for this info. Richard. -- Richard GRENON ONERA Departement d'Aerodynamique Appliquee - DAAP/ACI 8 rue des Vertugadins 92190 MEUDON - FRANCE phone : +33 1 46 73 42 17 fax : +33 1 46 73 41 46 mailto:richard.gre...@onera.fr http://www.onera.fr ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] issue with make install in 3.10
Am 14.03.2011 20:06, schrieb David Partyka: Are you using a prebuilt qt from nokia? Or did you build it youself? David, our system administrator did the build. AFAIK it was build from source. Regards Bastian On Mon, Mar 14, 2011 at 3:01 PM, bastil2...@yahoo.de mailto:bastil2...@yahoo.de bastil2...@yahoo.de mailto:bastil2...@yahoo.de wrote: Thanks David, I forgot to mention - I already tried this. It does not help at all. Instead of this I get three missing *.so-Libraries (all from QT). After symmlinking them from the qt-lib to the paraview-lib I still get the same error. Regards Bastian Am 14.03.2011 19:58, schrieb David Partyka: Try turning off PARAVIEW_INSTALL_THIRD_PARTY_LIBRARIES. ( I think I am going to make it default OFF instead of ON). Then blow away your install tree and do a fresh make install. Does that resolve the problem? On Mon, Mar 14, 2011 at 2:55 PM, bastil2...@yahoo.de mailto:bastil2...@yahoo.de bastil2...@yahoo.de mailto:bastil2...@yahoo.de wrote: Hi all, I have build the 3.10 source from paraview.org http://paraview.org without any plroblems. However, I can run paraview only from the build directory. After a successuful make install I get: /opt/paraview/3.10.0/lib/paraview-3.10/paraview: symbol lookup error: /opt/paraview/3.10.0/lib/paraview-3.10/libQtXmlPatterns.so.4: undefined symbol: _ZNK21QNetworkAccessManager10metaObjectEv I use QT 4.6.2 which is not my system QT. All paths in ccmake 2.8.3 point to this QT. Ideas? Thanks Bastian ___ Powered by www.kitware.com http://www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com http://www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
[Paraview] Parallel VTK file format with multiple levels
Hi, I would like to use .pvtu to represent a multi-level unstructured grid by stating ===level 1 PVTU=== VTKFile type=PUnstructuredGrid version=0.1 byte_order=LittleEndian PUnstructuredGrid GhostLevel=1 ... Piece Source=energy_1.0/nsp.pvtu/ Piece Source=energy_2.0/nsp.pvtu/ /PUnstructuredGrid /VTKFile ===level 0 PVTU (energy_1.0/nsp.pvtu)=== VTKFile type=PUnstructuredGrid version=0.1 byte_order=LittleEndian PUnstructuredGrid GhostLevel=0 ... Piece Source=nsp_316.vtu/ ... Piece Source=nsp_523.vtu/ /PUnstructuredGrid /VTKFile After constructing these PVTU's and VTU's, I opened the level 1 PVTU and got below errors: ERROR: In ..\..\..\ParaViewSrc\VTK\IO\vtkXMLPDataReader.cxx, line 364 vtkXMLPUnstructuredGridReader (055D5860): File for piece 0 cannot be read. Note loading level 0 PVTU's and individual VTU's are of no error in ParaView. Did I miss anything? I could not find an example showing multi-level parallel VTK data construction. Would you please help? Thanks a lot. Best, 8gpus ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Applying filters in sample app
You're simply missing a line to hide the previous representation. I just added in mpMainWindow::onCutButtonClicked before the render() call and the slice shows up. this-ActiveSourceRepr-setVisible(false); Utkarsh On Tue, Mar 15, 2011 at 12:17 PM, Reuter, Michael A. reute...@ornl.gov wrote: Hi, I'm working on a sample application and I've been trying to make a cut appear on the data that is being viewed. I've followed the methodology used in the QuickContour application in my application, but the cut never appears on the data view. I'm using the data file associated with the QuickContour application to test my application. I'm guessing I'm just not understanding the required setup logic for behaviors and reactions in order to get the cut to apply. If anyone can see where I'm being dumb, my code is located here: https://github.com/mareuter/PVMockupGui. The cut is being applied in the mpMainWindow class in mpMainWindow::onCutButtonClicked. I am currently compiling against the ParaView git master on Ubuntu. Thanks, M Dr. Michael Reuter Scientific Data Analysis Group Neutron Scattering Science Division Oak Ridge National Laboratory Office: 1-865-241-7216 Fax: 1-865-574-6080 Email: reute...@ornl.gov ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] issue with make install in 3.10
We are asking because the 4.6.X prebuilt frameworks from Nokia don't come with QNetworkAccessManager. I would confirm with your system administrator that Qt has been built with QtNetwork enabled. On Tue, Mar 15, 2011 at 2:59 PM, bastil2...@yahoo.de bastil2...@yahoo.dewrote: Am 14.03.2011 20:06, schrieb David Partyka: Are you using a prebuilt qt from nokia? Or did you build it youself? David, our system administrator did the build. AFAIK it was build from source. Regards Bastian On Mon, Mar 14, 2011 at 3:01 PM, bastil2...@yahoo.de bastil2...@yahoo.dewrote: Thanks David, I forgot to mention - I already tried this. It does not help at all. Instead of this I get three missing *.so-Libraries (all from QT). After symmlinking them from the qt-lib to the paraview-lib I still get the same error. Regards Bastian Am 14.03.2011 19:58, schrieb David Partyka: Try turning off PARAVIEW_INSTALL_THIRD_PARTY_LIBRARIES. ( I think I am going to make it default OFF instead of ON). Then blow away your install tree and do a fresh make install. Does that resolve the problem? On Mon, Mar 14, 2011 at 2:55 PM, bastil2...@yahoo.de bastil2...@yahoo.de wrote: Hi all, I have build the 3.10 source from paraview.org without any plroblems. However, I can run paraview only from the build directory. After a successuful make install I get: /opt/paraview/3.10.0/lib/paraview-3.10/paraview: symbol lookup error: /opt/paraview/3.10.0/lib/paraview-3.10/libQtXmlPatterns.so.4: undefined symbol: _ZNK21QNetworkAccessManager10metaObjectEv I use QT 4.6.2 which is not my system QT. All paths in ccmake 2.8.3 point to this QT. Ideas? Thanks Bastian ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe:http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe:http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview -- Robert Maynard ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
[Paraview] Debugging a pvserver with multiple GPUs
I just wanted to share a bit of useful code. I wanted to confirm that all my pvserver processes had the correct DISPLAY environment variable defined. I created an mpi command line that launched two processes per node, with half the processes using -display :0.0 and the other half using -display :0.1. After connecting to the server, I ran this python code inside a Programmable Source: import os import subprocess display = os.getenv('DISPLAY') hostname = subprocess.Popen(['hostname'], stdout=subprocess.PIPE).communicate()[0].strip() print hostname, display The output is printed to the pvserver terminal: Process id: 3 vs8 :0.0 Process id: 4 vs14 :0.1 Process id: 7 vs8 :0.1 Process id: 0 vs14 :0.0 Process id: 5 vs30 :0.1 Process id: 1 vs30 :0.0 Process id: 2 vs2 :0.0 Process id: 6 vs2 :0.1 Pat ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Debugging a pvserver with multiple GPUs
That's a cool trick. I took the liberty of adding it to the ParaView wiki page on setting up a pvserver: http://www.paraview.org/Wiki/Setting_up_a_ParaView_Server#Multiple_GPUs_Per_Node -Ken Kenneth Moreland *** Sandia National Laboratories *** *** *** *** email: kmo...@sandia.gov ** *** ** phone: (505) 844-8919 *** web: http://www.cs.unm.edu/~kmorel From: pat marion pat.mar...@kitware.commailto:pat.mar...@kitware.com Date: Tue, 15 Mar 2011 15:04:53 -0600 To: ParaView paraview@paraview.orgmailto:paraview@paraview.org Subject: [Paraview] Debugging a pvserver with multiple GPUs I just wanted to share a bit of useful code. I wanted to confirm that all my pvserver processes had the correct DISPLAY environment variable defined. I created an mpi command line that launched two processes per node, with half the processes using -display :0.0 and the other half using -display :0.1. After connecting to the server, I ran this python code inside a Programmable Source: import os import subprocess display = os.getenv('DISPLAY') hostname = subprocess.Popen(['hostname'], stdout=subprocess.PIPE).communicate()[0].strip() print hostname, display The output is printed to the pvserver terminal: Process id: 3 vs8 :0.0 Process id: 4 vs14 :0.1 Process id: 7 vs8 :0.1 Process id: 0 vs14 :0.0 Process id: 5 vs30 :0.1 Process id: 1 vs30 :0.0 Process id: 2 vs2 :0.0 Process id: 6 vs2 :0.1 Pat ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview