Barry,<div><br></div><div>  You inserted a check in VecAXPY:563 (which Jed corrected)</div><div><br></div><div><span class="Apple-style-span" style="font-family: sans-serif; font-size: 12px; "><table style="padding-top: 8px; padding-right: 4px; padding-bottom: 8px; padding-left: 4px; ">
<tbody><tr class="parity0" style="font-family: monospace; "><td class="linenr" style="padding-top: 2px; padding-right: 5px; padding-bottom: 2px; padding-left: 5px; font-size: 12px; vertical-align: top; color: rgb(153, 153, 153); text-decoration: none; text-align: right; ">
<a href="/petsc/petsc-dev/annotate/c5b7ef1f9e2d/src/vec/vec/interface/rvector.c#l563" title="c5b7ef1f9e2d: Fix some misuse of SETERRQ, Barry was naughty and didn't compile" style="color: rgb(136, 0, 0); ">jed@16195</a></td>
<td style="padding-top: 2px; padding-right: 5px; padding-bottom: 2px; padding-left: 5px; font-size: 12px; vertical-align: top; "><pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a class="linenr" href="#l563" id="l563" style="color: rgb(136, 0, 0); text-decoration: none; ">   563</a></pre>
</td><td style="padding-top: 2px; padding-right: 5px; padding-bottom: 2px; padding-left: 5px; font-size: 12px; vertical-align: top; "><pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">
  if (x == y) SETERRQ(((PetscObject)x)->comm,PETSC_ERR_ARG_IDN,"x and y cannot be the same vector");
</pre></td></tr><tr class="parity1" style="background-color: rgb(237, 236, 230); font-family: monospace; "></tr></tbody></table><br></span></div><div><span class="Apple-style-span" style="font-family: sans-serif; font-size: 12px; ">However, this seems to make no sense in light of mg.c:53</span></div>
<div><span class="Apple-style-span" style="font-family: sans-serif; font-size: 12px; "><br></span></div><div><span class="Apple-style-span" style="font-family: sans-serif; font-size: 12px; "><div>    ierr = MatInterpolateAdd(mglevels->interpolate,mgc->x,mglevels->x,mglevels->x);CHKERRQ(ierr);</div>
<div><br></div><div>which will eventually call this with y == w, and has stack</div></span><div><br></div><div>0]PETSC ERROR: VecAXPY() line 563 in src/vec/vec/interface/rvector.c</div><div>[0]PETSC ERROR: MatMultAdd_ML() line 179 in src/ksp/pc/impls/ml/ml.c</div>
<div>[0]PETSC ERROR: MatMultAdd() line 2041 in src/mat/interface/matrix.c</div><div>[0]PETSC ERROR: MatInterpolateAdd() line 6535 in src/mat/interface/matrix.c</div><div>[0]PETSC ERROR: PCMGMCycle_Private() line 53 in src/ksp/pc/impls/mg/mg.c</div>
<div>[0]PETSC ERROR: PCMGMCycle_Private() line 50 in src/ksp/pc/impls/mg/mg.c</div><div>[0]PETSC ERROR: PCMGMCycle_Private() line 50 in src/ksp/pc/impls/mg/mg.c</div><div>[0]PETSC ERROR: PCApply_MG() line 288 in src/ksp/pc/impls/mg/mg.c</div>
<div>[0]PETSC ERROR: PCApply() line 358 in src/ksp/pc/interface/precon.c</div><div>[0]PETSC ERROR: KSPSolve_PREONLY() line 27 in src/ksp/ksp/impls/preonly/preonly.c</div><div>[0]PETSC ERROR: KSPSolve() line 427 in src/ksp/ksp/interface/itfunc.c</div>
<div>[0]PETSC ERROR: PCApply_FieldSplit() line 530 in src/ksp/pc/impls/fieldsplit/fieldsplit.c</div><div>[0]PETSC ERROR: PCApply() line 358 in src/ksp/pc/interface/precon.c</div><div>[0]PETSC ERROR: KSPInitialResidual() line 65 in src/ksp/ksp/interface/itres.c</div>
<div>[0]PETSC ERROR: KSPSolve_GMRES() line 236 in src/ksp/ksp/impls/gmres/gmres.c</div><div>[0]PETSC ERROR: KSPSolve() line 427 in src/ksp/ksp/interface/itfunc.c</div><div><br></div><div>Can I remove this check?</div><div>
<br></div><div>  Thanks,</div><div><br></div><div>      Matt</div><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<br>
</div>