KSPBuildSolutionDefault#

Default code to build (if needed) and give access to the current approximate solution for some of the standard (non-flexible) Krylov methods.

Synopsis#

#include "petscksp.h" 
PetscErrorCode KSPBuildSolutionDefault(KSP ksp, Vec v, Vec *V)

Collective

Input Parameters#

  • ksp - iterative context

  • v - pointer to a vector in which to place the approximate solution, or NULL. Must be provided with PC_RIGHT or PC_SYMMETRIC preconditioning, even with PCNONE.

Output Parameter#

  • V - pointer to a vector containing the solution

Note#

Many of the KSP implementations carry either the current approximate solution (with PC_LEFT preconditioning) or a vector which, if you apply the preconditioner to it, is the current approximate solution (with PC_RIGHT preconditioning, or with PC_SYMMETRIC preconditioning using PCApplySymmetricRight()). In all cases, this routine provides access to that approximate solution.

This routine is not usually called directly; it is supplied to the KSP object when its KSPType is set; for example, inside KSPCreate_CG().

Flexible Krylov methods (Flexible Krylov Methods) directly retain the actual approximate solution with PC_RIGHT, hence this routine is not appropriate; instead KSPBuildSolutionFlexibleDefault() is used.

Developer Note#

This is PETSC_EXTERN because it may be used by user provided plugin KSPType implementations

See Also#

KSP: Linear System Solvers, KSP, KSPGetSolution(), KSPBuildResidualDefault(), PC_LEFT, PC_RIGHT, KSPBuildSolutionFlexibleDefault()

Level#

developer

Location#

src/ksp/ksp/interface/iterativ.c


Index of all KSP routines
Table of Contents for all manual pages
Index of all manual pages