<div dir="ltr"><div>I am creating an Schur complement matrix explicitly (solver%schur) and setting it with code like:</div><div><br></div><div>call SNESGetKSP(solver%snes,innerksp,ierr)</div><div>call KSPGetPC(innerksp,spc,ierr)</div>
<div>call PCFieldSplitSetSchurPre(spc,PC_FIELDSPLIT_SCHUR_PRE_USER,solver%schur,ierr)</div><div><br></div><div>I would think that the "inner" solver would not be used but it is getting used. It looks to me like I am not getting this hooked up correctly and my Schur complement is not being used. I've attached an output with view data and converged_reason data. I use the "inner" parameters for my Schur construction (code appended), so you see it at the beginning of this output. But it is also in each solve, which seems wrong to me.</div>
<div><br></div><div>Any thoughts?</div><div>Thanks,</div><div>Mark</div><div><br></div><div><br></div><div><div> call MatGetSize(solver%Bmat,M,N,ierr)</div><div> call VecDuplicate(Xsub(1),v1,ierr)</div><div>
call VecDuplicate(Xsub(1),v2,ierr)</div><div> call KSPCreate(solver%comm,innerksp,ierr)</div><div> call KSPSetOptionsPrefix(innerksp,'fsa_fieldsplit_lambda_inner_',ierr)</div><div> call KSPSetFromOptions(innerksp,ierr)</div>
<div> call KSPSetOperators(innerksp, solver%Amat, solver%Amat, ierr )</div><div> call KSPSetUp(innerksp,ierr)</div><div> call MatDuplicate(solver%Dmat,MAT_COPY_VALUES,solver%schur,ierr)</div><div> call MatGetOwnershipRange(solver%Cmat,low,high,ierr)</div>
<div> do k=0,N-1</div><div> call MatGetColumnVector(solver%Bmat,v1,k,ierr)</div><div> call KSPSolve(innerksp,v1,v2,ierr)</div><div> do j=0,N-1</div><div> call VecZeroEntries(v1,ierr)</div>
<div> if (j.ge.low .and.j.lt.high) then</div><div> call MatGetRow(solver%Cmat,j,ncols,cols,vals,ierr)</div><div> call VecSetValues(v1,ncols,cols,vals,INSERT_VALUES,ierr)</div><div>
!write(*,*) (vals(i), i=1,ncols)</div><div> call MatRestoreRow(solver%Cmat,j,ncols,cols,vals,ierr)</div><div> end if</div><div> call VecAssemblyBegin(v1,ierr)</div>
<div> call VecAssemblyEnd(v1,ierr)</div><div> call VecTDot(v1,v2,dot,ierr)</div><div> dot = -dot</div><div> call MatSetValues(solver%schur,ione,j,ione,k,dot,INSERT_VALUES,ierr) ! D - C (A-1) B</div>
<div> end do</div><div> end do</div><div> call MatAssemblyBegin(solver%schur,MAT_FINAL_ASSEMBLY,ierr)</div><div> call MatAssemblyEnd(solver%schur,MAT_FINAL_ASSEMBLY,ierr)</div><div> call VecDestroy(v1,ierr)</div>
<div> call VecDestroy(v2,ierr)</div><div> call KSPDestroy(innerksp,ierr)</div><div><br></div><div> call SNESGetKSP(solver%snes,innerksp,ierr)</div><div> call KSPGetPC(innerksp,spc,ierr)</div><div>
call PCFieldSplitSetSchurPre(spc,PC_FIELDSPLIT_SCHUR_PRE_USER,solver%schur,ierr)</div></div></div>