<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Thank you, Dr. Brown, for pointing me out this example. However, I
met a problem when I was trying to modify it. <br>
I added a 'OutputFunction' subroutine to access the solution
data by using DMDAGetVecArray. I tried it with single process, it
keeps giving me this error:<br>
[0]PETSC ERROR: --------------------- Error Message
------------------------------------<br>
[0]PETSC ERROR: Null argument, when expecting valid pointer!<br>
[0]PETSC ERROR: Null Object: Parameter # 1!<br>
[0]PETSC ERROR:
------------------------------------------------------------------------<br>
[0]PETSC ERROR: Petsc Development HG revision:
85e6055943e0711fccdec2d08caeba48971d3d55 HG Date: Fri Sep 23
14:46:14 2011 -0700<br>
[0]PETSC ERROR: See docs/changes/index.html for recent updates.<br>
[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.<br>
[0]PETSC ERROR: See docs/index.html for manual pages.<br>
[0]PETSC ERROR:
------------------------------------------------------------------------<br>
[0]PETSC ERROR: ./ex45 on a arch-linu named
l2118a-linux.soecs.ku.edu by zlwei Mon Apr 9 17:11:02 2012<br>
[0]PETSC ERROR: Libraries linked from
/home/zlwei/soft/mercurial/petsc-dev/arch-linux2-c-debug/lib<br>
[0]PETSC ERROR: Configure run at Fri Sep 23 17:13:32 2011<br>
[0]PETSC ERROR: Configure options --download-f-blas-lapack=1
--download-mpich=1 --with-cc=gcc --with-fc=gfortran
PETSC_ARCH=arch-linux2-c-debug<br>
[0]PETSC ERROR:
------------------------------------------------------------------------<br>
[0]PETSC ERROR: DMDAVecGetArray() line 51 in
src/dm/impls/da/dagetarray.c<br>
<br>
My code is attached. <br>
<br>
thanks in advance,<br>
Alan<br>
<br>
On 4/7/2012 5:30 PM, Jed Brown wrote:
<blockquote
cite="mid:CAM9tzSkfgnp9yZwPjRVdfDTbn9=SN7-e52YbbZRQF3oDqga83g@mail.gmail.com"
type="cite">
<div class="gmail_quote">On Sat, Apr 7, 2012 at 17:28, Jed Brown <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:jedbrown@mcs.anl.gov">jedbrown@mcs.anl.gov</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">
<div class="gmail_quote">On Sat, Apr 7, 2012 at 17:18, Alan
Wei <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:zhenglun.wei@gmail.com" target="_blank">zhenglun.wei@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>Thanks Dr. Brown,
<div> It works. I made a wrong comment command so
that the code did not go through the compilation. So
it gives the same error message since I ran the old
version of execution file.</div>
<div> BTW, this ex29.c is a solver for 2D poisson
equation. I wonder if there is any 3D Poisson
Equation solver in PETSc code?</div>
</div>
</blockquote>
</div>
<br>
</div>
<div><a moz-do-not-send="true"
href="http://www.mcs.anl.gov/petsc/petsc-dev/src/ksp/ksp/examples/tutorials/ex45.c.html"
target="_blank">http://www.mcs.anl.gov/petsc/petsc-dev/src/ksp/ksp/examples/tutorials/ex45.c.html</a></div>
</blockquote>
</div>
<br>
<div>I also see that your petsc-dev is from several months ago,
you may want to update because the interface has been simplified
slightly (the old thing still works, but this is somewhat
simpler).</div>
</blockquote>
<br>
</body>
</html>