[petsc-users] How to automatically create many Petsc matrices with similar names(A1, A2, A3....)?

Fangbo Wang fangbowa at buffalo.edu
Wed Dec 21 14:30:22 CST 2016


Hi,

*Background:*
I have a global matrix (sparse) which is very large (2 million by million),
it is generated from local block matrix with size around 30,000 by 30,000
(also sparse) using stochastic galerkin projection method.

In the global matrix, I have 700 local block matrices which most of them
are similar. At the end of the day, I only need to save 45 different local
block matrices which can save a lot of memory than saving the global matrix.

*my problem:*
I don't want to mannually create 45 petsc matrices with similar names, for
example, A1, A2, A3, A4, etc.  I want to automatically create these
matrices and be able to call these matrices according to its name.

Any one have experiences on this? Thank you very much.

Fangbo Wang

-- 
Fangbo Wang, PhD student
Stochastic Geomechanics Research Group
Department of Civil, Structural and Environmental Engineering
University at Buffalo
Email: *fangbowa at buffalo.edu <fangbowa at buffalo.edu>*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20161221/6e25d94e/attachment.html>


More information about the petsc-users mailing list