[petsc-users] MatSetValues on same column multiple times

John Mousel john.mousel at gmail.com
Tue Sep 25 16:44:59 CDT 2012


If I'm adding to a particular column in multiple passes, do I need to
preallocate enough memory for each pass, or just 1 for each column in the
row?
Right now I'm drastically over-allocating, and I'm trying to reduce this.
If I give the true number of columns in the row, I keep getting new entry
errors.

New nonzero at (8045,60) caused a malloc!

I have it spit into phases where I set zeros in the non-zero pattern, then
I come back and fill in entries in a bulk pass, and then do a second pass
to clean up entries in special rows.
Could someone clarify how this works.

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


More information about the petsc-users mailing list