<div dir="ltr"><div><div><div><div>Hello,<br>I am trying to find the determinant of the matrix. I have found this thread:<br><br><a href="http://lists.mcs.anl.gov/pipermail/petsc-users/2010-July/006716.html">http://lists.mcs.anl.gov/pipermail/petsc-users/2010-July/006716.html</a><br>
<br></div>But, could you please explain how to access the data structure directly?<br></div>So far I have tried the following:<br><br>#include <petsc-private/matimpl.h><br>#include <../src/mat/impls/aij/seq/aij.h><br>
...<br>// (Solving the system A*x = rhs<br>MatSetOption(A, MAT_SPD, PETSC_TRUE);<br>Mat F;<br>MatGetFactor(A, MATSOLVERMUMPS, MAT_FACTOR_CHOLESKY, &F);<br>MatFactorInfo factinfo;<br>MatFactorInfoInitialize(&factinfo);<br>
IS perm, iscol;<br>MatGetOrdering(A, MATORDERINGNATURAL, &perm, &iscol);<br>MatCholeskyFactorSymbolic(F, A, perm, &factinfo);<br>MatCholeskyFactorNumeric(F, A, &factinfo); <br>ISDestroy(&iscol);<br>
ISDestroy(&perm);<br> <br>MatSolve(F, rhs, x); <br><br></div>// Now I would like to access the diagonal part of the matrix F, can I do something like:<br><br>Mat_SeqAIJ *aa = (Mat_SeqAIJ*)F->data;<br></div>
<div><div><br></div><div>Do you maybe have an example I could look at?<br></div><div><br></div><div>Grateful in advance,<br></div><div>Jelena<br></div></div></div>