[petsc-users] fieldsplit: Unhandled case, must have at least two fields, not 1!

Jed Brown jedbrown at mcs.anl.gov
Sun Dec 1 11:12:33 CST 2013


Mark Adams <mfadams at lbl.gov> writes:

> Perhaps this will help. The code is straight forward but prefixes are used.
>  I've appended the code and a stack trace for the error.
>
>   ! create KSP
>   call KSPCreate(solver%comm,solver%ksp,ierr)
>   CHKERRQ(ierr)
>   if (solver%prefix.eq.2) then ! turb
>      call KSPSetOptionsPrefix(solver%ksp,'s2_',ierr)
>      if (sml_mype/sml_pe_per_plane .gt. 0) then ! not first, no monitor
>         call PetscOptionsClearValue('-s2_ksp_monitor',ierr)
>         call PetscOptionsClearValue('-s2_ksp_converged_reason',ierr)
>      endif
>   else ! 1 field 00 solver, no prefix
>      call PetscOptionsClearValue('-ksp_monitor',ierr)
>      call PetscOptionsClearValue('-ksp_converged_reason',ierr)

Yuck.  The options table is for the (run-time) user.  Manually futzing
with options, especially clearing options, is a dirty hack that should
not be used by choice.

>   end if
>   call KSPSetFromOptions(solver%ksp,ierr)
>   CHKERRQ(ierr)
>
>   call KSPSetOperators(solver%ksp,  solver%Amat,  solver%Amat,
> SAME_NONZERO_PATTERN, ierr )
>   CHKERRQ(ierr)
>
>   ! setup solver now that matrix is complete
>   call KSPSetUp( solver%ksp, ierr )  !!! poisson.F90:213

Where does your code call PCFieldSplitSetIS() or similar?  How is the
PCFieldSplit supposed to know about the splits?  What runtime options
are you passing?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20131201/3684d6a2/attachment.pgp>


More information about the petsc-users mailing list