Re: [petsc-users] Cannot do make on ex55k

2024-02-14 Thread Satish Balay via petsc-users
Looks like ex55 is the one to use - that links in with ex55k But it needs a fix for a build from 'make' >> balay@petsc-gpu-01:/scratch/balay/petsc/src/snes/tutorials$ git diff diff --git a/src/snes/tutorials/makefile b/src/snes/tutorials/makefile index 672a62aa5a0..eed127f7eae 100644 ---

Re: [petsc-users] Near nullspace lost in fieldsplit

2024-02-14 Thread Jeremy Theler (External)
> The new code is in https://gitlab.com/petsc/petsc/-/merge_requests/7293 and > retains the null space on the submatrices for both MatZeroRows() and > MatZeroRowsAndColumns() regardless of changes to the nonzero structure of the > matrix. Thank you very much Barry. It works as expected. --

[petsc-users] Cannot do make on ex55k

2024-02-14 Thread Uralovich, Ibragimov Iskander
Hello! I want to start porting part of our PETSc-based code to GPU through kokkos and I want to start with excercises given in tutorials folder. For that I found two examples of using PETSC with kokkos in folder petsc/src/snes/tutorials I managed to succesfully compile and run

Re: [petsc-users] Cannot do make on ex55k

2024-02-14 Thread Junchao Zhang
Satish is right. ex55k is not standalone. There are many examples in petsc tests that can run with kokkos. Just search "requires: kokkos_kernels" and you will find them. ex55k.kokkos.cxx is an example showing how to use petsc/kokkos functions like DMDAVecRestoreKokkosOffsetView,

[petsc-users] how to check state of form residual of snes, for solving ksp or line search?

2024-02-14 Thread Yi Hu
Dear PETSc team, I am using a newtonls snes solver. I know that form residual is invoked at several locations of the algorithm, first evaluated for the rhs of ksp solver, then several times for obtaining the optimal step of line search. In my problem I have a global variable that is updated

Re: [petsc-users] how to check state of form residual of snes, for solving ksp or line search?

2024-02-14 Thread Barry Smith
Use SNESSetUpdate() to provide a callback function that gets called by SNES automatically immediately before each linear solve. Inside your callback use SNESGetFunction(snes,f,NULL,NULL); to access the last computed value of your function, from this you can update your global variable.