[petsc-users] How to use

Patrick Sanan patrick.sanan at gmail.com
Thu Oct 2 12:34:55 CDT 2014


On 10/2/14 7:26 PM, Sharp Stone wrote:
> Hi Matt and Jed,
>
> Thank you very much for your replies. In source code ex19, the routine 
> SNESSetNGS() is used, and no other options or Jacobi routines are 
> used. How can we change the iteration method? The routine 
> SNESSetFromOptions(snes) could do this for the user? If I understand 
> correctly, petsc would use Gauss-Seidel or Jacobi method as designated 
> with even the same source code?
Yes, and this applies for other objects as well. The important thing, in 
general, is to call XXXSetFromOptions after you have set any default 
options with XXXSetYYY, but before you call XXXSetUp (which does things 
like allocate memory). This allows you to set whichever defaults make 
sense, and also control things from the command line.
>
> Thank you in advance!
>
> On Thu, Oct 2, 2014 at 1:12 PM, Jed Brown <jed at jedbrown.org 
> <mailto:jed at jedbrown.org>> wrote:
>
>     Sharp Stone <thronesf at gmail.com <mailto:thronesf at gmail.com>> writes:
>
>     > Matt,
>     >
>     > Thank you very much!
>     >
>     > The ex19 used the Gauss-Seidel method. But I'm a little bit
>     wonder whether
>     > we have any examples of Jacobi method to solve such linear
>     systems "(mat)A
>     > dot (vec)X = (vec)B" with dof>1? Thanks in advance!
>
>     ex19 does whatever you want: -pc_type jacobi and the like.
>
>
>
>
> -- 
> Best regards,
>
> Feng

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20141002/a4fcbd6f/attachment.html>


More information about the petsc-users mailing list