Re: [Paraview] Catalyst: dump everything in C++
Hi Matthieu, That makes complete sense. I've thought about putting in a C++ Catalyst pipeline in the main source code that could be used to just write out the data at some prescribed file name and frequency but haven't forced myself to do it. It gets slightly more complicated when dealing with multiple inputs. In the Examples/Catalyst/SampleScripts subdirectory of the source code there are two Python scripts that can be used to write out the full grid, gridwriter.py and allinputsgridwriter.py. If you create a C++ script to do that and want to have it added into ParaView, I can help with that. Otherwise, I'll get to it eventually... Cheers, Andy On Wed, Sep 21, 2016 at 10:29 AM, Lokman Rahmani wrote: > Hi Matthieu! > > I investigated the same question recently, here is what I found so far. > > In Catalyst/CoProcessing the python script is used to create a vtk pipeline > > - > vtkNew pipeline; > > pipeline->Initialize(scriptPath) > - > > This pipeline will be passed to vtk processor that will do the > CoPorcessing by executing the pipeline > > -- > vtkCPProcessor* Processor = vtkCPProcessor::New(); > > Processor->Initialize(); > Processor->AddPipeline(pipeline.GetPointer()); > Processor->CcProcess(...) > -- > > checking the souce code of VtkCPProcessor (https://gitlab.kitware.com/ > paraview/paraview/blob/master/CoProcessing/Catalyst/vtkCPProcessor.h) > > > > /// Add in a pipeline that is externally configured. Returns 1 if /// > successful and 0 otherwise. virtual int AddPipeline(vtkCPPipeline* pipeline); > > --- > > a vtkCPProcessor object can add a pipeline of any class extending the > vtkCPPipeline (which is a an abstract class) > > Beside of the official python implementation (https://gitlab.kitware.com/ > paraview/paraview/blob/master/CoProcessing/PythonCatalyst/ > vtkCPPythonScriptPipeline.h) I am not aware of any other implementation. > > Otherwise, you can to implement your own implementation (which looks very > time consuming ...). > http://www.vtk.org/Wiki/VTK/Tutorials/New_Pipeline > > Hope this helps. > > I'll be interested if some one is aware of any c++ implementation of the > pipeline. > > Best, > Lokman > > > > > ------ > > *De: *"Matthieu Dorier" > *À: *"ParaView Mailing List [paraview@paraview.org]" < > paraview@paraview.org> > *Envoyé: *Mercredi 21 Septembre 2016 15:27:41 > *Objet: *[Paraview] Catalyst: dump everything in C++ > > > Hi, > > In general the way we create python scripts for a Catalyst-enabled > simulation is by first running the simulation with a Python script that > writes the data into files, then do offline analysis on those files and > export a python script representing the analysis tasks to be done in situ. > > I was wondering if, instead of using a Python script for writing all the > data into file, an equivalent C++ code was available, and how such a code > would be integrated into a Catalyst-enabled simulation? Or maybe just with > VTK once the adaptors are written for the simulation's data? > > Thanks, > > Matthieu > > ___ > 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 > > Search the list archives at: http://markmail.org/search/?q=ParaView > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/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 > > Search the list archives at: http://markmail.org/search/?q=ParaView > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/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 Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
Re: [Paraview] Catalyst: dump everything in C++
Hi Matthieu! I investigated the same question recently, here is what I found so far. In Catalyst/CoProcessing the python script is used to create a vtk pipeline - vtkNew pipeline; pipeline->Initialize(scriptPath) - This pipeline will be passed to vtk processor that will do the CoPorcessing by executing the pipeline -- vtkCPProcessor* Processor = vtkCPProcessor::New(); Processor->Initialize(); Processor->AddPipeline(pipeline.GetPointer()); Processor->CcProcess(...) -- checking the souce code of VtkCPProcessor ( https://gitlab.kitware.com/paraview/paraview/blob/master/CoProcessing/Catalyst/vtkCPProcessor.h ) /// Add in a pipeline that is externally configured. Returns 1 if /// successful and 0 otherwise. virtual int AddPipeline ( vtkCPPipeline * pipeline ); --- a vtkCPProcessor object can add a pipeline of any class extending the vtkCPPipeline (which is a an abstract class) Beside of the official python implementation ( https://gitlab.kitware.com/paraview/paraview/blob/master/CoProcessing/PythonCatalyst/vtkCPPythonScriptPipeline.h ) I am not aware of any other implementation. Otherwise, you can to implement your own implementation (which looks very time consuming ...). http://www.vtk.org/Wiki/VTK/Tutorials/New_Pipeline Hope this helps. I'll be interested if some one is aware of any c++ implementation of the pipeline. Best, Lokman - Mail original - > De: "Matthieu Dorier" > À: "ParaView Mailing List [paraview@paraview.org]" > Envoyé: Mercredi 21 Septembre 2016 15:27:41 > Objet: [Paraview] Catalyst: dump everything in C++ > Hi, > In general the way we create python scripts for a Catalyst-enabled simulation > is by first running the simulation with a Python script that writes the data > into files, then do offline analysis on those files and export a python > script representing the analysis tasks to be done in situ. > I was wondering if, instead of using a Python script for writing all the data > into file, an equivalent C++ code was available, and how such a code would > be integrated into a Catalyst-enabled simulation? Or maybe just with VTK > once the adaptors are written for the simulation's data? > Thanks, > Matthieu > ___ > 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 > Search the list archives at: http://markmail.org/search/?q=ParaView > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/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 Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
Re: [Paraview] Catalyst: dump everything in C++
Hi, The reason I would like a C++ pipeline is that I have a simulation that has several available output formats (HDF5, etc.) and I would like to make VTK one of the possible formats. Since the simulation is instrumented with Catalyst, it would be easy to just use a Python script building a pipeline that just output the data, but I'd like to avoid having to carry around a Python script that the user may forget to copy in his working directory when the simulation is launched. I'd find it cleaner to have this particular pipeline setup in C++. Thanks, Matthieu From: Lokman Rahmani [lokman.rahm...@irisa.fr] Sent: Wednesday, September 21, 2016 9:33 AM To: Andy Bauer Cc: Dorier, Matthieu; ParaView Mailing List [paraview@paraview.org] Subject: Re: [Paraview] Catalyst: dump everything in C++ Thanks Andy, I was not aware of the examples. Best, Lokman De: "Andy Bauer" À: "Matthieu Dorier" Cc: "ParaView Mailing List [paraview@paraview.org]" Envoyé: Mercredi 21 Septembre 2016 16:25:36 Objet: Re: [Paraview] Catalyst: dump everything in C++ Hi Matthieu, You can indeed use Catalyst without Python. There are two examples in the Examples/Catalyst subdirectory of the source tree to do that. They are CxxVTKPipelineExample and CxxPVSMPipelineExample. I wouldn't recommend this method as the Python route is much simpler. Several people have thought about avoiding the Python interface and generally come around to its flexibility (both ease in creating new Catalyst output as well as making changes without having to recompile code). In my opinion, if you're not doing image output the C++ route is manageable without too much difficulty. For image output there's a lot of things which need to be set in order to get all the lookup tables, data ranges, camera angle, etc. that can get quite complex. If you look at a GUI generated Catalyst script for data extract output and compare it to image output you'll easily see the difference in the complexity. Also, Cinema output is Python driven so that wouldn't be available through a C++ pipeline. Now that I've gone through all of this, is there a specific reason why you're looking to avoid Python? Best, Andy On Wed, Sep 21, 2016 at 9:27 AM, Dorier, Matthieu mailto:mdor...@anl.gov>> wrote: Hi, In general the way we create python scripts for a Catalyst-enabled simulation is by first running the simulation with a Python script that writes the data into files, then do offline analysis on those files and export a python script representing the analysis tasks to be done in situ. I was wondering if, instead of using a Python script for writing all the data into file, an equivalent C++ code was available, and how such a code would be integrated into a Catalyst-enabled simulation? Or maybe just with VTK once the adaptors are written for the simulation's data? Thanks, Matthieu ___ 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 Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/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 Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/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 Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
Re: [Paraview] Catalyst: dump everything in C++
Thanks Andy, I was not aware of the examples. Best, Lokman - Mail original - > De: "Andy Bauer" > À: "Matthieu Dorier" > Cc: "ParaView Mailing List [paraview@paraview.org]" > Envoyé: Mercredi 21 Septembre 2016 16:25:36 > Objet: Re: [Paraview] Catalyst: dump everything in C++ > Hi Matthieu, > You can indeed use Catalyst without Python. There are two examples in the > Examples/Catalyst subdirectory of the source tree to do that. They are > CxxVTKPipelineExample and CxxPVSMPipelineExample. I wouldn't recommend this > method as the Python route is much simpler. Several people have thought > about avoiding the Python interface and generally come around to its > flexibility (both ease in creating new Catalyst output as well as making > changes without having to recompile code). > In my opinion, if you're not doing image output the C++ route is manageable > without too much difficulty. For image output there's a lot of things which > need to be set in order to get all the lookup tables, data ranges, camera > angle, etc. that can get quite complex. If you look at a GUI generated > Catalyst script for data extract output and compare it to image output > you'll easily see the difference in the complexity. Also, Cinema output is > Python driven so that wouldn't be available through a C++ pipeline. > Now that I've gone through all of this, is there a specific reason why you're > looking to avoid Python? > Best, > Andy > On Wed, Sep 21, 2016 at 9:27 AM, Dorier, Matthieu < mdor...@anl.gov > wrote: > > Hi, > > > In general the way we create python scripts for a Catalyst-enabled > > simulation > > is by first running the simulation with a Python script that writes the > > data > > into files, then do offline analysis on those files and export a python > > script representing the analysis tasks to be done in situ. > > > I was wondering if, instead of using a Python script for writing all the > > data > > into file, an equivalent C++ code was available, and how such a code would > > be integrated into a Catalyst-enabled simulation? Or maybe just with VTK > > once the adaptors are written for the simulation's data? > > > Thanks, > > > Matthieu > > > ___ > > > 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 > > > Search the list archives at: http://markmail.org/search/?q=ParaView > > > Follow this link to subscribe/unsubscribe: > > > http://public.kitware.com/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 > Search the list archives at: http://markmail.org/search/?q=ParaView > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/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 Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
Re: [Paraview] Catalyst: dump everything in C++
Hi Matthieu, You can indeed use Catalyst without Python. There are two examples in the Examples/Catalyst subdirectory of the source tree to do that. They are CxxVTKPipelineExample and CxxPVSMPipelineExample. I wouldn't recommend this method as the Python route is much simpler. Several people have thought about avoiding the Python interface and generally come around to its flexibility (both ease in creating new Catalyst output as well as making changes without having to recompile code). In my opinion, if you're not doing image output the C++ route is manageable without too much difficulty. For image output there's a lot of things which need to be set in order to get all the lookup tables, data ranges, camera angle, etc. that can get quite complex. If you look at a GUI generated Catalyst script for data extract output and compare it to image output you'll easily see the difference in the complexity. Also, Cinema output is Python driven so that wouldn't be available through a C++ pipeline. Now that I've gone through all of this, is there a specific reason why you're looking to avoid Python? Best, Andy On Wed, Sep 21, 2016 at 9:27 AM, Dorier, Matthieu wrote: > Hi, > > In general the way we create python scripts for a Catalyst-enabled > simulation is by first running the simulation with a Python script that > writes the data into files, then do offline analysis on those files and > export a python script representing the analysis tasks to be done in situ. > > I was wondering if, instead of using a Python script for writing all the > data into file, an equivalent C++ code was available, and how such a code > would be integrated into a Catalyst-enabled simulation? Or maybe just with > VTK once the adaptors are written for the simulation's data? > > Thanks, > > Matthieu > > ___ > 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 > > Search the list archives at: http://markmail.org/search/?q=ParaView > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/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 Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
[Paraview] Catalyst: dump everything in C++
Hi, In general the way we create python scripts for a Catalyst-enabled simulation is by first running the simulation with a Python script that writes the data into files, then do offline analysis on those files and export a python script representing the analysis tasks to be done in situ. I was wondering if, instead of using a Python script for writing all the data into file, an equivalent C++ code was available, and how such a code would be integrated into a Catalyst-enabled simulation? Or maybe just with VTK once the adaptors are written for the simulation's data? Thanks, Matthieu ___ 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 Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview