[petsc-users] MatCreateSeqDense ?

John Chludzinski jchludzinski at gmail.com
Wed Jul 27 04:29:58 CDT 2011


 I'm trying to create a dense matrices from values I'm reading from (binary)
files.  I tried the following code:

Mat A;
int n = SIZE; //4002
double *K = (double *)calloc( sizeof(double), SIZE*SIZE );
...
MatCreateSeqDense(PETSC_COMM_SELF, n, n, K, &A);
MatView(A,PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD));
ierr = PetscFinalize();CHKERRQ(ierr);

NOTE:*** I'm converting K to the FORTRAN column major from the C row major
order before I call  MatCreateSeqDense(...).

This appears to work but when I try to use the 2 matrices I thus created
with SLEPc ex7 (generalized eigenvalue problem) it never terminates, using:

./ex7.exe -f1 k.dat -f2 m.dat -eps_type lapack -eps_smallest_real

Am I creating the proper PETSc binary (canonical) format for my 2 matrices?

---John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110727/97e44746/attachment.htm>


More information about the petsc-users mailing list