On Fri, Feb 10, 2012 at 12:13 AM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> On Fri, Feb 10, 2012 at 00:05, Dmitry Karpeev <karpeev at mcs.anl.gov> wrote: > >> 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. >> > > Are you calling DMSetMatrixPreallocateOnly()? > > What I'm talking about is an implementation issue, rather than a question of what the user should expect from the DMGetMatrix API: I have a matrix that has been preallocated by libMesh based on its mesh connectivity, but it has not been assembled. If I didn't want to return it in DMGetMatrix, but rather to duplicate it, Id be out of luck: that matrix is not "assembled", hence, cannot be duplicated. This, in fact, has little to do with the DM interface. The question is: should we be able to duplicate such "unassambled" matrices? Or should they even be call "unassembled"? Dmitry. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120210/9f13be20/attachment.html>
