Re: [petsc-users] MatSetValues error with ViennaCL types

2018-08-28 Thread Karl Rupp
Hi Manuel, as Barry said, it is hard for us to provide any help without having a more complete picture of what is going on. The error you report seems to come from the AMG preconditioner in ViennaCL. This can have many origins. Do other preconditioners run without error? Can you run in a deb

Re: [petsc-users] MatSetValues error with ViennaCL types

2018-08-28 Thread Manuel Valera
Talked too fast, After fixing that problem, i tried more than one mpi processor and got the following: Matrix type: mpiaijviennacl Of sizes: 125 x 125 Matrix type: mpiaijviennacl Of sizes: 125 x 125 [0]PETSC ERROR: - Error Message --

Re: [petsc-users] MatSetValues error with ViennaCL types

2018-08-28 Thread Manuel Valera
Ok, i found the culprit and we can close this thread, The problem was a missing variable for setting the maximum columns, which i deleted at some point without realizing. The error message was too ambiguous to catch this so i had to compare with a previous working version of the arguments of MatSe

Re: [petsc-users] exit kspsolve at half of the max iterations if residual is not reduced by an order

2018-08-28 Thread Jed Brown
You can use any convergence test you want, see SNESSetConvergenceTest() if tolerances don't cut it for you. You might also consider nested solvers/nonlinear preconditioning. NAN ZHAO writes: > Dear all, > > I am trying to find ways to speed up my pests kspsolve, my old code use an > older solve

[petsc-users] exit kspsolve at half of the max iterations if residual is not reduced by an order

2018-08-28 Thread NAN ZHAO
Dear all, I am trying to find ways to speed up my pests kspsolve, my old code use an older solver and it exit the solving loop when residual is not reduced by a certain amount compared with initial residual, and then redo the computation with other tricks. I am wondering if PETSC has this function

Re: [petsc-users] Use block Jacobi preconditioner with SNES

2018-08-28 Thread Smith, Barry F.
Ali, In the branch barry/feature-PCVPBJACOBI (see src/snes/examples/tutorials/ex5.c) I have implemented PCVPBJACOBI that is a point block Jacobi with variable size blocks. It has very little testing. Could you please try your code with it; you should see very very similar convergenc

Re: [petsc-users] MatSetValues error with ViennaCL types

2018-08-28 Thread Smith, Barry F.
1) PetscMalloc() is never valid or needed in Fortran 2) there is no reason to use DMSetMatrixPreallocateOnly() just use DMCreateMatrix() assuming that using a DM (DMDA, DMPLEX, etc) is suitable for your problem. At this end we are totally guessing at what you are doing and so have

Re: [petsc-users] Use block Jacobi preconditioner with SNES

2018-08-28 Thread Smith, Barry F.
Example? Without the callback I don't think you can access the subblocks at the appropriate time to set their prefixes Barry > On Aug 28, 2018, at 12:32 PM, Matthew Knepley wrote: > > On Tue, Aug 28, 2018 at 10:04 AM Adam Denchfield > wrote: > " PETSc developers - do you think we s

Re: [petsc-users] Use block Jacobi preconditioner with SNES

2018-08-28 Thread Matthew Knepley
On Tue, Aug 28, 2018 at 10:04 AM Adam Denchfield wrote: > " PETSc developers - do you think we should put the callback > functionality into PETSc? It allows doing things that are otherwise not > doable but is rather ugly (perhaps too specialized)?" > > Though I only worked on it over the summer,

Re: [petsc-users] Use block Jacobi preconditioner with SNES

2018-08-28 Thread Adam Denchfield
" PETSc developers - do you think we should put the callback functionality into PETSc? It allows doing things that are otherwise not doable but is rather ugly (perhaps too specialized)?" Though I only worked on it over the summer, the functionality you describe (using different solvers on differe

Re: [petsc-users] Use block Jacobi preconditioner with SNES

2018-08-28 Thread Matthew Knepley
On Tue, Aug 28, 2018 at 5:34 AM Ali Reza Khaz'ali wrote: > > > Actually you do not need my new branch to achieve what you desired. > All you need in your main program is something like > > > >ierr = SNESCreate(PETSC_COMM_WORLD,&snes);CHKERRQ(ierr); > >ierr = SNESGetKSP(snes,&ksp);CHKE

Re: [petsc-users] Use block Jacobi preconditioner with SNES

2018-08-28 Thread Ali Reza Khaz'ali
Actually you do not need my new branch to achieve what you desired. All you need in your main program is something like ierr = SNESCreate(PETSC_COMM_WORLD,&snes);CHKERRQ(ierr); ierr = SNESGetKSP(snes,&ksp);CHKERRQ(ierr); ierr = KSPGetPC(ksp,&pc);CHKERRQ(ierr); ierr = PCSetType