[Paraview] Fwd: Catalyst simple test

Dan Lipsa dan.lipsa at kitware.com
Tue Feb 17 15:43:05 EST 2015


(just a forward of my previous response to the list)

---------- Forwarded message ----------
From: Dan Lipsa <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>


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>
wrote:

>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> 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.
>
> - --
> 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
>
> iQEcBAEBAgAGBQJU42QZAAoJEE/fMfNgU9/DCR8IAIfD2dR2h2RBx5vfpgii6N5q
> ws5vkG9AZf1Jsqdf3fxk25pcB2BJs615I3iEPmlY4SDTUkVmbVzVFvEXX4HXh8+2
> AGX3yNSjfUfAX9RFPsz131FHLt5oG/7cJjmI8343b6JK+cxmznu+elgCpSRV38gp
> yjole85C0SxsZlBBGNXVNTaNyum0tjLVpWMi97fqjLtENTxXjp5gZTy0998edKr1
> f6EqeZ9QySt+T/cWFB/gmQZsX3wwuoPg7fxlYjcMNvLIWBC2VSsAuHlBTRKkhwLn
> Q52A1DNLcMuJ8pOO24/sHr+FldTpzldccTkweRhhV8RQAybw0WWmUf377omk7FA=
> =q2lI
> -----END PGP SIGNATURE-----
>
>
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20150217/c15181ae/attachment.html>


More information about the ParaView mailing list