[petsc-users] Attach approximate null space to a fieldsplit block
Barry Smith
bsmith at mcs.anl.gov
Mon Aug 19 09:01:30 CDT 2013
To prevent confusion: it is PetscObjectCompose() not attach.
On Aug 19, 2013, at 8:03 AM, Matthew Knepley <knepley at gmail.com> wrote:
> On Mon, Aug 19, 2013 at 7:40 AM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> "Garth N. Wells" <gnw20 at cam.ac.uk> writes:
>
> > I'm using PCFIELDSPLIT for a mixed problem, with fields indicated via
> > an index set (using PCFieldSplitSetIS). I'd like to attach an
> > approximate null space to the A00 block of the system. Is there a way
> > to attach the null space to one block?
>
> There is a better way. You can attach the null space to the IS that forms the split
>
> PetscObjectAttach((PetscObject) is0, "nullspace", nullspace);
>
> and PCFIELDSPLIT will pull it out and attach it to the preconditioner for block 0.
>
> Matt
>
> With MatNest, you can use MatSetNearNullSpace on sub-blocks and it will
> be used automatically. This is also the low-memory way to use
> PCFieldSplit. Note that if you use MatSetValuesLocal, you can use the
> NEST format with identical code in assembly; only matrix creation is
> different, see src/snes/example/tutorials/ex28.c for an example that
> works with both AIJ and NEST formats.
>
> Otherwise, you should be able to PCSetUp, then get out the sub-solvers
> PCFieldSplitGetSubKSP, pull out their matrices, and call
> MatSetNearNullSpace. Those submatrices should not be overwritten as
> long as you use SAME_NONZERO_PATTERN, so the null space would still work
> in future iterations.
>
>
>
> --
> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
> -- Norbert Wiener
More information about the petsc-users
mailing list