petsc-3.7.1 2016-05-15
Report Typos and Errors

# KSPBuildResidual

Builds the residual in a vector provided.

### Synopsis

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

Collective on KSP Many br

### Input Parameter

ksp -iterative context obtained from KSPCreate() Many br

### Output Parameters

| v | - optional location to stash residual. If v is not provided, Many brthen a location is generated. Many br
| t | - work vector. If not provided then one is generated. Many br
| V | - the residual Many br

### Notes

Regardless of whether or not v is provided, the residual is Many brreturned in V. Many br

Many br

### Keywords

KSP, build, residual

### See Also

KSPBuildSolution()

Level:advanced
Location:src/ksp/ksp/interface/itfunc.c
Index of all KSP routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/ksp/ksp/examples/tutorials/ex42.c.html