[petsc-users] DMCreatMatrix preallocation

Oleksandr Koshkarov olk548 at mail.usask.ca
Mon Sep 17 15:31:26 CDT 2018


Hello All,

I have a question about preallocation of DMDA matrix. As I understand, 
it preallocates the number of nonzeros using the stencil width info. 
However, it seems it will not be efficient for me: I have a large dof 
(around 2000), where only some of those dof's are coupled, so those 
dof*dof blocks inside the DMMatrix would be also sparse. I also use this 
DMDA matrix as preconditioner, which has lower coupling than original 
DMDA array, so stencil is effectively smaller (I precondition higher 
order finite volume method with lower order FV method). Can I manually 
specify how many zeros needs to be preallocated for the DMDA matrix?

p.s. I do not want o use normal matrix, as I relay on dmda indexing 
(MatSetValuesStencil).

Thank you and best regards,

Oleksandr.



More information about the petsc-users mailing list