[petsc-users] MatDuplicate

Aulisa, Eugenio Eugenio.Aulisa at ttu.edu
Fri Oct 16 06:50:43 CDT 2020


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?

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



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20201016/1aab636c/attachment.html>


More information about the petsc-users mailing list