<div dir="ltr"><div dir="ltr">On Sat, Oct 10, 2020 at 5:31 AM baikadi pranay <<a href="mailto:pranayreddy865@gmail.com">pranayreddy865@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello,<br>I am using the MatDuplicate routine so that I use the Jacobian matrix as a preconditioning matrix as well. However, I get the error "MAT_COPY_VALUES not allowed for unassembled matrix". The exact command I use is the following:<br><b>call MatDuplicate(jac,MAT_COPY_VALUES,prec,ierr)</b><div>I am attaching you the error output in a text file for your reference. Could you please let me know how to solve this problem?.<br></div></div></blockquote><div><br></div><div>1) You should be using CHKERRQ(ierr) after the call</div><div><br></div><div>2) You need to assemble the matrix, MatAssemblyBegin/End(), before calling MatDuplicate()</div><div><br></div><div>3) You do not need to duplicate the matrix, just pass the same matrix twice</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Thank you in advance.<br>Best Regards,<br>Pranay.</div><div><br></div></div><div hspace="streak-pt-mark" style="max-height:1px"><img alt="" style="width: 0px; max-height: 0px; overflow: hidden;" src="https://mailfoogae.appspot.com/t?sender=acHJhbmF5cmVkZHk4NjVAZ21haWwuY29t&type=zerocontent&guid=f01d97d9-f1e1-4732-a87c-07bae780da23"><font color="#ffffff" size="1">ᐧ</font></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>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><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>