[Paraview] [catalyst]how to transfer the simulation grid coordinates to the vtkImageData grid
刘楚高
frank1985876 at gmail.com
Fri Apr 14 07:59:01 EDT 2017
hi, all
In Catalyst example "Fortran90FullExample" -> "FECxxAdaptor.cxx"->"createcpi
magedata_", 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/667842d9/attachment.html>
More information about the ParaView
mailing list