<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I am working on fixing this in Newton, getting the DM. I've tested and it seems to work. Just need to craft a Proustian comment message for Herr Commandant.<div><br></div><div><div>PetscErrorCode SNESSetWorkVecs(SNES snes,PetscInt nw)</div><div>{</div><div> PetscErrorCode ierr;</div><div> DM dm;</div><div><br></div><div> PetscFunctionBegin;</div><div> if (snes->work) {ierr = VecDestroyVecs(snes->nwork,&snes->work);CHKERRQ(ierr);}</div><div> snes->nwork = nw;</div><div><br></div><div> ierr = SNESGetDM(snes,&dm);CHKERRQ(ierr);</div><div> if (dm){</div><div> Vec vec;</div><div> ierr = DMCreateGlobalVector(dm,&vec);CHKERRQ(ierr);</div><div> ierr = VecDuplicateVecs(vec,snes->nwork,&snes->work);CHKERRQ(ierr);</div><div> ierr = VecDestroy(&vec);CHKERRQ(ierr);</div><div> }</div><div> else if (snes->vec_sol) {</div><div> ierr = VecDuplicateVecs(snes->vec_sol,snes->nwork,&snes->work);CHKERRQ(ierr);</div><div> }</div><div> else {</div><div> SETERRQ(PetscObjectComm((PetscObject)snes),PETSC_ERR_SUP,"Can not create work vectors.");</div><div> }</div><div><br></div><div> ierr = PetscLogObjectParents(snes,nw,snes->work);CHKERRQ(ierr);</div><div> PetscFunctionReturn(0);</div><div>}</div><div><br></div><div><br></div><div><div>On Oct 11, 2013, at 2:11 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">On Thu, Oct 10, 2013 at 2:41 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</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"><div><br>
On Oct 10, 2013, at 2:37 PM, "Mark F. Adams" <<a href="mailto:mfadams@lbl.gov" target="_blank">mfadams@lbl.gov</a>> wrote:<br>
<br>
>><br>
>> That's what I suggested below. I can test this now if you like.<br>
>><br>
>> Excellent. I just pushed to next.<br>
><br>
> It is almost done but SNESSetWorkVecs tries to use vec_sol to create work vectors.<br>
><br>
<br>
</div> If SNES has a DM then it should be trying to get its work vectors from that.</blockquote><div><br></div><div>Now a SNES always has a DM. Changed.</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">
<span><font color="#888888"><br>
Barry<br>
<br>
</font></span></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>
</blockquote></div><br></div></body></html>