[Paraview] [paraview][catalyst]

刘楚高 frank1985876 at gmail.com
Fri Apr 14 07:54:22 EDT 2017


hi, all

In Catalyst example "Fortran90FullExample" -> "FECxxAdaptor.cxx"->"
createcpimagedata_", the grid is new and has no coordinates. So, how to
transfer the simulation grid coordinates to this vtkImageData grid?

Thank you!

extern "C" void createcpimagedata_(int* nxstart, int* nxend, int* nx,

                                   int* ny, int* nz)

{

  if (!vtkCPPythonAdaptorAPI::GetCoProcessorData())

    {

    vtkGenericWarningMacro("Unable to access CoProcessorData.");

    return;

    }


  // The simulation grid is a 3-dimensional topologically and geometrically

  // regular grid. In VTK/ParaView, this is considered an image data set.

  vtkSmartPointer<vtkImageData> grid = vtkSmartPointer<vtkImageData>::New();


  grid->SetExtent(*nxstart-1, *nxend-1, 0, *ny-1, 0, *nz-1);


  // Name should be consistent between here, Fortran and Python client
script.

  vtkCPPythonAdaptorAPI::GetCoProcessorData()->GetInputDescriptionByName(
"input")->SetGrid(grid);

  vtkCPPythonAdaptorAPI::GetCoProcessorData()->GetInputDescriptionByName(
"input")->SetWholeExtent(0, *nx-1, 0, *ny-1, 0, *nz-1);

}

-- 
中国空气动力研究与发展中心 计算空气动力研究所
Blog: http://blog.donews.com/frank777
MSN: frank1985876 at hotmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20170414/c88a7273/attachment.html>


More information about the ParaView mailing list