[petsc-users] Recommended examples for using KSP and multigrid with DM

Matthew Knepley knepley at gmail.com
Sun Apr 12 04:38:52 CDT 2015


On Sat, Apr 11, 2015 at 7:03 PM, TAY wee-beng <zonexo at gmail.com> wrote:

> Hi,
>
> I'm using DMDA. The LHS of the poisson eqn is fixed, only the RHS changes.
>
> I thought I can't find ex29.c in the current ver of PETSc, so I thought
> it's no longer valid. Do I always have to get the jacobian as in ex29 to
> solve the Poisson eqn?
>

It is there:


https://bitbucket.org/petsc/petsc/src/0dbc604a2409e3ecaa129deb24062cf2be4d41a7/src/ksp/ksp/examples/tutorials/ex29.c?at=master


> What about a good ex. using KSPBCGS to solve my momentum eqn with DMDA?
>

All examples are independent of the precise Krylov method. You can use that
anywhere:

  cd src/snes/examples/tutorials
  make ex5
  ./ex5 -ksp_type bcgs

  Thanks,

     Matt


> Thank you.
>
> Yours sincerely,
>
> TAY wee-beng
>
> On 4/11/2015 6:43 AM, Barry Smith wrote:
>
>>    Are you using DMDA or DMPLEX or some other DM? Does the Poisson
>> equation change (variable coefficient) or is it a constant coefficient with
>> the same values for all solves? ex29.c could still possibly serve as a
>> model for the Poisson subproblem, why do you say it is no longer valid?
>>
>>    Barry
>>
>>
>>  On Apr 8, 2015, at 10:18 PM, TAY wee-beng <zonexo at gmail.com> wrote:
>>>
>>> Hi,
>>>
>>> I was following example ex29 in the past to write the code to solve my
>>> Poisson eqn using DM. Now it seems that ex29 is no longer valid. Which
>>> example should I follow now?
>>>
>>> Also, I am using KSPBCGS to solve my momentum eqn in the past. Do I need
>>> to change much if I'm now using DM? If so, what is a good example?
>>>
>>> --
>>> Thank you
>>>
>>> Yours sincerely,
>>>
>>> TAY wee-beng
>>>
>>>
>


-- 
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/20150412/374c6849/attachment.html>


More information about the petsc-users mailing list