Re: [petsc-users] Using VecGetType() and VecNest

2022-08-19 Thread Barry Smith
I am not sure why the code works this way creating these sequential work vectors. Since VecNest needs some information about the subvectors I don't think just setting these work vectors to nest vectors will work properly. I am cc:ing Stefano who wrote the code and can likely say

[petsc-users] Using VecGetType() and VecNest

2022-08-19 Thread Wells, David
Hello PETSc experts, I am using VecNest to solve a Stokes problem and I ran into an issue using the POD KSPGuess routines: [0]PETSC ERROR: - Error Message -- [0]PETSC ERROR: Unknown type. Check for miss-spelling or

Re: [petsc-users] Using matrix-free with KSP

2022-08-19 Thread Tu, Jiannan
Barry, I have my own matrix-vector product but not use MatShell. I followed your previous instruction to use MatCreateMFFD(MPI_COMM_WORLD, PETSC_DECIDE, PETSC_DECIDE, N, N, ); MatMFFDSetFunction(A, formfunction, ); MatSetFromOptions(A); MatMFFDSetBase(A, X, NULL); The

Re: [petsc-users] Using matrix-free with KSP

2022-08-19 Thread Barry Smith
> On Aug 18, 2022, at 11:41 PM, Tu, Jiannan wrote: > > The program calls KSPSolve just once and the error occurs after the first > iteration. > > I realized the matrix-vector product in my case is different from that > approximating matrix-vector multiply by finite difference of function