<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div>I suspect this is not a petsc issue per se. Shall we migrate this to the firedrake list?</div><div><br></div><div>Lawrence </div><div><br>On 29 Nov 2016, at 07:40, Justin Chang <<a href="mailto:jychang48@gmail.com">jychang48@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><div><div><div><div>FWIW I ended up doing this:<br><br></div>rs_solver.setDM(W._dm())<br><br></div>and was left with this error:<br><br>Traceback (most recent call last):<br>  File "sphere.py", line 180, in <module><br>    virs()<br>  File "sphere.py", line 163, in virs<br>    rs_solver.solve(None,sol_vec)<br>  File "PETSc/SNES.pyx", line 537, in petsc4py.PETSc.SNES.solve (src/petsc4py.PETSc.c:170012)<br>petsc4py.PETSc.Error: error code 75<br>[0] SNESSolve() line 4060 in /private/var/folders/92/1kh0g4kn2z50fnwsmf8s269w0000gn/T/pip-gYEj0p-build/src/snes/interface/snes.c<br>[0] SNESSolve_VINEWTONRSLS() line 424 in /private/var/folders/92/1kh0g4kn2z50fnwsmf8s269w0000gn/T/pip-gYEj0p-build/src/snes/impls/vi/rs/virs.c<br>[0] MatGetSubMatrix() line 7929 in /private/var/folders/92/1kh0g4kn2z50fnwsmf8s269w0000gn/T/pip-gYEj0p-build/src/mat/interface/matrix.c<br>[0] MatGetSubMatrix_Nest() line 451 in /private/var/folders/92/1kh0g4kn2z50fnwsmf8s269w0000gn/T/pip-gYEj0p-build/src/mat/impls/nest/matnest.c<br>[0] MatNestFindSubMat() line 424 in /private/var/folders/92/1kh0g4kn2z50fnwsmf8s269w0000gn/T/pip-gYEj0p-build/src/mat/impls/nest/matnest.c<br>[0] MatNestFindIS() line 363 in /private/var/folders/92/1kh0g4kn2z50fnwsmf8s269w0000gn/T/pip-gYEj0p-build/src/mat/impls/nest/matnest.c<br>[0] Arguments are incompatible<br>[0] Could not find index set<br><br></div>I must be doing something wrong here.<br><br></div>Justin<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 29, 2016 at 1:24 AM, Justin Chang <span dir="ltr"><<a href="mailto:jychang48@gmail.com" target="_blank">jychang48@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Lawrence,<br><br></div>I added the following line:<br><br>rs_solver.setDM(a._dm)<br><br></div>And it gives this error:<span class=""><br><br>Traceback (most recent call last):<br></span>  File "sphere.py", line 128, in <module><br>    rs_solver.setDM(a._dm)<br>AttributeError: 'Form' object has no attribute '_dm'<br><br></div>Thanks,<br></div>Justin<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 29, 2016 at 1:12 AM, Lawrence Mitchell <span dir="ltr"><<a href="mailto:lawrence.mitchell@imperial.ac.uk" target="_blank">lawrence.mitchell@imperial.<wbr>ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><br>
<br>
> On 29 Nov 2016, at 02:02, Justin Chang <<a href="mailto:jychang48@gmail.com" target="_blank">jychang48@gmail.com</a>> wrote:<br>
><br>
> Why is this happening? It seems to me VINEWTONRSLS is not understanding that I have a two-field formulation.<br>
<br>
</span>For the built in solvers, we set up a dmshell on the snes that knows how to do field splitting.  Because you set your snes up by hand, it isn't available. You'll need to call snes.setDM. The mixed finctionspace provides the correct dm via a ._dm property I think.<br>
<span class="m_-5183284893201804145HOEnZb"><font color="#888888"><br>
Lawrence<br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></blockquote></body></html>