[Paraview] Fwd: Catalyst simple test

Felipe Bordeu felipe.bordeu at ec-nantes.fr
Fri Feb 20 07:25:33 EST 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I make it work but using the python
interface(vtkCPPythonScriptPipeline). I think for my case is easier to
build pipelines with the Catalyst plugin for paraview. And anyway my
paraview is already compiled with python.

Thanks to all for this great feature.

Felipe
 

Le 18/02/2015 16:18, Dan Lipsa a écrit :
> Hi Felipe,
> I'll try to take a look at it today.
>
> Dan
>
>
> On Wed, Feb 18, 2015 at 9:58 AM, Felipe Bordeu
<felipe.bordeu at ec-nantes.fr <mailto:felipe.bordeu at ec-nantes.fr>> wrote:
>
>
> Hi Dan,
>
> Yes I already saw the post, but is with python. I just want to send my
data to paraview.
>
> I translated the related code for the live visu from python to c++.
But I still missing something.
>
> Can some one look at the code (attached). It is a very simple adaptor
with a very simple vtkCPVTKPipeline.
>
> The thing is I don't understand the way the vtkLiveInsituLink class
know about the vtkPBTrivialProducer.
>
> Thanks to all.
>
> Felipe
>
>
> Le 17/02/2015 21:43, Dan Lipsa a écrit :
> > (just a forward of my previous response to the list)
>
> > ---------- Forwarded message ----------
> > From: *Dan Lipsa* <dan.lipsa at kitware.com
<mailto:dan.lipsa at kitware.com> <mailto:dan.lipsa at kitware.com>
<mailto:dan.lipsa at kitware.com>>
> > Date: Tue, Feb 17, 2015 at 12:19 PM
> > Subject: Re: [Paraview] Catalyst simple test
> > To: Felipe Bordeu <felipe.bordeu at ec-nantes.fr
<mailto:felipe.bordeu at ec-nantes.fr> <mailto:felipe.bordeu at ec-nantes.fr>
<mailto:felipe.bordeu at ec-nantes.fr>>
>
>
> > Hi Felipe,
> > Have you seen: http://www.kitware.com/blog/home/post/722?
>
> > This blog post shows you how to setup a live connection and describe
a simple pipeline using python.
> > The pipeline was generated from Tools/Manage Plugins, Catalyst
Script Generator Plugin, Load Selected. Then you can build your pipeline
and export it using CoProcessing, Export State.
>
> > We don't have an example with only C++.
> > Setting up the visualization pipeline as well as the connection to
catalyst live, while possible, is more involved in C++.
> > Basically, you'll have write in C++ some of the code in simple.py
and coprocessing.py.
>
> > In your specific case, maybe you are missing the calls to
>
> > coprocessor.DoLiveVisualization(datadescription, "localhost", 22222)
>
> > or
> > coprocessor.EnableLiveVisualization(True, 1)
>
> > These are lines from the python coprocessing script that you'll have
to rewrite in C++.
>
> > Dan
>
>
> > On Tue, Feb 17, 2015 at 10:54 AM, Felipe Bordeu
<felipe.bordeu at ec-nantes.fr <mailto:felipe.bordeu at ec-nantes.fr>
<mailto:felipe.bordeu at ec-nantes.fr> <mailto:felipe.bordeu at ec-nantes.fr>>
wrote:
>
>
> > Hi everybody,
>
> > I 'm trying to connect  my simulation code (a dummy simulation code for
> > the moment) to paraview using Catalyst to do live visualization. Just
> > make a mesh (2D structured, with 1 field), and send it to paraview
> > without python. But I something is not working. The code runs, I can
> > connect to paraview, pause the simulation but unable to sent the data
> > for the visualization.
>
> > So I'm doing this : for initialization
>
> > create a vtkCPProcessor object and call Initialize();
> > create a vtkCPPipeline derived object class and added to the processor (
> > Processor->AddPipeline(pipeline.GetPointer());  ) .
> > (why do I need a Pipeline if I'm going to send my raw data (in vtk
> > format of course) to paraview?)
> > in the CoProcess( vtkCPDataDescription* dataDescription) member function
> > the only relevant lines are :
> >   vtkNew<vtkPVTrivialProducer> producer;
> >   vtkImageData* grid =
> >
vtkImageData::SafeDownCast(dataDescription->GetInputDescriptionByName("input")->GetGrid());
> >    producer->SetOutput(grid,dataDescription->GetTime());
>
> > create a vtkLiveInsituLink
> >    LiveLink = vtkLiveInsituLink::New();
> >    LiveLink->SetInsituPort(22222);
> >    LiveLink->SetHostname("localhost");
> >    LiveLink->SetProcessType(vtkLiveInsituLink::INSITU);
> >    vtkSMProxyManager* proxyManager =
vtkSMProxyManager::GetProxyManager();
> >    vtkSMSessionProxyManager* sessionProxyManager =
> > proxyManager->GetActiveSessionProxyManager();
> >    LiveLink->Initialize(sessionProxyManager);
>
>
> > then in each time-step I do :
>
> >   vtkCPDataDescription* dataDescription = vtkCPDataDescription::New();
> >   dataDescription->AddInput("input");
> >   dataDescription-> SetTimeData(time, timeStep);
> >   if(Processor->RequestDataDescription(dataDescription) != 0){
> >    // Create a uniform grid
> >    vtkImageData* grid = vtkImageData::New();
> >    ....
> >   ""setextent, create DoubleArray, fill the array, put the array in the
> > grid""
> >    ...
> >    dataDescription->GetInputDescriptionByName("input")->SetGrid(grid);
> >    grid->Delete();
>
> >   Processor->CoProcess(dataDescription);
>
>
> > (and also the LiveLink code, not sure about this) this is similar to the
> > coprocessing.py
>
> >    while(true){
> >      LiveLink->InsituUpdate(timeStep, time);
>
> >      LiveLink->InsituPostProcess(time, timeStep);
>
> >       if (LiveLink->GetSimulationPaused()){
> >          if (LiveLink->WaitForLiveChange()){
> >            break;
> >          }
> >       } else {
> >            break;
> >       }
> >    }
>
>
> > I'm pretty sure I'm mixing the code for the different examples I found
> > on the web and in the sources. I didn't find an example with pure c++
> > and live viz.
> > How I can tell to the LiveLink with data I want to sent to paraview???
>
> > using ParaView 4.3.1 compiled from git source in linux.
>
> > Thanks to all.
>
>
>
> >     _______________________________________________
> >     Powered by www.kitware.com <http://www.kitware.com>
<http://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 <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
>
>

- -- 
Felipe Bordeu Weldt
Ingénieur de Recherche
- -------------------------------------
Tél. : 33 (0)2 40 37 16 57
Fax. : 33 (0)2 40 74 74 06
Felipe.Bordeu at ec-nantes.fr
Institut GeM - UMR CNRS 6183
École Centrale Nantes
1 Rue de La Noë, 44321 Nantes, FRANCE
- -------------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBAgAGBQJU5yetAAoJEE/fMfNgU9/DpdEH/ipOx/aHWDpTVOOvQG7p58He
goKZiQnY/ZqLYlI9m4RqUoht2idqinxClHlRmDv3aPRuMz5HKmUR2hi02vIMJvu9
WhOfx1seUkpME3RDmr+TZlanWJ/myomDbO1pH4nh1GHWmQvobSWKtBaklroXvorC
9Ou0PvwAcuT3YBbtyIyw3WJfyKBDUS6t5XEAfND8tasaa8rmZR8jp4FTFCazz+QS
RZA8VdyS5vba1MMNVTPVLwoW6RtfQO1/KcMFtVSOfvvJTNPO5oElxjmY7Gk8fRhi
ppkmpWLhHUebqbe8Jvvo9gDvqzEHfKFJZPqZFiDk5piNx0gcMCvoA1N9cJ7TXxs=
=Y8TT
-----END PGP SIGNATURE-----

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20150220/d0f6f5aa/attachment.html>


More information about the ParaView mailing list