Re: [petsc-users] SNES: approximating the Jacobian with computed residuals?

2014-04-22 Thread Peter Brune
I accidentally forgot to reply to the list; resending. On Tue, Apr 22, 2014 at 4:55 PM, Peter Brune wrote: > > > > On Tue, Apr 22, 2014 at 4:40 PM, Fischer, Greg A. < > fisch...@westinghouse.com> wrote: > >> >> >> >> >> *From:* Peter Brune [mailto:prbr...@gmail.com] >> *Sent:* Tuesday, April 22

Re: [petsc-users] SNES: approximating the Jacobian with computed residuals?

2014-04-22 Thread Fischer, Greg A.
From: Peter Brune [mailto:prbr...@gmail.com] Sent: Tuesday, April 22, 2014 12:44 PM To: Fischer, Greg A. Cc: petsc-users@mcs.anl.gov Subject: Re: [petsc-users] SNES: approximating the Jacobian with computed residuals? On Tue, Apr 22, 2014 at 10:56 AM, Fischer, Greg A. mailto:fisch...@westing

Re: [petsc-users] SNES: approximating the Jacobian with computed residuals?

2014-04-22 Thread Barry Smith
On Apr 22, 2014, at 11:47 AM, Peter Brune wrote: > -snes_view would also be useful for basic santity checks. and -snes_monitor ? > > > On Tue, Apr 22, 2014 at 11:43 AM, Peter Brune wrote: > > > > On Tue, Apr 22, 2014 at 10:56 AM, Fischer, Greg A. > wrote: > > > From: Peter Brune

Re: [petsc-users] MATLAB and PetSc

2014-04-22 Thread Barry Smith
PETSc does have a MATLAB interface in bin/matlab/classes that provides most of PETSc’s functionality directly to Matlab. Unfortunately we do not have the resources to maintain it, so it is a bit broken. If you are familiar with MATLAB and interfacing with C then git it a try and we can provid

Re: [petsc-users] MATLAB and PetSc

2014-04-22 Thread Sudheer Kumar
On Tue, Apr 22, 2014 at 9:41 PM, Barry Smith wrote: > How much Matlab code do you have that computes the Jacobian and functions > and is it parallel? How much Matlab code do you have that computes the Jacobian and functions and is it parallel? The MATLAB code that I am working with is of 1000s

Re: [petsc-users] SNES: approximating the Jacobian with computed residuals?

2014-04-22 Thread Peter Brune
-snes_view would also be useful for basic santity checks. On Tue, Apr 22, 2014 at 11:43 AM, Peter Brune wrote: > > > > On Tue, Apr 22, 2014 at 10:56 AM, Fischer, Greg A. < > fisch...@westinghouse.com> wrote: > >> >> >> *From:* Peter Brune [mailto:prbr...@gmail.com] >> *Sent:* Tuesday, April 22,

Re: [petsc-users] SNES: approximating the Jacobian with computed residuals?

2014-04-22 Thread Peter Brune
On Tue, Apr 22, 2014 at 10:56 AM, Fischer, Greg A. < fisch...@westinghouse.com> wrote: > > > *From:* Peter Brune [mailto:prbr...@gmail.com] > *Sent:* Tuesday, April 22, 2014 10:16 AM > *To:* Fischer, Greg A. > *Cc:* petsc-users@mcs.anl.gov > *Subject:* Re: [petsc-users] SNES: approximating the Jac

Re: [petsc-users] [beginner question] Different communicators in the two objects: Argument # 1 and 2 flag 3!

2014-04-22 Thread Barry Smith
Call BOTH the AssemblyBegin() and End AFTER you have called the set values routines. Barry Yes, you could argue it is confusing terminology. On Apr 22, 2014, at 11:32 AM, Niklas Fischer wrote: > Hello Barry, > > Am 22.04.2014 18:08, schrieb Barry Smith: >> On Apr 22, 2014, at 10:23

Re: [petsc-users] [beginner question] Different communicators in the two objects: Argument # 1 and 2 flag 3!

2014-04-22 Thread Niklas Fischer
Hello Barry, Am 22.04.2014 18:08, schrieb Barry Smith: On Apr 22, 2014, at 10:23 AM, Niklas Fischer wrote: I have tracked down the problem further and it basically boils down to the following question: Is it possible to use MatSetValue(s) to set values which are owned by other processes?

Re: [petsc-users] [beginner question] Different communicators in the two objects: Argument # 1 and 2 flag 3!

2014-04-22 Thread Barry Smith
On Apr 22, 2014, at 10:23 AM, Niklas Fischer wrote: > I have tracked down the problem further and it basically boils down to the > following question: Is it possible to use MatSetValue(s) to set values which > are owned by other processes? Yes it is certainly possible. You should not set a

Re: [petsc-users] MATLAB and PetSc

2014-04-22 Thread Barry Smith
On Apr 22, 2014, at 10:44 AM, Sudheer Kumar wrote: > I request for advice on the following: > > I have a MATLAB code that uses some Linear algebra (LA) and Linear equation > solver (LS) routines. I have to speed up this MATLAB code by using the i) MKL > routines for LA calls and ii) Petsc rou

Re: [petsc-users] SNES: approximating the Jacobian with computed residuals?

2014-04-22 Thread Fischer, Greg A.
From: Peter Brune [mailto:prbr...@gmail.com] Sent: Tuesday, April 22, 2014 10:16 AM To: Fischer, Greg A. Cc: petsc-users@mcs.anl.gov Subject: Re: [petsc-users] SNES: approximating the Jacobian with computed residuals? On Tue, Apr 22, 2014 at 8:48 AM, Fischer, Greg A. mailto:fisch...@westinghous

[petsc-users] MATLAB and PetSc

2014-04-22 Thread Sudheer Kumar
I request for advice on the following: I have a MATLAB code that uses some Linear algebra (LA) and Linear equation solver (LS) routines. I have to speed up this MATLAB code by using the i) MKL routines for LA calls and ii) Petsc routines for LS calls. I was able to achieve the step (i) using the

Re: [petsc-users] [beginner question] Different communicators in the two objects: Argument # 1 and 2 flag 3!

2014-04-22 Thread Niklas Fischer
I have tracked down the problem further and it basically boils down to the following question: Is it possible to use MatSetValue(s) to set values which are owned by other processes? If I create a matrix with for(int i = 0; i < 4 * size; ++i){ CHKERRXX(MatSetValue(A, i, i, rank+1, ADD

Re: [petsc-users] petscfe_type opencl, variable_coefficient field

2014-04-22 Thread Matthew Knepley
On Tue, Apr 22, 2014 at 9:42 AM, Karl Rupp wrote: > Hi David, > > > Thanks. Also, the physics seems to be controlled by the "op" variable? > >> Is there an interface to change the physics from the user code ? >> > > I know that our intention is to provide the user with control over the > physics

Re: [petsc-users] [beginner question] Different communicators in the two objects: Argument # 1 and 2 flag 3!

2014-04-22 Thread Matthew Knepley
On Tue, Apr 22, 2014 at 7:59 AM, Niklas Fischer wrote: > I should probably note that everything is fine if I run the serial > version of this (with the exact same matrix + right hand side). > > PETSc KSPSolve done, residual norm: 3.13459e-13, it took 6 iterations. > Yes, your preconditioner is

Re: [petsc-users] 2-stage preconditioner

2014-04-22 Thread Peter Brune
PCComposite is probably the answer http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCCOMPOSITE.html The multiplicative variant will call one after the other. In order to nest it you may have to register your own custom type rather than using shell; this is doable with http://www.

Re: [petsc-users] petscfe_type opencl, variable_coefficient field

2014-04-22 Thread Karl Rupp
Hi David, > Thanks. Also, the physics seems to be controlled by the "op" variable? Is there an interface to change the physics from the user code ? I know that our intention is to provide the user with control over the physics in the long run, but (unless Matt implemented something recently)

[petsc-users] 2-stage preconditioner

2014-04-22 Thread Qin Lu
Hello,   I need to implement a 2-stage preconditioner using PETSc linear solver:   1. The first stage uses a user-provided preconditioner routine. It seems I can set it with PCShellSetApply. 2. The second stage uses PETSc's ILU.   Shall I just call this two preconditioners in sequence, or there is

Re: [petsc-users] petscfe_type opencl, variable_coefficient field

2014-04-22 Thread David Fuentes
Thanks. Also, the physics seems to be controlled by the "op" variable? Is there an interface to change the physics from the user code ? https://bitbucket.org/petsc/petsc/src/fb3a4ffdea0449562fb0f58dad4b44552b6d3589/src/dm/dt/interface/dtfe.c?at=master#cl-5028 switch (op) { case LAPLACIAN:if

Re: [petsc-users] SNES: approximating the Jacobian with computed residuals?

2014-04-22 Thread Peter Brune
On Tue, Apr 22, 2014 at 8:48 AM, Fischer, Greg A. wrote: > Hello PETSc-users, > > I'm using the SNES component with the NGMRES method in my application. I'm > using a matrix-free context for the Jacobian and the > MatMFFDComputeJacobian() function in my FormJacobian routine. My > understanding is

[petsc-users] SNES: approximating the Jacobian with computed residuals?

2014-04-22 Thread Fischer, Greg A.
Hello PETSc-users, I'm using the SNES component with the NGMRES method in my application. I'm using a matrix-free context for the Jacobian and the MatMFFDComputeJacobian() function in my FormJacobian routine. My understanding is that this effectively approximates the Jacobian using the equation

[petsc-users] setting sundials options

2014-04-22 Thread Veltz Romain
Dear PETSc users, I am wondering how the options for the SUNDIALS solvers can be set in Petsc4py. For example, there is ts.setType(ts.Type.SUNDIALS) but how can we set: TSSundialsSetType TSSundialsSetTolerance TSSundialsGetPC Thank you for your help, Bests.

Re: [petsc-users] [beginner question] Different communicators in the two objects: Argument # 1 and 2 flag 3!

2014-04-22 Thread Niklas Fischer
I should probably note that everything is fine if I run the serial version of this (with the exact same matrix + right hand side). PETSc KSPSolve done, residual norm: 3.13459e-13, it took 6 iterations. Am 22.04.2014 14:12, schrieb Niklas Fischer: Am 22.04.2014 13:57, schrieb Matthew Knepley:

Re: [petsc-users] [beginner question] Different communicators in the two objects: Argument # 1 and 2 flag 3!

2014-04-22 Thread Jed Brown
Niklas Fischer writes: > About the MPI output: I have asked the system administrator about this, > and he is of the oppinion that everything is as it should be. Fire the sysadmin? ;-) > Initially, I found the messages concerning as well, but all they are > really saying is that MPI defaults to

Re: [petsc-users] [beginner question] Different communicators in the two objects: Argument # 1 and 2 flag 3!

2014-04-22 Thread Niklas Fischer
Am 22.04.2014 13:57, schrieb Matthew Knepley: On Tue, Apr 22, 2014 at 6:48 AM, Niklas Fischer > wrote: Am 22.04.2014 13:08, schrieb Jed Brown: Niklas Fischer mailto:nik...@niklasfi.de>> writes: Hello, I have attached a small test

Re: [petsc-users] [beginner question] Different communicators in the two objects: Argument # 1 and 2 flag 3!

2014-04-22 Thread Niklas Fischer
Am 22.04.2014 14:02, schrieb Jed Brown: Niklas Fischer writes: thank you for your inputs. Unfortunately MPI does not seem to be the issue here. The attachment contains a simple MPI hello world program which runs flawlessly (I will append the output to this mail) and I have not encountered any

Re: [petsc-users] [beginner question] Different communicators in the two objects: Argument # 1 and 2 flag 3!

2014-04-22 Thread Jed Brown
Niklas Fischer writes: > thank you for your inputs. Unfortunately MPI does not seem to be the > issue here. The attachment contains a simple MPI hello world program > which runs flawlessly (I will append the output to this mail) and I have > not encountered any problems with other MPI programs.

Re: [petsc-users] [beginner question] Different communicators in the two objects: Argument # 1 and 2 flag 3!

2014-04-22 Thread Matthew Knepley
On Tue, Apr 22, 2014 at 6:48 AM, Niklas Fischer wrote: > Am 22.04.2014 13:08, schrieb Jed Brown: > >> Niklas Fischer writes: >> >> Hello, >>> >>> I have attached a small test case for a problem I am experiencing. What >>> this dummy program does is it reads a vector and a matrix from a text >>>

Re: [petsc-users] [beginner question] Different communicators in the two objects: Argument # 1 and 2 flag 3!

2014-04-22 Thread Niklas Fischer
Am 22.04.2014 13:08, schrieb Jed Brown: Niklas Fischer writes: Hello, I have attached a small test case for a problem I am experiencing. What this dummy program does is it reads a vector and a matrix from a text file and then solves Ax=b. The same data is available in two forms: - everythin

Re: [petsc-users] [beginner question] Different communicators in the two objects: Argument # 1 and 2 flag 3!

2014-04-22 Thread Jed Brown
Niklas Fischer writes: > Hello, > > I have attached a small test case for a problem I am experiencing. What > this dummy program does is it reads a vector and a matrix from a text > file and then solves Ax=b. The same data is available in two forms: > - everything is in one file (matops.s.0 and

Re: [petsc-users] petscfe_type opencl, variable_coefficient field

2014-04-22 Thread Karl Rupp
Hi David, > I'm trying to use -variable_coefficient field with -petscfe_type opencl -mat_petscfe_type opencl constant coefficients "-variable_coefficient none" works fine, but I am getting NaN in my residual vector for spatially varying coefficients. I tried changing N_t manually for N_com

[petsc-users] [beginner question] Different communicators in the two objects: Argument # 1 and 2 flag 3!

2014-04-22 Thread Niklas Fischer
Hello, I have attached a small test case for a problem I am experiencing. What this dummy program does is it reads a vector and a matrix from a text file and then solves Ax=b. The same data is available in two forms: - everything is in one file (matops.s.0 and vops.s.0) - the matrix and vector a

Re: [petsc-users] SNES test with a nested matrix

2014-04-22 Thread Norihiro Watanabe
Thank you, Jed. "-snes_compare_explicit" worked with a nested matrix. I'll try to use MatGetLocalSubMatrix in my programm. Best, nori On Thu, Apr 17, 2014 at 4:56 PM, Jed Brown wrote: > Norihiro Watanabe writes: > > > Hi, I wonder whether "-snes_type test" option can work also with a nested >