[petsc-users] MatDuplicate

Matthew Knepley knepley at gmail.com
Fri Oct 16 07:27:17 CDT 2020


On Fri, Oct 16, 2020 at 7:50 AM Aulisa, Eugenio <Eugenio.Aulisa at ttu.edu>
wrote:

> Hi,
>
> I have a MATMPIAIJ matrix A with an overestimated  preallocated size.
>
> After closing it I want a duplicate of A with sharp memory
> allocation for each row both diagonal and off-diagonal.
>
> I know how to do it by hand, but I am wondering if a function already
> exists.
>
> For example, if I use MatDuplicate with MAT_COPY_VALUES
> <https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatDuplicateOption.html#MatDuplicateOption>,
>
> will it do a sharp memory allocation, or use the same loose memory
> allocation of A?
>

It is a sharp allocation.

  Thanks,

    Matt


> Any other function would do the job?
>
> Thanks,
> Eugenio
>
>
>
>
>
> Eugenio Aulisa
>
> Department of Mathematics and Statistics,
> Texas Tech University
> Lubbock TX, 79409-1042
> room: 226
> http://www.math.ttu.edu/~eaulisa/
> phone: (806) 834-6684
> fax: (806) 742-1112
>
>
>
>

-- 
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

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20201016/31efe9da/attachment.html>


More information about the petsc-users mailing list