[petsc-users] Is it still worth switching to PETSc if I can't write a Jacobian for my problem?

2015-12-07 Thread Brian Merchant
Hi all, I am considering using petsc4py instead of scipy.integrate.odeint (which is a wrapper for Fortran solvers) for a problem involving the solution of a system of ODEs. The problem has the potential to be stiff. Writing down its Jacobian is very hard. So far, I have been able to produce

Re: [petsc-users] How to get values from a matrix and set again?

2015-12-07 Thread Matthew Knepley
On Mon, Dec 7, 2015 at 12:11 AM, Bibrak Qamar wrote: > Hi, > > I am trying to apply a function on each element of a matrix. The function > is the sigmoid function which transforms each element of the matrix. > This pattern is problematic because we have no good way to

Re: [petsc-users] zero pivot in LU factorization when using -fieldsplit_0_pc_type gamg in schur fieldsplit PC

2015-12-07 Thread Barry Smith
It is getting a zero pivot when factoring the little dense diagonal blocks of the smoother matrix (to do SOR). What happens if you run with the additional option -mat_no_inode? Run with the additional option -start_in_debugger noxterm In the debugger type cont when it crashes type

Re: [petsc-users] How to get values from a matrix and set again?

2015-12-07 Thread Barry Smith
Presumably you are using a MPIAIJ matrix. You can use Mat x,A,B; MatMPIAIJGetSeqAIJ(x,,,NULL); PetscScalar *a; MatSeqAIJGetArray(A,); MatInfo info; MatGetInfo(A,MAT_LOCAL,); for (i=0; i

Re: [petsc-users] SuperLU convergence problem (More test)

2015-12-07 Thread Danyang Su
Hello Hong, Thanks for the quick reply and the option "-mat_superlu_dist_fact SamePattern" works like a charm, if I use this option from the command line. How can I add this option as the default. I tried using PetscOptionsInsertString("-mat_superlu_dist_fact SamePattern",ierr) in my code

Re: [petsc-users] SuperLU convergence problem (More test)

2015-12-07 Thread Hong
Danyang: Add 'call MatSetFromOptions(A,ierr)' to your code. Attached below is ex52f.F modified from your ex52f.F to be compatible with petsc-dev. Hong Hello Hong, > > Thanks for the quick reply and the option "-mat_superlu_dist_fact > SamePattern" works like a charm, if I use this option from

Re: [petsc-users] SuperLU convergence problem (More test)

2015-12-07 Thread Danyang Su
Thank. The inserted options works now. I didn't put PetscOptionsInsertString in the right place before. Danyang On 15-12-07 12:01 PM, Hong wrote: Danyang: Add 'call MatSetFromOptions(A,ierr)' to your code. Attached below is ex52f.F modified from your ex52f.F to be compatible with petsc-dev.

Re: [petsc-users] Is it still worth switching to PETSc if I can't write a Jacobian for my problem?

2015-12-07 Thread Barry Smith
Brian, Could send an example of your "rhs" function; not a totally trivial example Barry > On Dec 7, 2015, at 11:21 AM, Brian Merchant wrote: > > Hi all, > > I am considering using petsc4py instead of scipy.integrate.odeint (which is a > wrapper for Fortran

[petsc-users] Vector Vector Multiply to get a Matrix

2015-12-07 Thread Bibrak Qamar
I am in a situation where I have to multiply two vectors of size nx1 to get a matrix of size nxn. Is there a better way to achieve this without manually copying vectors into a matrix form? Thanks Bibrak

Re: [petsc-users] Vector Vector Multiply to get a Matrix

2015-12-07 Thread Jed Brown
Bibrak Qamar writes: > I am in a situation where I have to multiply two vectors of size nx1 to get > a matrix of size nxn. Well that's just silly. What do you want to do with this rank-1 matrix? signature.asc Description: PGP signature

[petsc-users] zero pivot in LU factorization when using -fieldsplit_0_pc_type gamg in schur fieldsplit PC

2015-12-07 Thread Bishesh Khanal
Hello, I'm revisiting my code for solving a system of eqs similar to Stokes to get better convergence for big jumps in viscosity (mu) and wanted to experiment with petsc's gamg: mu lap(u) + grad(p) = f1 div(u)= f2 Dirichlet boundary condition of zero velocity. The

Re: [petsc-users] SuperLU convergence problem (More test)

2015-12-07 Thread Hong
Danyang : Adding '-mat_superlu_dist_fact SamePattern' fixed the problem. Below is how I figured it out. 1. Reading ex52f.F, I see '-superlu_default' = '-pc_factor_mat_solver_package superlu_dist', the later enables runtime options for other packages. I use superlu_dist-4.2 and superlu-4.1 for