On Tue, Oct 23, 2018 at 3:12 AM Josh L <[email protected]> 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/>

Reply via email to