<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Tue, Oct 23, 2018 at 3:12 AM Josh L <<a href="mailto:ysjosh.lo@gmail.com">ysjosh.lo@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>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. </div><div>Is there any better way to do it with DMPlex?</div></div></blockquote><div><br></div><div>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.</div><div>You can easily project functions of finite element fields using DMPlexProjectField(). You would give a pointwise function that would</div><div>calculate your stress and everything else should be automatic.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>The PetscSF given by DMPlexDistribute has the info how mesh points are distributed. </div><div>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?</div></div></blockquote><div><br></div><div>I would really discourage this kind of thinking. This is what made historical FEM code impossible to use or optimize.</div><div><br></div><div>  Thanks,</div><div><br></div><div>    Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Thanks,</div><div>Josh</div><div><br></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>