[petsc-users] DMDACoor3d and VecView
Jed Brown
jedbrown at mcs.anl.gov
Thu May 23 10:10:19 CDT 2013
Roc Wang <pengxwang at hotmail.com> writes:
> The coordinates of nodes are needed to plot the 3-D distributions of
> the solution. The matrix and the vector are managed with DMDA, so the
> array for the coordinates can be obtained by
> DMDAGetCoordinateDA(da,&cda) and DMDAVecGetArray(cda,gc,&coors).
> Here, coors is defined as DMDACoor3d ***coors. Since the function
> VecVeiw can only output one vector, Vec sol, to a binary file , the
> array of coordinates must be output to another file and thus must be
> read separately.
Not true, just read them in the same order you wrote them.
> The problem is that the array of coordinates is local array and the
> number of processes in the post-processing program must be same as
> that in the solver.
DMGetCoordinates() returns a global Vec. Store that, not the local Vec.
>From the names, you must have an older version of PETSc. Please upgrade
to petsc-3.4.
More information about the petsc-users
mailing list