<div class="gmail_quote">On Wed, Oct 10, 2012 at 8:33 AM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p>The best way, by far, is to assemble the matrix as AIJ if that is what you want to use. See MatGetLocalSubMatrix and SNES ex28. Using MATNEST should he a run-time choice.</p></blockquote><div>The caveat here is that currently there is no good way (that I know of) to preallocate in a mattype-oblivious way.</div>
<div>And there is no preallocation of matnest matrices. There are bits a pieces of experimental code sitting around </div><div>petsc-dev that could probably be made into a preallocation mechanism for matnest, but that's still quite a bit of work.</div>
<div>Dmitry.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
<div class="gmail_quote">On Oct 10, 2012 8:30 AM, "Thomas Witkowski" <<a href="mailto:thomas.witkowski@tu-dresden.de" target="_blank">thomas.witkowski@tu-dresden.de</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Is there a fast way to convert a MatNest to a MatAIJ? I tried to use MatConvert, but it seems that this convert is not yet implemented. As I need this functionality to factorize the nested matrix with MUMPS, is there any better way than to extract the nested matrices, iterate over all rows of these matrices and use MatSetValues to add them again to the final MatAIJ?<br>
<br>
Thomas<br>
</blockquote></div>
</div></div></blockquote></div><br>