[petsc-users] Using /src/ksp/ksp/example/tutorial/ex29.c to solve Poisson Equation Twice

Matthew Knepley knepley at gmail.com
Mon Oct 3 12:06:20 CDT 2011


On Mon, Oct 3, 2011 at 12:00 PM, Alan Wei <zhenglun.wei at gmail.com> wrote:

> Dear all,
>     I still have the problem. >_<
>     I can not find the DMMG interface provided to change the RHS, mentioned
> by Dr. Smith. The only thing I have is DMMGSetKSP(). It is
> DMMGSetKSP(dmmg,ComputeRHS,ComputeMatrix).When I use it first time in this
> example, it calls both ComputeRHS and ComputeMatrix (I assert some print-out
> probes inside these two functions). However, If I use it again, it just does
> not call the new one; rather, it calls the old one.
>      My code is attached. Could you please help me to fix this problem ^_^.
>

Yes, this is the way DMMG works. It can only be setup once. This is a severe
limitation, which is why we
have discontinued its use. If you look at ex50.c, we show how to transform
ex19 into a code using SetDM
instead of DMMG. You can then reset the DMDA rhs function at each iteration.

  Thanks,

     Matt


> best,
> Alan
>
> On Sun, Oct 2, 2011 at 5:52 PM, Alan Wei <zhenglun.wei at gmail.com> wrote:
>
>> In this example, i recalled the ComputeRHS.
>>
>> Alan
>>
>>
>> On Sun, Oct 2, 2011 at 5:22 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
>>
>>> On Sun, Oct 2, 2011 at 16:31, Alan Wei <zhenglun.wei at gmail.com> wrote:
>>>
>>>> BTW, what is the DMMG interface you are talking about? is it
>>>> DMMGSetKSP()?
>>>
>>>
>>> Every object and function containing "DMMG" will be removed. (I don't
>>> think we've decided on a precise timeline, but don't write new code that
>>> uses DMMG.)
>>>
>>>
>>>> if so, that's is my problem. At the 2nd time of using DMMGSetKSP() in
>>>> the main function, it does not call the __function__ to compute the right
>>>> hand side. >_< any suggestions on that?
>>>
>>>
>>> What function is being called?
>>>
>>
>>
>


-- 
What most experimenters take for granted before they begin their experiments
is infinitely more interesting than any results to which their experiments
lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111003/488af4b2/attachment.htm>


More information about the petsc-users mailing list