<div dir="ltr">Hello everyone,<div><br></div><div>I have a question about the usage of SNESGetJacobian().</div><div><br></div><div>When I added the following three lines to the snes Monitor function in ex3 for viewing the Jacobian matrix:</div>
<div><br></div><div>Mat Jmat;</div><div>ierr = SNESGetJacobian(snes,&Jmat,NULL,NULL,NULL); CHKERRQ(ierr);</div><div>ierr = MatView(Jamt, PETSC_VIEWER_STDOUT_WORLD); CHKERRQ(ierr); </div><div><br></div><div> I got error message complaining:<br>
</div><div>Operation done in wrong order!</div><div>Must call MatAssemblyBegin/End() before viewing matrix!</div><div> MatView() line 812 in matrix.c<br></div><div><br></div><div><br></div><div>Is the Jmat returned by SNESGetJacobian supposed to be assembled? </div>
<div><br></div><div>Even if I add MatAssemblyBegin/End(), it still crashes by reporting argument out of range in MatSetValues_SeqAIJ() or MatSetValues_MPIAIJ().</div><div><br></div><div>Any suggestions?</div><div><br></div>
<div>Thank you.</div><div><br></div><div>Xiangdong</div><div><br></div><div><br></div></div>