[petsc-users] matrix preallocation

Jed Brown jed at jedbrown.org
Fri Oct 21 18:03:06 CDT 2016


"Kong, Fande" <fande.kong at inl.gov> writes:

> Hi,
>
> For mechanics problems, the contact surface changes  during each nonlinear
> iteration. Therefore, the sparsity of matrix also changes during each
> nonlinear iteration. We know the preallocaiton is important for performance.
>
> My question is:  it is possible to re-allocate memory during each nonlinear
> iteration?

Sure, call MatXAIJSetPreallocation inside your SNES Jacobian function.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 800 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20161021/9c62d3c4/attachment.pgp>


More information about the petsc-users mailing list