[petsc-users] getinfo for Mat of type nest

Jed Brown jed at jedbrown.org
Thu Oct 3 12:05:02 CDT 2024


Could you please show the rest of the stack trace? The code you cited there isn't checking return values (using PetscCall or otherwise) so it might be truncated. You can run in a debugger to see a full stack trace without modifying the code (though we recommend checking return values).

MatGetInfo_Nest doesn't exist because it's unclear what the fields should mean (and people often use Nest with matrix-free types). However, it probably doesn't need to be called.

Note that this preconditioner looks a lot like PCFIELDSPLIT, which is more feasible for us to help with.

Edoardo alinovi <edoardo.alinovi at gmail.com> writes:

> Hi Barry,
>
> I am trying to port this preconditioner I found presented at the last PETSc
> conference into may code:
> https://urldefense.us/v3/__https://github.com/ndjinga/SOLVERLAB/blob/master/CoreFlows/examples/C/SaddlePointPreconditioner/SaddlePointLinearSolver.c__;!!G_uCfscf7eWS!a-JnrBsta75n_WDtxUNd7Xb8_m7tg1pWSxwWNTmUBSfpBwISq4IxJkbM6QgADd-x23Q_2s-d6d6bOWCKGRMxMzHyc9DDm7A$ 
>
> So far so good, I am just translating C to Fortran, however when I try to
> solve my linear system with:
>
> call KSPSetOperators(ksp,  Ahat, Pmat, ierr)
> call KSPSolve(ksp, bhat, xhat, ierr)
>
> with Ahat and Pmat being indeed two nest MatNest, created from an array of
> Mat as:
>
> call MatCreateNest(PETSC_COMM_WORLD, 2, PETSC_NULL_IS, 2, PETSC_NULL_IS,
> Mat_array,  Ahat, ierr)
> call MatCreateNest(PETSC_COMM_WORLD, 2, PETSC_NULL_IS, 2, PETSC_NULL_IS,
> Mat_array, Pmat, ierr)
>
>
> However I am getting this error on getinfo:
>
> from C to Fortran
>
> [0]PETSC ERROR: --------------------- Error Message
> --------------------------------------------------------------
> [0]PETSC ERROR: No support for this operation for this object type
> [0]PETSC ERROR: No method getinfo for Mat of type nest
> [0]PETSC ERROR: See https://urldefense.us/v3/__https://petsc.org/release/faq/__;!!G_uCfscf7eWS!a-JnrBsta75n_WDtxUNd7Xb8_m7tg1pWSxwWNTmUBSfpBwISq4IxJkbM6QgADd-x23Q_2s-d6d6bOWCKGRMxMzHyRUMnyvE$  for trouble shooting.
> [0]PETSC ERROR: Petsc Release Version 3.20.4, unknown
>
> How can I get rid of this issue?
>
> Many thanks!


More information about the petsc-users mailing list