I have just started with PETSc hence it might seem like a very stupid question but I couldn't find any answer in manual. After Calling KSPSolve, where can I access the soluition for my linear system? Example for a matrix:
$$ \left(\begin{array}{ccc} 2 &-1 & 0\\ -1 &2&-1\\ 0&-1&2 \end{array}\right) \left(\begin{array}{c} x\\y\\z \end{array}\right)= \left(\begin{array}{c} 1\\0\\1 \end{array}\right) $$
I want to get vector
$$
\left(\begin{array}{c}
3/4\\1/2\\1/4
\end{array}\right)
$$
back.
The documentation for KSP Solve says x - the solution (this may be the same vector as b, then b will be overwritten with answer)
but I keep getting x
vector as
$$
\left(\begin{array}{c}
1\\1\\1
\end{array}\right)
$$
Is there something wrong in my understanding?