On Sat, Jul 16, 2011 at 15:23, Omar Al-Abbasi <omabbasi@...> wrote:
> Is it possible to export the stiffness matrix once it has been
> assembled into Petsc binary format?
>
You can get out the matrix using
Mat A = libmesh_matrix.mat()
and view as usual. You can also use -mat_view_binary or -ksp_view_binary.
The former views when the matrix is assembled, the second views at the end
of a solve.

Thanks Jed for the reply,
I tried what you suggested but since the matrix that I have is called
matrix_A, I tried the following:
Mat A = matrix_A.mat();
matrix_A is created by SparseMatrix<Number>& matrix_A =
*eigen_system.matrix_A;
I got the following error
error: ‘struct libMesh::SparseMatrix<double>’ has no member named ‘mat’
Do you know anyway around this error?
Thanks,
Omar

On Sun, Jul 17, 2011 at 05:02, Omar Al-Abbasi <omabbasi@...> wrote:
> matrix_A is created by SparseMatrix<Number>& matrix_A =
> *eigen_system.matrix_A;
>
> I got the following error
> error: ‘struct libMesh::SparseMatrix<double>’ has no member named ‘mat’
>
You need something like
PetscMatrix<Number> petsc_A = dynamic_cast< PetscMatrix<Number> >(matrix_A)
Mat A = petsc_A.mat()