Create a pure diagonal matrix

Shi Jin jinzishuai at yahoo.com
Mon Mar 31 16:11:32 CDT 2008


Hi,

I have a related question to the one above: what is the best way to create a purely diagonal matrix?
I am using
ierr = MatCreateMPIAIJ(comm,localM,localN,PETSC_DETERMINE,PETSC_DETERMINE,1, PETSC_NULL, 0, PETSC_NULL, &lumpedMP);CHKERRQ(ierr);
But I would think there might be a even better (faster/less memory) way?

I thought about the BDiag Matrix. I tried
ierr=MatCreateMPIBDiag(comm,localM,globalSize,globalSize,PETSC_NULL,1,      PETSC_NULL,PETSC_NULL,&lumpedM);CHKERRQ(ierr);
but not sure if it is done correctly. I am a little suspicious about those pointers I set as NULL.

If the above two are both correct, is there a better one?

Thank you very much.
 
--
Shi Jin, PhD




      ____________________________________________________________________________________
No Cost - Get a month of Blockbuster Total Access now. Sweet deal for Yahoo! users and friends. 
http://tc.deals.yahoo.com/tc/blockbuster/text1.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20080331/7ebe673e/attachment.htm>


More information about the petsc-users mailing list