<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Sep 24, 2014 at 3:03 PM, Alletto, John M <span dir="ltr"><<a href="mailto:john.m.alletto@lmco.com" target="_blank">john.m.alletto@lmco.com</a>></span> wrotAll,<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
I am trying to inset coordinate data into my program line 160 below comes back with a NULL pointer for coordinates.<br>
I did not expect this - what do I do, what does it mean?<br></blockquote><div><br></div><div>Coordinates are not created by default since they take up a lot of memory. You either create the storage manually, or</div><div>use something like this:</div><div><br></div><div> <a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMDASetUniformCoordinates.html">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMDASetUniformCoordinates.html</a></div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
John<br>
<br>
<br>
140 DM coordDA;<br>
141 Vec coordinates;<br>
142: DMDACoor3d ***coords;<br>
143: PetscScalar u, ux, uy, uxx, uyy;<br>
144: PetscReal D, K, hx, hy, hxdhy, hydhx;<br>
145: PetscInt i,j, k;<br>
<br>
<br>
150: D = user->D;<br>
151: K = user->K;<br>
152: hx = 1.0/(PetscReal)(info->mx-1);<br>
153: hy = 1.0/(PetscReal)(info->my-1);<br>
154: hxdhy = hx/hy;<br>
155: hydhx = hy/hx;<br>
156: /*<br>
157: Compute function over the locally owned part of the grid<br>
158: */<br>
159: DMGetCoordinateDA(info->da, &coordDA);<br>
160: DMGetCoordinatesLocal(info->da, &coordinates);<br>
161: DMDAVecGetArray(coordDA, coordinates, &coords);<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener
</div></div>