On Tue, May 8, 2012 at 11:00 AM, Christian Staudt <span dir="ltr">&lt;<a href="mailto:christian.staudt@ira.uka.de" target="_blank">christian.staudt@ira.uka.de</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div>Matthew Knepley &lt;<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>&gt; wrote:</div><br><blockquote type="cite"><blockquote type="cite">a) Is there an easy and efficient way to convert a numpy.ndarray to a<br>
</blockquote><blockquote type="cite">PETSc.Vec or PETSc.Mat (and vice-versa)?  (A PETSc.Vec.getArray() returns a<br></blockquote><blockquote type="cite">numpy.ndarray, though I have found no such method for PETSc.Mat yet. )<br>
</blockquote><blockquote type="cite"><br></blockquote><br>If you are using dense matrices (MATDENSE) then MatGetArray() works.</blockquote><div><br></div><div>I don&#39;t think this is implemented in petsc4py: At least, there&#39;s no method PETSc.Mat.getArray()</div>
</div></blockquote></div><br>If you ask Lisandro for it, he will put it in.<div><br></div><div>   Matt<br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>
</div>