[Paraview] Fwd: Catalyst simple test
Felipe Bordeu
felipe.bordeu at ec-nantes.fr
Wed Feb 18 09:58:33 EST 2015
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
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>>
> 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>>
>
>
> 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>> 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>
>
> 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
iQEcBAEBAgAGBQJU5KiTAAoJEE/fMfNgU9/DHCoIAMGdM5drdHFmUIFIHf3T5U1D
Pcvfa863Kv2FKAXABVULlICivJKBsDM2gfUOVeUWt5c/UQi+TePoQGWVkB7uch2x
oZKSdz/sYaAsxmnebXJ9R5StBTl+IMIlPKEQclVIbrxj5+5bm2+YE+6lS4mU8aTJ
xqzQl3ZVQtZnBwK7snoMGElDieuEljzIKT5Ygel8nnSwi28lnvxLbi86i4IBjFxR
xW6XUABeMEz9xtJ+gtuwo2XIsqoMS7zfus/rlMlKyYnClEhD6RXLd8naCdBQ8NLD
nECcrNp0nQBnnEG2+Y3sLtqT86nDJUgS471CQpKrONrRZtP8H8T8HP/IFtAPCsY=
=a2l5
-----END PGP SIGNATURE-----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20150218/eebc59c4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: C++LiveVisuTest.tar.gz
Type: application/gzip
Size: 2648 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview/attachments/20150218/eebc59c4/attachment.bin>
More information about the ParaView
mailing list