[petsc-users] Setting coordinates

Alletto, John M john.m.alletto at lmco.com
Wed Sep 24 15:03:14 CDT 2014


All,

I am trying to inset coordinate data into my program line 160 below comes back with a NULL pointer for coordinates.
I did not expect this - what do I do, what does it mean?


John


140   DM             coordDA;
141   Vec            coordinates;
142:   DMDACoor3d     ***coords;
143:   PetscScalar    u, ux, uy, uxx, uyy;
144:   PetscReal      D, K, hx, hy, hxdhy, hydhx;
145:   PetscInt       i,j, k;


150:   D      = user->D;
151:   K      = user->K;
152:   hx     = 1.0/(PetscReal)(info->mx-1);
153:   hy     = 1.0/(PetscReal)(info->my-1);
154:   hxdhy  = hx/hy;
155:   hydhx  = hy/hx;
156:   /*
157:      Compute function over the locally owned part of the grid
158:   */
159:   DMGetCoordinateDA(info->da, &coordDA);
160:   DMGetCoordinatesLocal(info->da, &coordinates);
161:   DMDAVecGetArray(coordDA, coordinates, &coords);


More information about the petsc-users mailing list