[petsc-users] About MAT_NEW_NONZERO_LOCATION[]

Thibaut Appel t.appel17 at imperial.ac.uk
Tue Oct 13 07:47:57 CDT 2020


Hi there, just a quick question:

It seems MAT_NEW_NONZERO_LOCATION_ERR set to PETSC_TRUE has kind of the 
same purpose as MAT_NEW_NONZERO_LOCATIONS set to PETSC_FALSE, the 
difference being if an additional entry is there, the former produces an 
error whereas in the latter it is simply ignored.

However the manual states:

'If one wishes to repeatedly assemble matrices that retain the same 
nonzero pattern (such as within a nonlinear or time-dependent problem), 
the option MatSetOption(MatA,*MAT_NEW_NONZERO_LOCATIONS,PETSC_FALSE*); 
should be specified after the first matrix has been fully assembled. 
This option ensures that certain data structures and communication 
information will be reused (instead of regenerated) during successive 
steps, thereby increasing efficiency'

If I only declare:

     CALL MatSetOption(MatA,MAT_NEW_NONZERO_LOCATION_ERR,PETSC_TRUE,ierr)

Would the data structures still be reused in later matrix assemblies?

Or does it rather make sense to use conjointly:

     CALL MatSetOption(MatA,MAT_NEW_NONZERO_LOCATION_ERR,PETSC_TRUE,ierr)
     CALL MatSetOption(MatA,MAT_NEW_NONZERO_LOCATIONS,PETSC_FALSE,ierr)

Thank you,


Thibaut

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


More information about the petsc-users mailing list