[petsc-users] KSPComputeOperator Fortran API

Edoardo Centofanti edoardo.centofanti01 at universitadipavia.it
Thu Jun 18 07:57:52 CDT 2026


Thank you for your answer. So, there is no way to access it from previous
versions? My codebase is quite old and changing PETSc version would imply
updating also other calls to other routines, which may become time
consuming.

Best,
Edoardo

Il giorno gio 18 giu 2026 alle ore 12:40 Jose E. Roman <jroman at dsic.upv.es>
ha scritto:

> I would suggest upgrading to the most recent version (3.25) since the new
> Fortran bindings cover most of the functionality, including this one.
> Jose
>
>
> > El 18 jun 2026, a las 10:14, Edoardo Centofanti <
> edoardo.centofanti01 at universitadipavia.it> escribió:
> >
> > Dear users,
> >
> > I am working on a finite element Fortran code and I would like to
> extract the preconditioned operator to explore its spectral properties. I
> know that the KSPComputeOperator routine exists in C.
> > How can I call it from Fortran? I am currently using PETSc 3.20.2.
> >
> > So far I have tried
> > call KSPComputeOperator(ksp,MATMPIAIJ,AAprec,ierr)
> >
> > and also its old/deprecated version
> > call KSPComputeExplicitOperator(ksp,AAprec,ierr)
> >
> > But in both cases I got
> > undefined reference to
> `kspcomputeoperator_'/`kspcomputeexplicitoperator_'
> > when compiling
> >
> > Thanks in advance,
> > Edoardo
>
>

-- 
Edoardo Centofanti
Dipartimento di Matematica 'Felice Casorati'
Università degli Studi di Pavia

Tel. 0382985608  |  Ufficio A14  |  Via Ferrata 5, 27100 Pavia, Italy
<https://urldefense.us/v3/__https://maps.google.com/?q=Via*20Ferrata*205,*2027100*20Pavia,*20Italy__;JSUlJSU!!G_uCfscf7eWS!cHekwvNYf5Eea37zVBBLBsxCjkd-l34mEUtG36v3GQmjco-g1Gu7nu4ijUJYRNZHR2PFy1ZFBYGH_Jn9mtKW-TRLl1mn0Z-cZ4gMDOJJ6rg$ >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20260618/21e4572c/attachment-0001.html>


More information about the petsc-users mailing list