[petsc-users] DMPlex, output value on gauss point to vertex
Matthew Knepley
knepley at gmail.com
Tue Oct 23 09:40:27 CDT 2018
On Tue, Oct 23, 2018 at 3:12 AM Josh L <ysjosh.lo at gmail.com> wrote:
> Hi,
>
> My FEM codes calculate the stress field on gauss point, but when I output
> the stress field, I want it to on vertex. My old codes find the gauss
> points that surround a vertex and calculate the average.
> Is there any better way to do it with DMPlex?
>
In general, I would project the answer into a finite element space for
output, unless you can think of a reason that this is unacceptable.
You can easily project functions of finite element fields using
DMPlexProjectField(). You would give a pointwise function that would
calculate your stress and everything else should be automatic.
> The PetscSF given by DMPlexDistribute has the info how mesh points are
> distributed.
> Can I create a mapping from it or it can be used to map mesh point in
> natural ordering to global ordering or the other way around?
>
I would really discourage this kind of thinking. This is what made
historical FEM code impossible to use or optimize.
Thanks,
Matt
> Thanks,
> Josh
>
>
--
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
https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20181023/71f6d869/attachment.html>
More information about the petsc-users
mailing list