[Paraview] problem in defining vtkStructuredGrid in MPI
Andy Bauer
andy.bauer at kitware.com
Fri Jun 26 09:35:03 EDT 2015
Do you have a node partitioning of your grid? If you do you really need a
cell partitioning of the grid which will have multiple points a the
partition overlap.
Can you share your data?
On Fri, Jun 26, 2015 at 5:58 AM, <u.utku.turuncoglu at be.itu.edu.tr> wrote:
> Hi,
>
> I am trying to create structured grid in an MPI application and i am using
> following C++ code to implement it
>
> extern "C" void createstgrid_(double* y, double* x,
> int* nxstart, int* nxend, int* nystart, int*
> nyend,
> int* nx, int* ny, int* nz, int* mpiSize,
> int* mpiRank) {
> //
> // Create structured grid
> //
> vtkSmartPointer<vtkStructuredGrid> sg =
> vtkSmartPointer<vtkStructuredGrid>::New();
> sg->SetExtent (*nxstart-1, *nxend-1, *nystart-1, *nyend-1, 0, 0);
>
> //
> // Create data structure to store grid coordinates
> //
> int pnx = ((*nxend)-(*nxstart))+1;
> int pny = ((*nyend)-(*nystart))+1;
> vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
>
> //
> // Insert grid coordinate data as points
> //
> k = 0;
> for (int j = 0; j < pny; j++) {
> for (int i = 0; i < pnx; i++) {
> points->InsertPoint(k, x[i+j*pnx], y[i+j*pnx], 0);
> k = k+1;
> }
> }
> sg->SetPoints(points);
>
> //
> // Set grid
> //
>
> vtkCPPythonAdaptorAPI::GetCoProcessorData()->GetInputDescriptionByName("input")->SetGrid(sg);
>
> vtkCPPythonAdaptorAPI::GetCoProcessorData()->GetInputDescriptionByName("input")->SetWholeExtent(0,
> *nx-1, 0, *ny-1, 0, 0);
> }
>
> so, when i run the code with grid writer, it creates the individual file
> (*.vts) for each processor and one extra for the combination (*.pvts).
> Anyway, the individual files looks fine in Paraview but if i open the file
> with pvts extension, i am getting following error,
>
> ERROR: In
>
> /Users/turuncu/Qsync/progs/paraview-4.3.1/src/VTK/IO/XML/vtkXMLPStructuredDataReader.cxx,
> line 461
> vtkXMLPStructuredGridReader (0x7f961c0910a0): No available piece provides
> data for the following extents:
> 0 140 0 1 0 0
> 0 1 1 58 0 0
> 0 140 58 59 0 0
> 0 1 59 114 0 0
> 71 72 1 58 0 0
> 71 72 59 114 0 0
>
> The UpdateExtent cannot be filled.
>
> What is the meaning of this message? It means that some of the grid data
> (or points) are not filled by the code. I also check the loop in the C++
> code and print out the number of points for each processor
>
> 0 number of points = 4118
> 1 number of points = 4047
> 2 number of points = 4060
> 3 number of points = 3990
>
> and the total is 16215, which is consistent with the size of the grid but
> if i check the individual vts files from the Paraview, the files shows
> different number of points for each file
>
> 0 number of points = 4118
> 1 number of points = 3976
> 2 number of points = 4002
> 3 number of points = 3864
>
> So, only first file matchs with the C++ code but others not. I am not sure
> what is happening in there and if you have any suggestion that will be
> great.
>
> Anyway, in this case i did not use vtkMultiBlockDataSet but after having
> correct representation of the grid, i am planing use SetBlock method of
> vtkMultiBlockDataSet to assign decomposition elements as individual
> blocks.
>
> Regards,
>
> --ufuk
>
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20150626/30b8f413/attachment.html>
More information about the ParaView
mailing list