<div dir="ltr">Hi Felipe,<div>I'll try to take a look at it today.</div><div><br></div><div>Dan</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 18, 2015 at 9:58 AM, Felipe Bordeu <span dir="ltr"><<a href="mailto:felipe.bordeu@ec-nantes.fr" target="_blank">felipe.bordeu@ec-nantes.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"><span class="">
<br>
-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br></span>
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-wrap"><span class="">> (just a forward of my previous
response to the list)<br>
><br>
> ---------- Forwarded message ----------<br></span><span class="">
> From: *Dan Lipsa* <<a href="mailto:dan.lipsa@kitware.com" target="_blank">dan.lipsa@kitware.com</a>
<a href="mailto:dan.lipsa@kitware.com" target="_blank"><mailto:dan.lipsa@kitware.com></a>><br>
> Date: Tue, Feb 17, 2015 at 12:19 PM<br>
> Subject: Re: [Paraview] Catalyst simple test<br></span><span class="">
> To: Felipe Bordeu <<a href="mailto:felipe.bordeu@ec-nantes.fr" target="_blank">felipe.bordeu@ec-nantes.fr</a>
<a href="mailto:felipe.bordeu@ec-nantes.fr" target="_blank"><mailto:felipe.bordeu@ec-nantes.fr></a>><br>
><br>
><br>
> Hi Felipe,<br>
> Have you seen: <a href="http://www.kitware.com/blog/home/post/722" target="_blank">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></span><div><div class="h5">
> On Tue, Feb 17, 2015 at 10:54 AM, Felipe Bordeu
<<a href="mailto:felipe.bordeu@ec-nantes.fr" target="_blank">felipe.bordeu@ec-nantes.fr</a>
<a href="mailto:felipe.bordeu@ec-nantes.fr" target="_blank"><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></div></div>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a> <a href="http://www.kitware.com" target="_blank"><http://www.kitware.com></a><span class=""><br>
><br>
> Visit other Kitware open-source projects at
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the ParaView Wiki
at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
><br>
> Search the list archives at:
<a href="http://markmail.org/search/?q=ParaView" target="_blank">http://markmail.org/search/?q=ParaView</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://public.kitware.com/mailman/listinfo/paraview" target="_blank">http://public.kitware.com/mailman/listinfo/paraview</a><br>
><br>
><br>
></span></span><br><span class="">
<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 href="mailto:Felipe.Bordeu@ec-nantes.fr" target="_blank">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></span>
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>
</div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" target="_blank">http://markmail.org/search/?q=ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/paraview" target="_blank">http://public.kitware.com/mailman/listinfo/paraview</a><br>
<br></blockquote></div><br></div>