[petsc-users] Calculate determinant in PETSc - MatAssemblyEnd breaks
Barry Smith
bsmith at mcs.anl.gov
Wed Jul 28 13:08:28 CDT 2010
On Jul 28, 2010, at 12:18 PM, Немања Илић (Nemanja Ilic) wrote:
> Hello,
>
> I did the LU factorization and then pulled out diagonal from the matrix, but the code breaks. It breaks on the MatAssemblyEnd after the followin lines:
> "ierr = MatLUFactor(Ap, perm, iperm, &info);CHKERRQ(ierr);
You shouldn't be doing this stuff below. Once you have Ap factored you need to access the data structure directly look in src/mat/impls/aij/seq/aij.h for the data structures to get the diagonals out.
> ierr = MatSetUnfactored(Ap);
> ierr = MatAssemblyBegin(Ap, MAT_FINAL_ASSEMBLY); CHKERRQ(ierr);
> ierr = MatAssemblyEnd(Ap, MAT_FINAL_ASSEMBLY); CHKERRQ(ierr);"
>
> I attached my code.
>
> Thank you in advance for any help.
>
> Best regards,
> Nemanja
> <math_get_matrix_determinant.c>
More information about the petsc-users
mailing list