[petsc-users] Computing Vector Norm Field wise

Matthew Knepley knepley at gmail.com
Thu Aug 21 10:00:31 CDT 2014


On Mon, Aug 18, 2014 at 2:42 PM, Matthew Knepley <knepley at gmail.com> wrote:

>
> On Aug 18, 2014 2:28 PM, "Luc Berger-Vergiat" <lb2653 at columbia.edu> wrote:
> >
> > Hi all,
> > I am using the fieldsplit/DM facility to work on a multiphysics problem.
> > I would like to get some field dependent convergence information.
> > Is there something similar to the VecStrideNorm function that can
> compute a residual for each field defined in the DM?
> > Or should I use the DM to extract subvectors and compute their norms?
>
> I wroteca monitor that does this. I am currently out of internet range,
> but I will mail it Wed when I get back.
>
Okay, what I have is not exactly what you want. I wrote something to look
at the errors by field:

    ierr = DMPlexComputeL2FieldDiff(dm, user->exactFuncs, (void *) ctxs, u,
ferror);CHKERRQ(ierr);

but you want the residual. If we do not care too much about performance, we
can easily do this using


http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecGetSubVector.html

and then VecNorm, where we get the IS from


http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCFieldSplitGetIS.html

You can write a simple monitor that calls these two.

  Thanks,

     Matt


>  Thanks
>
>       Matt
>
> > --
> > Best,
> > Luc
> >
> >
>



-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140821/97e4668e/attachment.html>


More information about the petsc-users mailing list