<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Oct 20, 2014 at 3:17 PM, Harshad Sahasrabudhe <span dir="ltr"><<a href="mailto:hsahasra@purdue.edu" target="_blank">hsahasra@purdue.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I get the Mat object from <a href="http://libmesh.github.io/libmesh/doxygen/classlibMesh_1_1PetscMatrix.html#aaca7a5afeb063716ee67fa11302c2aea" target="_blank">libMesh::PetscMatrix<>::mat()</a>, and it's been created and assembled before I call MatGetType.</div></blockquote><div><br></div><div>But what you are getting is invalid, so either</div><div><br></div><div> a) it has not been created and assembled in LibMesh</div><div><br></div><div> b) the right thing is not getting passed back (LibMesh problem)</div><div><br></div><div>or</div><div><br></div><div> c) you are overwriting memory and it manifests here (check with valgrind)</div><div><br></div><div>It is very easy to look in these structures using the debugger. We are just checking an integer</div><div>in the header for the object that identifies it as a Mat.</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 class="gmail_extra"><div class="gmail_quote">On Mon, Oct 20, 2014 at 4:12 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Mon, Oct 20, 2014 at 3:07 PM, Harshad Sahasrabudhe <span dir="ltr"><<a href="mailto:hsahasra@purdue.edu" target="_blank">hsahasra@purdue.edu</a>></span> wrote:<br></span><div><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I get the following error when I call MatGetType even though I'm calling the function with a Mat object.</div><div><br></div><div><div>[0]PETSC ERROR: Invalid argument!</div><div>[0]PETSC ERROR: Wrong type of object: Parameter # 1!</div></div><div><br></div><div>What could be going wrong?</div></div></blockquote><div><br></div></div></div><div>You are not calling it with a valid Mat object. Did you call MatCreate?</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 dir="ltr"><div>Thanks,</div><div>Harshad</div></div><span><font color="#888888">
</font></span></blockquote></div><span><font color="#888888"><br><br clear="all"><span class="HOEnZb"><font color="#888888"><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
</font></span></font></span></div></div>
</blockquote></div><br></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
</div></div>