[Paraview] Catalyst simple test

Felipe Bordeu felipe.bordeu at ec-nantes.fr
Tue Feb 17 10:54:06 EST 2015


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




More information about the ParaView mailing list