Okay, switched over to the firedrake list

On Tue, Nov 29, 2016 at 2:29 AM, Lawrence Mitchell <lawrence.mitchell@imperial.ac.uk> wrote:
I suspect this is not a petsc issue per se. Shall we migrate this to the firedrake list?

Lawrence 

On 29 Nov 2016, at 07:40, Justin Chang <jychang48@gmail.com> wrote:

FWIW I ended up doing this:

rs_solver.setDM(W._dm())

and was left with this error:

Traceback (most recent call last):
  File "sphere.py", line 180, in <module>
    virs()
  File "sphere.py", line 163, in virs
    rs_solver.solve(None,sol_vec)
  File "PETSc/SNES.pyx", line 537, in petsc4py.PETSc.SNES.solve (src/petsc4py.PETSc.c:170012)
petsc4py.PETSc.Error: error code 75
[0] SNESSolve() line 4060 in /private/var/folders/92/1kh0g4kn2z50fnwsmf8s269w0000gn/T/pip-gYEj0p-build/src/snes/interface/snes.c
[0] SNESSolve_VINEWTONRSLS() line 424 in /private/var/folders/92/1kh0g4kn2z50fnwsmf8s269w0000gn/T/pip-gYEj0p-build/src/snes/impls/vi/rs/virs.c
[0] MatGetSubMatrix() line 7929 in /private/var/folders/92/1kh0g4kn2z50fnwsmf8s269w0000gn/T/pip-gYEj0p-build/src/mat/interface/matrix.c
[0] MatGetSubMatrix_Nest() line 451 in /private/var/folders/92/1kh0g4kn2z50fnwsmf8s269w0000gn/T/pip-gYEj0p-build/src/mat/impls/nest/matnest.c
[0] MatNestFindSubMat() line 424 in /private/var/folders/92/1kh0g4kn2z50fnwsmf8s269w0000gn/T/pip-gYEj0p-build/src/mat/impls/nest/matnest.c
[0] MatNestFindIS() line 363 in /private/var/folders/92/1kh0g4kn2z50fnwsmf8s269w0000gn/T/pip-gYEj0p-build/src/mat/impls/nest/matnest.c
[0] Arguments are incompatible
[0] Could not find index set

I must be doing something wrong here.

Justin

On Tue, Nov 29, 2016 at 1:24 AM, Justin Chang <jychang48@gmail.com> wrote:
Lawrence,

I added the following line:

rs_solver.setDM(a._dm)

And it gives this error:

Traceback (most recent call last):
  File "sphere.py", line 128, in <module>
    rs_solver.setDM(a._dm)
AttributeError: 'Form' object has no attribute '_dm'

Thanks,
Justin

On Tue, Nov 29, 2016 at 1:12 AM, Lawrence Mitchell <lawrence.mitchell@imperial.ac.uk> wrote:


> On 29 Nov 2016, at 02:02, Justin Chang <jychang48@gmail.com> wrote:
>
> Why is this happening? It seems to me VINEWTONRSLS is not understanding that I have a two-field formulation.

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.

Lawrence