[petsc-users] matrix preallocation for unstructured finite element

saturday luis luis.saturday at gmail.com
Thu Jan 18 22:49:47 CST 2018

Hi PETSc team:

Is there a way to make precise matrix preallocation for an unstructured
grid (I am not using the DMPlex object). Or do you have any example code
for estimating the dnz & onz data?

On top of my head, I can do a two-phase calculation. I can first give a
rough estimate and do one finite element assembly, then I will call
MatGetRow to locate the column indices for nonzero entries. Then in the
second step, I will destroy the Mat and create a new Mat with this obtained
sparsity pattern.

Do you have any suggestions?


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

More information about the petsc-users mailing list