<div dir="ltr">On Mon, Sep 9, 2013 at 3:10 PM, Frank <span dir="ltr"><<a href="mailto:fangxingjun0319@gmail.com" target="_blank">fangxingjun0319@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I am solving Ax=b repeatedly, and A does not change all the time. I did things like this:<br>
<br>
%1. Set up entries for matrix A%%%<br>
CALL MATASSEMBLYBEGIN(A,MAT_FINAL_<u></u>ASSEMBLY,IERR)<br>
CALL MATASSEMBLYEND(A,MAT_FINAL_<u></u>ASSEMBLY,IERR)<br>
CALL MATSETOPTION(A,MAT_NEW_<u></u>NONZERO_LOCATIONS,PETSC_FALSE,<u></u>ierr)<br>
CALL KSPSetOperators(ksp,A,A,SAME_<u></u>NONZERO_PATTERN,ierr)<br>
<br>
Call KSPSetOperators(ksp,A,A,SAME_<u></u>NONZERO_PATTERN,ierr)<br>
<br>
Do i=1,100<br>
% Set up entries for vector b%%%%%<br>
CALL VECASSEMBLYBEGIN(b,IERR)<br>
CALL VECASSEMBLYEND(b,IERR)<br>
CALL KSPSolve(ksp,b,x,ierr)<br>
ENDDO<br>
<br>
However, it does not work. I don't know why. Could anybody help me with this? Thank you very much.<br></blockquote><div><br></div><div>"Does not work" is an unacceptable bug report. With that you are likely to get an answer like "yes it does".</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">
Sincerely<br>
Xingjun Fang<br>
</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>