On Wed, Dec 21, 2016 at 2:30 PM, Fangbo Wang <[email protected]> wrote:
> 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. > Try using http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCreateNest.html#MatCreateNest although its usually intended for s smaller number of block matrices. Matt Fangbo Wang > > -- > Fangbo Wang, PhD student > Stochastic Geomechanics Research Group > Department of Civil, Structural and Environmental Engineering > University at Buffalo > Email: *[email protected] <[email protected]>* > -- 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
