<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class="im"><br>
>   ! setup solver now that matrix is complete<br>
>   call KSPSetUp( solver%ksp, ierr )  !!! poisson.F90:213<br>
<br>
</div>Where does your code call PCFieldSplitSetIS() or similar?  </blockquote><div><br></div><div>I use DM's.  I've appended some of the code and attached the whole file.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
How is the<br>
PCFieldSplit supposed to know about the splits?  What runtime options<br>
are you passing?<br>
</blockquote></div><br></div><div class="gmail_extra">I just use the petsc.rc files that I sent before.  We don't usually use command line options.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Mark</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">! lambda DM</div><div class="gmail_extra">  call VecCreate(comm,x2Vec,ierr)</div><div class="gmail_extra">  call VecSetSizes(x2Vec,N2loc,nflux,ierr)</div>
<div class="gmail_extra">  call VecSetFromOptions(x2Vec,ierr)</div><div class="gmail_extra"><br></div><div class="gmail_extra">  call DMShellCreate(comm,solver%dalam,ierr)</div><div class="gmail_extra">  call DMShellSetGlobalVector(solver%dalam,x2Vec,ierr)</div>
<div class="gmail_extra">  call DMShellSetMatrix(solver%dalam,solver%Dmat,ierr)</div><div class="gmail_extra"><br></div><div class="gmail_extra">  call VecCreate(PETSC_COMM_SELF,x2Vecloc,ierr)</div><div class="gmail_extra">
  call VecSetSizes(x2Vecloc,N2loc,N2loc,ierr)</div><div class="gmail_extra">  call VecSetFromOptions(x2Vecloc,ierr)</div><div class="gmail_extra">  call DMShellSetLocalVector(solver%dalam,x2Vecloc,ierr)</div><div class="gmail_extra">
  call VecDestroy(x2Vec,ierr)</div><div class="gmail_extra">  call VecDestroy(x2Vecloc,ierr)</div><div class="gmail_extra"><br></div><div class="gmail_extra">  ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -</div>
<div class="gmail_extra">  !  Create field split DM</div><div class="gmail_extra">  ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -</div><div class="gmail_extra">  call DMCompositeCreate(comm,solver%da,ierr)</div>
<div class="gmail_extra">  CHKERRQ(ierr)</div><div class="gmail_extra">  call DMSetOptionsPrefix(solver%daphi,'phi_',ierr)</div><div class="gmail_extra">  call DMCompositeAddDM(solver%da,solver%daphi,ierr)</div><div class="gmail_extra">
  CHKERRQ(ierr)</div><div class="gmail_extra">  call DMSetOptionsPrefix(solver%dalam,'lambda_',ierr)</div><div class="gmail_extra">  call DMCompositeAddDM(solver%da,solver%dalam,ierr)</div><div class="gmail_extra">
  CHKERRQ(ierr)</div><div class="gmail_extra"><br></div><div class="gmail_extra">  matArray(1) = solver%Amat</div><div class="gmail_extra">  matArray(2) = solver%Bmat</div><div class="gmail_extra">  matArray(3) = solver%Cmat</div>
<div class="gmail_extra">  matArray(4) = solver%Dmat</div><div class="gmail_extra">  call MatCreateNest(comm,itwo,PETSC_NULL_OBJECT,itwo,PETSC_NULL_OBJECT,matArray,solver%KKTmat,ierr)</div><div class="gmail_extra">  call MatSetFromOptions(solver%KKTmat,ierr)</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">  !  Extract global and local vectors from DM; then duplicate for remaining</div><div class="gmail_extra">  !     vectors that are the same types</div><div class="gmail_extra">
  call MatGetVecs(solver%KKTmat,solver%xVec2,solver%bVec2,ierr)</div><div class="gmail_extra">  call VecDuplicate(solver%bVec2,solver%rVec2,ierr)</div><div class="gmail_extra"><br></div><div class="gmail_extra">  ! create SNES</div>
<div class="gmail_extra">  call SNESCreate(comm,solver%snes,ierr)</div><div class="gmail_extra">  CHKERRQ(ierr)</div><div class="gmail_extra">  call SNESSetDM(solver%snes,solver%da,ierr)</div><div class="gmail_extra">  CHKERRQ(ierr)</div>
<div class="gmail_extra"><br></div></div></div>