Re: [petsc-users] Matrix dot product

2017-09-10 Thread Matthew Knepley
On Sun, Sep 10, 2017 at 5:51 PM, David Gross wrote: > Hello, > I was wondering if there was a matrix equivalent to the vecDot function > (Frobenius inner product)? As far as I can tell the closest thing is > MatNorm with NORM_FROBENIUS, but obviously this is acting on only

[petsc-users] Matrix dot product

2017-09-10 Thread David Gross
Hello, I was wondering if there was a matrix equivalent to the vecDot function (Frobenius inner product)? As far as I can tell the closest thing is MatNorm with NORM_FROBENIUS, but obviously this is acting on only one matrix. If there is not a built in function, what is the best way to compute

Re: [petsc-users] Example for solving system of pde with snes

2017-09-10 Thread Jed Brown
Matthew Knepley writes: > On Sun, Sep 10, 2017 at 9:15 AM, Praveen C wrote: > >> >> >>> >>> You can use SNESSetJacobian, but DMSNESSetJacobianLocal is more >>> convenient in my opinion. >>> >>> > I still have some doubt. If >>> > >>> > da0 --> for residual

Re: [petsc-users] Example for solving system of pde with snes

2017-09-10 Thread Matthew Knepley
On Sun, Sep 10, 2017 at 9:15 AM, Praveen C wrote: > > >> >> You can use SNESSetJacobian, but DMSNESSetJacobianLocal is more >> convenient in my opinion. >> >> > I still have some doubt. If >> > >> > da0 --> for residual >> > da1 --> for jacobian >> > >> > I still need to call

Re: [petsc-users] Example for solving system of pde with snes

2017-09-10 Thread Praveen C
> > > You can use SNESSetJacobian, but DMSNESSetJacobianLocal is more > convenient in my opinion. > > > I still have some doubt. If > > > > da0 --> for residual > > da1 --> for jacobian > > > > I still need to call SNESetDM. So here I pass da0 ? But then how will > snes > > know about da1 ? > >

Re: [petsc-users] Example for solving system of pde with snes

2017-09-10 Thread Jed Brown
Praveen C writes: > Hello Matt > > >> No. You want 2 DAs, 1 for evaluating residuals with s = 3, and one for >> making a Jacobian with s = 1. You give these >> two DAs to >> >> http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/ >> DMDASNESSetFunctionLocal.html

Re: [petsc-users] Example for solving system of pde with snes

2017-09-10 Thread Jed Brown
Praveen C writes: > Dear all > > I am solving 3 coupled first order PDE in 2-D with SNES. The stencil is > (3+1+3) in both directions due to weno scheme. I want to use matrix-free > gmres. For preconditioner, I will use first order scheme with stencil > (1+1+1) in both

Re: [petsc-users] Example for solving system of pde with snes

2017-09-10 Thread Praveen C
Hello Matt > No. You want 2 DAs, 1 for evaluating residuals with s = 3, and one for > making a Jacobian with s = 1. You give these > two DAs to > > http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/ > DMDASNESSetFunctionLocal.html >

Re: [petsc-users] Example for solving system of pde with snes

2017-09-10 Thread Matthew Knepley
On Sun, Sep 10, 2017 at 2:39 AM, Praveen C wrote: > Dear all > > I am solving 3 coupled first order PDE in 2-D with SNES. The stencil is > (3+1+3) in both directions due to weno scheme. I want to use matrix-free > gmres. For preconditioner, I will use first order scheme with

[petsc-users] Example for solving system of pde with snes

2017-09-10 Thread Praveen C
Dear all I am solving 3 coupled first order PDE in 2-D with SNES. The stencil is (3+1+3) in both directions due to weno scheme. I want to use matrix-free gmres. For preconditioner, I will use first order scheme with stencil (1+1+1) in both directions. I am using DMDA. Two things that I am