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:
|2 -1 0 | |x| |1|
|-1 2 -1| |y| = |0|
|0 -1 2 | |z| |1|
$$ \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 [3/4, 1/2, 1/4] back
$$
\left(\begin{array}{c}
3/4\\1/2\\1/4
\end{array}\right)
$$
back. The
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 xx
vector as [1,1,1].
$$
\left(\begin{array}{c}
1\\1\\1
\end{array}\right)
$$
Is there something wrong in my understanding?
Sorry for really poor formatting I could not find latex editor here ||
denotes the matrix.