On Fri, Feb 10, 2012 at 12:05 AM, Dmitry Karpeev <karpeev at mcs.anl.gov>wrote:
> > > On Fri, Feb 10, 2012 at 12:01 AM, Jed Brown <jedbrown at mcs.anl.gov> wrote: > >> On Thu, Feb 9, 2012 at 23:55, Dmitry Karpeev <karpeev at mcs.anl.gov> wrote: >> >>> In a somewhat related matter, it appears that I cannot duplicate a >>> preallocated MATXXXAIJ until it has been assembled: >>> if my DM implementation keeps a preallocated MATSEQAIJ, which it wants >>> to duplicate on every call to DMGetMatrix, >>> it would have to put in fake entries before any duplication is possible. >>> >> >> Doesn't it already do this (inserting 0)? >> > I don't think so. Preallocating doesn't set any values and seems to leave > the matrix marked !assembled. > MatDuplicate for such a matrix will fail. Assemblying it before setting > values (just to force an assembled flag) > will squeeze out the extra values, won't it? I think it would just be > reasonable to allow to duplicate unassembled > matrices, or, better yet, have a matrix be "assembled" by default until > MatSetValues has been called. > But I'm not sure whether either solution will break something else. > Actually, preallocating does do this now. I have to change the unstructured code to do it. Matt > Dmitry. > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120210/c35efe83/attachment.html>