int KSPBuildSolution(KSP ctx, Vec v, Vec *V)Collective on KSP
v | - location to stash solution. |
V | - the solution is returned in this location. This vector is created internally. This vector should NOT be destroyed by the user with VecDestroy(). |
KSPBuildSolution(ctx,PETSC_NULL,&V); or KSPBuildSolution(ctx,v,PETSC_NULL);In the first case an internal vector is allocated to store the solution(the user cannot destroy this vector). In the second case the solutionis generated in the vector that the user provides. Note that for certainmethods, such as KSPCG, the second case requires a copy of the solution, while in the first case the call is essentially free since it simplyreturns the vector where the solution already is stored.
Location: src/ksp/interface/itfunc.c
KSP Index
Table of Contents