[petsc-users] MatCreateMPIAIJWithSplitArrays

Kuhlemann, Verena vkuhlem at emory.edu
Tue Aug 2 12:09:21 CDT 2011


HI,

I am creating a matrix with MatCreateMPIAIJWithSplitArrays, but I would like the arrays that I am using
to create the matrix to be freed once the matrix is destroyed. Is this the correct way to do this?

   MatCreateMPIAIJWithSplitArrays(PETSC_COMM_WORLD,ne,nf,PETSC_DETERMINE,PETSC_DETERMINE,ia_E_d,ja_E_d,v_E_d,ia_E_o,ja_E_o,v_E_o,E);
//set flags so that arrays are freed once the matrix is destroyed
 mpimat= (Mat_MPIAIJ*)(*E)->data;
 a=(Mat_SeqAIJ*)(mpimat->A)->data;
 b=(Mat_SeqAIJ*)(mpimat->B)->data;
 a->free_a  = PETSC_TRUE;
 a->free_ij = PETSC_TRUE;
 b->free_a  = PETSC_TRUE;
 b->free_ij = PETSC_TRUE;


Thanks,

Verena

________________________________

This e-mail message (including any attachments) is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this message (including any attachments) is strictly
prohibited.

If you have received this message in error, please contact
the sender by reply e-mail message and destroy all copies of the
original message (including attachments).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110802/89a2c864/attachment.htm>


More information about the petsc-users mailing list