Hello,

I am trying to use catalyst in our Finite Element framework, but I can't
get it to work right now. For background information, I would like to
inferface a parallel simulation, running with MPI, with paraview to display
the results, thus do live visualization.

I compiled Paraview from the 4.2 sources (from the website) to ensure that
our library compiles with the same library as the ParaView I'm launching.

The problem I have is similar to the one reported in:
http://public.kitware.com/pipermail/paraview/2013-June/028497.html


In our application, we have an exporter interface that allows to write VTK
data (vtkUnstructuredGrid) with field data (scalar, vectorial). I built the
catalyst interoperation on top of it, by using the Cxx example provided in:
https://github.com/Kitware/ParaViewCatalystExampleCode/tree/master/CxxFullExample
<https://github.com/Kitware/ParaViewCatalystExampleCode>
I'm am using a modified version of the feslicescript.py
<https://github.com/Kitware/ParaViewCatalystExampleCode/blob/master/CxxFullExample/SampleScripts/feslicescript.py>
that should enable live visualization IMHO (enclosed with this email).

The excerpt of C++ code running the coprocessing is the following one:
----
vtkSmartPointer<vtkCPDataDescription> dataDescription =
vtkSmartPointer<vtkCPDataDescription>::New();
dataDescription->AddInput("input");

if(inSituProcessor->RequestDataDescription(dataDescription.GetPointer()) !=
0)
{
  dataDescription->GetInputDescriptionByName("input")->SetGrid(out);
  dataDescription->SetForceOutput(true);
  std::cout << "CoProcess " <<
inSituProcessor->CoProcess(dataDescription.GetPointer())<< std::endl;
}
----
where out is the unstructured grid data.

I then launch Paraview and allow connection for catalyst via the menu.
Eventually I launch our simulation that interfaces with Catalyst.

I then get the following error in Paraview:
ERROR: In
/home/ancel/Downloads/ParaView-v4.2.0-source/VTK/Parallel/Core/vtkSocketCommunicator.cxx,
line 812
vtkSocketCommunicator (0x2b1f940): Could not receive tag. 1

And the coprocessing stops in Paraview, altough I can see the catalyst
server in the Pipeline browser and a PVTrivialProducer1 appearing in the
background, but no data appear in the visualization window of Paraview.

I tried instrumenting the code in Paraview to locate where the problem
would be, but it appears that the problem happens outside of the
vtkLiveInsituLink class, which (correct me If I'm wrong) should handle the
link between the application and Paraview.

The different questions that I have would be summed up as:
- Can you give me some pointer as to where the problem might be located ?
Coding mistake on my side ? Did I miss something in the issue I referred to
before ?
- Is it possible to pause the simulation while the user manipulates data in
Paraview ? How ?

Sorry for the long mail, but I tried to be as precise as I could be,
Thanks in advance for the help and your time,

Best regards,
Alexandre Ancel

-- 
Alexandre Ancel
Docteur, Ingénieur de recherche / Phd, Research Engineer
Cemosis <http://www.cemosis.fr> - alexandre.an...@cemosis.fr
Tel: +33 (0)3 68 8*5 02 06*
IRMA - 7, rue René Descartes
67 000 Strasbourg, France
try: paraview.simple
except: from paraview.simple import *

from paraview import coprocessing


#--------------------------------------------------------------
# Code generated from cpstate.py to create the CoProcessor.


# ----------------------- CoProcessor definition -----------------------

def CreateCoProcessor():
  def _CreatePipeline(coprocessor, datadescription):
    class Pipeline:
      dataProd = coprocessor.CreateProducer( datadescription, "input" )

      SetActiveSource(dataProd)

    return Pipeline()

  class CoProcessor(coprocessing.CoProcessor):
    def CreatePipeline(self, datadescription):
      self.Pipeline = _CreatePipeline(self, datadescription)

  coprocessor = CoProcessor()
  #freqs = {'input': [10, 100]}
  freqs = {'input': [1, 1]}
  coprocessor.SetUpdateFrequencies(freqs)
  return coprocessor

#--------------------------------------------------------------
# Global variables that will hold the pipeline for each timestep
# Creating the CoProcessor object, doesn't actually create the ParaView pipeline.
# It will be automatically setup when coprocessor.UpdateProducers() is called the
# first time.
coprocessor = CreateCoProcessor()

#--------------------------------------------------------------
# Enable Live-Visualizaton with ParaView
coprocessor.EnableLiveVisualization(True, 1)


# ---------------------- Data Selection method ----------------------

def RequestDataDescription(datadescription):
    "Callback to populate the request for current timestep"
    global coprocessor
    if datadescription.GetForceOutput() == True:
        # We are just going to request all fields and meshes from the simulation
        # code/adaptor.
        for i in range(datadescription.GetNumberOfInputDescriptions()):
            datadescription.GetInputDescription(i).AllFieldsOn()
            datadescription.GetInputDescription(i).GenerateMeshOn()
        return

    # setup requests for all inputs based on the requirements of the
    # pipeline.
    coprocessor.LoadRequestedData(datadescription)

# ------------------------ Processing method ------------------------

def DoCoProcessing(datadescription):
    "Callback to do co-processing for current timestep"
    global coprocessor

    # Update the coprocessor by providing it the newly generated simulation data.
    # If the pipeline hasn't been setup yet, this will setup the pipeline.
    coprocessor.UpdateProducers(datadescription)

    # Live Visualization, if enabled.
    coprocessor.DoLiveVisualization(datadescription, "localhost", 22222)
_______________________________________________
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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview

Reply via email to