On Sat, Oct 1, 2011 at 3:04 AM, Hui Zhang <span dir="ltr"><<a href="mailto:mike.hui.zhang@hotmail.com">mike.hui.zhang@hotmail.com</a>></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">Thank you, Jed! I have more questions: <div><br><div>if I do C=A*B with A(or B) of MatNest type and B(or A, resp.) of usual type,<div>what type will C be of? </div></div></div></div></blockquote>
<div><br></div><div>There is an understanding problem here. PETSc does not create C, you do. You</div><div>determine its type.</div><div> </div><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><div><div>And is there any function not supporting MatNest, for example, does LU decomposition </div><div>supports MatNest?</div></div></div></div></blockquote><div><br></div><div>No, you would have to convert it, or pull out the block that you want LU of.</div>
<div> </div><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><div><div>Does one sometimes need to convert MatNest to the usual type and how to do it? </div>
</div></div></div></blockquote><div><br></div><div>MatConvert.</div><div><br></div><div> Matt</div><div> </div><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><div><div>The MatNest is useful to me because my matrix is in the form [K1*K2 K3*K4].</div><div>I think to construct it as MatNest is easier than setting up Aij.</div><div><br></div><div>Best wishes,</div><div>Hui</div>
<div><br><div><div><div><div>On Sep 30, 2011, at 7:08 PM, Jed Brown wrote:</div><br><blockquote type="cite"><div class="gmail_quote">On Fri, Sep 30, 2011 at 10:51, Hui Zhang <span dir="ltr"><<a href="mailto:mike.hui.zhang@hotmail.com" target="_blank">mike.hui.zhang@hotmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>Do you know what type of the resulting vector y by MatMult of a MatNest A and a Vec x, i.e. y = Ax?<br></div></blockquote><div><br></div><div>MatMult does not change the types of vectors. This function works with any types.</div>
<div><br></div><div>Note, however, that many Vec operations require all arguments to have the same type, so you can't freely mix native Vec with VecNest. I don't recommend using VecNest unless you have a very specific use case and can explain to me why you should use it. (I do recommend using MatNest, but generally with the MatGetLocalSubMatrix() so you don't depend on it---I always try to avoid depending on implementations.)</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
Because after that I want to modify a SubVec of the result y. If it is a VectNest, I think<br>
VecNestGetSubVec should be used but not VecGetSubVector.</div></blockquote></div><br><div>This is why VecNest implements VecGetSubVector (see VecGetSubVector_Nest).</div>
</blockquote></div><br></div></div></div></div></div></div></blockquote></div><br><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>