:orphan:
# TaoGetSolution
Returns the vector with the current solution from the `Tao` object
## Synopsis
```
#include "petsctao.h"
PetscErrorCode TaoGetSolution(Tao tao, Vec *X)
```
Not Collective
## Input Parameter
- ***tao -*** the `Tao` context
## Output Parameter
- ***X -*** the current solution
## Note
The returned vector will be the same object that was passed into `TaoSetSolution()`
## See Also
[](ch_tao), `Tao`, `TaoSetSolution()`, `TaoSolve()`
## Level
intermediate
## Location
src/tao/interface/taosolver.c
## Examples
src/tao/constrained/tutorials/ex1.c
src/tao/constrained/tutorials/tomographyADMM.c
src/tao/pde_constrained/tutorials/elliptic.c
src/tao/pde_constrained/tutorials/hyperbolic.c
src/tao/pde_constrained/tutorials/parabolic.c
src/tao/unconstrained/tutorials/minsurf2.c
---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/tao/interface/taosolver.c)
[Index of all Tao routines](index.md)
[Table of Contents for all manual pages](/manualpages/index.md)
[Index of all manual pages](/manualpages/singleindex.md)