<div dir="ltr"><div>Hi everyone,</div><div><br></div><div>I think VTK is not the best option to save files, but I just want a quick way to visualize a structured grid generated with DMDACreate3d. I visualize the vts file with ParaView.</div><div><br></div><div>The situation is, If I change the number global dimension in each direction of the array (<b>M,N,P </b>parameters for DMDACreate3d) it is supposed that the size of the mesh won't changes, ONLY the number of division in the affected direction, but it does NOT happen  ( I used DMDASetUniformCoordinates to have an  uniform grid ). When I save the file, and then check it with ParaView, the size changes. (I checked the coordinates with DMGetCoordinates everything is OK, size and division), the problem is in the visualization using VTK. </div><div><br></div><div>I use the next set of functions to save the file.<br></div><div><br></div><div></div><div>ierr = PetscViewerVTKOpen(PETSC_COMM_WORLD,"nodes_coord.vts",FILE_MODE_WRITE,&view); CHKERRQ(ierr);<br>ierr = DMGetCoordinates(da_nodes,&v1); CHKERRQ(ierr); // borrowed reference<br>ierr = VecView(coord,view);CHKERRQ(ierr);</div><div><br></div><div>Then, I realize that if I create a vector with DMCreateGlobalVector and then copy in it the coordinate from DMGetCoordinates, the size remains unchanged (in the visualization) and just the number of elements along the direction change (when I modify M,N,P).<br></div><div><br></div><div>ierr = PetscViewerVTKOpen(PETSC_COMM_WORLD,"nodes_coord.vts",FILE_MODE_WRITE,&view); CHKERRQ(ierr);<br>ierr = DMGetCoordinates(da_nodes,&v1); CHKERRQ(ierr); // borrowed reference</div><div>ierr = DMCreateGlobalVector(da_nodes,&coord); CHKERRQ(ierr);<br>ierr = VecCopy(v1,coord); CHKERRQ(ierr);<br>ierr = VecView(coord,view);CHKERRQ(ierr);</div><div><br></div><div><b>There is something wrong with PetscViewerVTKOpen or it's just the approach that I used?</b></div><div><br></div><div>Kind regards.<br></div><div><br></div><div><br></div></div>