[petsc-users] MatCreateMPIAIJWithSplitArrays
Matthew Knepley
knepley at gmail.com
Tue Aug 2 12:18:03 CDT 2011
On Tue, Aug 2, 2011 at 5:09 PM, Kuhlemann, Verena <vkuhlem at emory.edu> wrote:
> 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;
>
Yes, this should work.
Matt
> 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).
>
--
What most experimenters take for granted before they begin their experiments
is infinitely more interesting than any results to which their experiments
lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110802/17a7c475/attachment.htm>
More information about the petsc-users
mailing list