<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
Hi Dan,<br>
<br>
Yes I already saw the post, but is with python. I just want to send
my data to paraview.<br>
<br>
I translated the related code for the live visu from python to c++.
But I still missing something.<br>
<br>
Can some one look at the code (attached). It is a very simple
adaptor with a very simple vtkCPVTKPipeline.<br>
<br>
The thing is I don't understand the way the vtkLiveInsituLink class
know about the vtkPBTrivialProducer.<br>
<br>
Thanks to all.<br>
<br>
Felipe<br>
<br>
<br>
Le 17/02/2015 21:43, Dan Lipsa a écrit :<br>
<span style="white-space: pre;">> (just a forward of my previous
response to the list)<br>
><br>
> ---------- Forwarded message ----------<br>
> From: *Dan Lipsa* <<a class="moz-txt-link-abbreviated" href="mailto:dan.lipsa@kitware.com">dan.lipsa@kitware.com</a>
<a class="moz-txt-link-rfc2396E" href="mailto:dan.lipsa@kitware.com"><mailto:dan.lipsa@kitware.com></a>><br>
> Date: Tue, Feb 17, 2015 at 12:19 PM<br>
> Subject: Re: [Paraview] Catalyst simple test<br>
> To: Felipe Bordeu <<a class="moz-txt-link-abbreviated" href="mailto:felipe.bordeu@ec-nantes.fr">felipe.bordeu@ec-nantes.fr</a>
<a class="moz-txt-link-rfc2396E" href="mailto:felipe.bordeu@ec-nantes.fr"><mailto:felipe.bordeu@ec-nantes.fr></a>><br>
><br>
><br>
> Hi Felipe,<br>
> Have you seen: <a class="moz-txt-link-freetext" href="http://www.kitware.com/blog/home/post/722">http://www.kitware.com/blog/home/post/722</a>?<br>
><br>
> This blog post shows you how to setup a live connection and
describe a simple pipeline using python.<br>
> 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.<br>
><br>
> We don't have an example with only C++.<br>
> Setting up the visualization pipeline as well as the
connection to catalyst live, while possible, is more involved in
C++.<br>
> Basically, you'll have write in C++ some of the code in
simple.py and coprocessing.py.<br>
><br>
> In your specific case, maybe you are missing the calls to<br>
><br>
> coprocessor.DoLiveVisualization(datadescription, "localhost",
22222)<br>
><br>
> or<br>
> coprocessor.EnableLiveVisualization(True, 1)<br>
><br>
> These are lines from the python coprocessing script that
you'll have to rewrite in C++.<br>
><br>
> Dan<br>
><br>
><br>
> On Tue, Feb 17, 2015 at 10:54 AM, Felipe Bordeu
<<a class="moz-txt-link-abbreviated" href="mailto:felipe.bordeu@ec-nantes.fr">felipe.bordeu@ec-nantes.fr</a>
<a class="moz-txt-link-rfc2396E" href="mailto:felipe.bordeu@ec-nantes.fr"><mailto:felipe.bordeu@ec-nantes.fr></a>> wrote:<br>
><br>
><br>
> Hi everybody,<br>
><br>
> I 'm trying to connect my simulation code (a dummy
simulation code for<br>
> the moment) to paraview using Catalyst to do live
visualization. Just<br>
> make a mesh (2D structured, with 1 field), and send it to
paraview<br>
> without python. But I something is not working. The code
runs, I can<br>
> connect to paraview, pause the simulation but unable to sent
the data<br>
> for the visualization.<br>
><br>
> So I'm doing this : for initialization<br>
><br>
> create a vtkCPProcessor object and call Initialize();<br>
> create a vtkCPPipeline derived object class and added to the
processor (<br>
> Processor->AddPipeline(pipeline.GetPointer()); ) .<br>
> (why do I need a Pipeline if I'm going to send my raw data
(in vtk<br>
> format of course) to paraview?)<br>
> in the CoProcess( vtkCPDataDescription* dataDescription)
member function<br>
> the only relevant lines are :<br>
> vtkNew<vtkPVTrivialProducer> producer;<br>
> vtkImageData* grid =<br>
>
vtkImageData::SafeDownCast(dataDescription->GetInputDescriptionByName("input")->GetGrid());<br>
>
producer->SetOutput(grid,dataDescription->GetTime());<br>
><br>
> create a vtkLiveInsituLink<br>
> LiveLink = vtkLiveInsituLink::New();<br>
> LiveLink->SetInsituPort(22222);<br>
> LiveLink->SetHostname("localhost");<br>
> LiveLink->SetProcessType(vtkLiveInsituLink::INSITU);<br>
> vtkSMProxyManager* proxyManager =
vtkSMProxyManager::GetProxyManager();<br>
> vtkSMSessionProxyManager* sessionProxyManager =<br>
> proxyManager->GetActiveSessionProxyManager();<br>
> LiveLink->Initialize(sessionProxyManager);<br>
><br>
><br>
> then in each time-step I do :<br>
><br>
> vtkCPDataDescription* dataDescription =
vtkCPDataDescription::New();<br>
> dataDescription->AddInput("input");<br>
> dataDescription-> SetTimeData(time, timeStep);<br>
> if(Processor->RequestDataDescription(dataDescription) !=
0){<br>
> // Create a uniform grid<br>
> vtkImageData* grid = vtkImageData::New();<br>
> ....<br>
> ""setextent, create DoubleArray, fill the array, put the
array in the<br>
> grid""<br>
> ...<br>
>
dataDescription->GetInputDescriptionByName("input")->SetGrid(grid);<br>
> grid->Delete();<br>
><br>
> Processor->CoProcess(dataDescription);<br>
><br>
><br>
> (and also the LiveLink code, not sure about this) this is
similar to the<br>
> coprocessing.py<br>
><br>
> while(true){<br>
> LiveLink->InsituUpdate(timeStep, time);<br>
><br>
> LiveLink->InsituPostProcess(time, timeStep);<br>
><br>
> if (LiveLink->GetSimulationPaused()){<br>
> if (LiveLink->WaitForLiveChange()){<br>
> break;<br>
> }<br>
> } else {<br>
> break;<br>
> }<br>
> }<br>
><br>
><br>
> I'm pretty sure I'm mixing the code for the different
examples I found<br>
> on the web and in the sources. I didn't find an example with
pure c++<br>
> and live viz.<br>
> How I can tell to the LiveLink with data I want to sent to
paraview???<br>
><br>
> using ParaView 4.3.1 compiled from git source in linux.<br>
><br>
> Thanks to all.<br>
><br>
><br>
><br>
> _______________________________________________<br>
> Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a> <a class="moz-txt-link-rfc2396E" href="http://www.kitware.com"><http://www.kitware.com></a><br>
><br>
> Visit other Kitware open-source projects at
<a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the ParaView Wiki
at: <a class="moz-txt-link-freetext" href="http://paraview.org/Wiki/ParaView">http://paraview.org/Wiki/ParaView</a><br>
><br>
> Search the list archives at:
<a class="moz-txt-link-freetext" href="http://markmail.org/search/?q=ParaView">http://markmail.org/search/?q=ParaView</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a class="moz-txt-link-freetext" href="http://public.kitware.com/mailman/listinfo/paraview">http://public.kitware.com/mailman/listinfo/paraview</a><br>
><br>
><br>
></span><br>
<br>
- -- <br>
Felipe Bordeu Weldt<br>
Ingénieur de Recherche<br>
- -------------------------------------<br>
Tél. : 33 (0)2 40 37 16 57<br>
Fax. : 33 (0)2 40 74 74 06<br>
<a class="moz-txt-link-abbreviated" href="mailto:Felipe.Bordeu@ec-nantes.fr">Felipe.Bordeu@ec-nantes.fr</a><br>
Institut GeM - UMR CNRS 6183<br>
École Centrale Nantes<br>
1 Rue de La Noë, 44321 Nantes, FRANCE<br>
- -------------------------------------<br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1<br>
<br>
iQEcBAEBAgAGBQJU5KiTAAoJEE/fMfNgU9/DHCoIAMGdM5drdHFmUIFIHf3T5U1D<br>
Pcvfa863Kv2FKAXABVULlICivJKBsDM2gfUOVeUWt5c/UQi+TePoQGWVkB7uch2x<br>
oZKSdz/sYaAsxmnebXJ9R5StBTl+IMIlPKEQclVIbrxj5+5bm2+YE+6lS4mU8aTJ<br>
xqzQl3ZVQtZnBwK7snoMGElDieuEljzIKT5Ygel8nnSwi28lnvxLbi86i4IBjFxR<br>
xW6XUABeMEz9xtJ+gtuwo2XIsqoMS7zfus/rlMlKyYnClEhD6RXLd8naCdBQ8NLD<br>
nECcrNp0nQBnnEG2+Y3sLtqT86nDJUgS471CQpKrONrRZtP8H8T8HP/IFtAPCsY=<br>
=a2l5<br>
-----END PGP SIGNATURE-----<br>
<br>
</body>
</html>