[petsc-users] MatSetValues problem

Ramsey, James J CIV (US) james.j.ramsey14.civ at mail.mil
Tue Mar 12 07:38:51 CDT 2013


________________________________________

The "New nonzero at <fill in the blank> caused a malloc" error looks like what happens if the preallocation is not exact. What happens if you add

call MatSetOption(Kglobal, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE, ierr)

after your call to your preallocation subroutine?
________________________________________

Oh, of course Kglobal should be replaced by whatever matrix you are trying to set the values of.



More information about the petsc-users mailing list