[petsc-users] User-defined KSP

Jed Brown jed at jedbrown.org
Thu Jul 10 07:57:51 CDT 2014


"De Groof, Vincent Frans Maria" <Vincent.De-Groof at uibk.ac.at> writes:

> I want to do some experiments with my own iterative solvers. Is there
> any alternative for a user-defined KSP similar to PCSHELL?

There is not a KSPSHELL, but you can create and register new
implementations from user code.  I recommend copying an existing
implementation most like what you want to implement, or start from
something simple like src/ksp/ksp/impls/cr/cr.c.  Namespace the
implementation, compile it, and call KSPRegister() somewhere in your
application.  If it turns out to work better than other options for some
problem of interest, please consider contributing to PETSc.

> And a question on the side. Are the orthogonalization methods ( (M)GS
> ) readily available? Or are they private for GMRES?

The GMRES implementation is incremental.  If you have all the vectors at
once, it's just a couple lines of code using VecMDot and VecMAXPY.  We
may add a general-purpose "TSQR" in the near future.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140710/0c038a34/attachment.pgp>


More information about the petsc-users mailing list