<div dir="ltr"><div dir="ltr">On Sun, Mar 7, 2021 at 4:13 PM Nicolas Barral <<a href="mailto:nicolas.barral@math.u-bordeaux.fr">nicolas.barral@math.u-bordeaux.fr</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 07/03/2021 16:54, Matthew Knepley wrote:<br>
> On Sun, Mar 7, 2021 at 8:52 AM Nicolas Barral <br>
> <<a href="mailto:nicolas.barral@math.u-bordeaux.fr" target="_blank">nicolas.barral@math.u-bordeaux.fr</a> <br>
> <mailto:<a href="mailto:nicolas.barral@math.u-bordeaux.fr" target="_blank">nicolas.barral@math.u-bordeaux.fr</a>>> wrote:<br>
> <br>
> Matt,<br>
> <br>
> Thanks for your answer.<br>
> <br>
> However, DMPlexComputeCellGeometryFVM does not compute what I need<br>
> (normals of height 1 entities). I can't find any function doing<br>
> that, is<br>
> there one ?<br>
> <br>
> <br>
> The normal[] in DMPlexComputeCellGeometryFVM() is exactly what you want. <br>
> What does not look right to you?<br>
<br>
<br>
So it turns out it's not what I want because I need non-normalized <br>
normals. It doesn't seem like I can easily retrieve the norm, can I?<br></blockquote><div><br></div><div>You just want area-weighted normals I think, which means that you just multiply by the area,</div><div>which comes back in the same function.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
If not, I'll fallback to computing them by hand for now. Is the <br>
following assumption safe or do I have to use DMPlexGetOrientedFace?<br>
> if I call P0P1P2P3 a tet and note x the cross product,<br>
> P3P2xP3P1 is the outward normal to face P1P2P3<br>
> P0P2xP0P3 " P0P2P3<br>
> P3P1xP3P0 " P0P1P3<br>
> P0P1xP0P2 " P0P1P2<br>
<br>
Thanks<br>
<br>
-- <br>
Nicolas<br>
> <br>
> Thanks,<br>
> <br>
> Matt<br>
> <br>
> So far I've been doing it by hand, and after a lot of experimenting the<br>
> past weeks, it seems that if I call P0P1P2P3 a tetrahedron and note x<br>
> the cross product,<br>
> P3P2xP3P1 is the outward normal to face P1P2P3<br>
> P0P2xP0P3 " P0P2P3<br>
> P3P1xP3P0 " P0P1P3<br>
> P0P1xP0P2 " P0P1P2<br>
> Have I been lucky but can't expect it to be true ?<br>
> <br>
> (Alternatively, there is a link between the normals and the element<br>
> Jacobian, but I don't know the formula and can find them)<br>
> <br>
> <br>
> Thanks,<br>
> <br>
> -- <br>
> Nicolas<br>
> <br>
> On 08/02/2021 15:19, Matthew Knepley wrote:<br>
> > On Mon, Feb 8, 2021 at 6:01 AM Nicolas Barral<br>
> > <<a href="mailto:nicolas.barral@math.u-bordeaux.fr" target="_blank">nicolas.barral@math.u-bordeaux.fr</a><br>
> <mailto:<a href="mailto:nicolas.barral@math.u-bordeaux.fr" target="_blank">nicolas.barral@math.u-bordeaux.fr</a>><br>
> > <mailto:<a href="mailto:nicolas.barral@math.u-bordeaux.fr" target="_blank">nicolas.barral@math.u-bordeaux.fr</a><br>
> <mailto:<a href="mailto:nicolas.barral@math.u-bordeaux.fr" target="_blank">nicolas.barral@math.u-bordeaux.fr</a>>>> wrote:<br>
> ><br>
> > Hi all,<br>
> ><br>
> > Can I make any assumption on the orientation of triangular<br>
> facets in a<br>
> > tetrahedral plex ? I need the inward facet normals. Do I need<br>
> to use<br>
> > DMPlexGetOrientedFace or can I rely on either the tet vertices<br>
> > ordering,<br>
> > or the faces ordering ? Could DMPlexGetRawFaces_Internal be<br>
> enough ?<br>
> ><br>
> ><br>
> > You can do it by hand, but you have to account for the face<br>
> orientation<br>
> > relative to the cell. That is what<br>
> > DMPlexGetOrientedFace() does. I think it would be easier to use the<br>
> > function below.<br>
> ><br>
> > Alternatively, is there a function that computes the normals<br>
> - without<br>
> > bringing out the big guns ?<br>
> ><br>
> ><br>
> > This will compute the normals<br>
> ><br>
> ><br>
> <a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DMPLEX/DMPlexComputeCellGeometryFVM.html" rel="noreferrer" target="_blank">https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DMPLEX/DMPlexComputeCellGeometryFVM.html</a><br>
> > Should not be too heavy weight.<br>
> ><br>
> > THanks,<br>
> ><br>
> > Matt<br>
> ><br>
> > Thanks<br>
> ><br>
> > --<br>
> > Nicolas<br>
> ><br>
> ><br>
> ><br>
> > --<br>
> > What most experimenters take for granted before they begin their<br>
> > experiments is infinitely more interesting than any results to which<br>
> > their experiments lead.<br>
> > -- Norbert Wiener<br>
> ><br>
> > <a href="https://www.cse.buffalo.edu/~knepley/" rel="noreferrer" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br>
> <<a href="http://www.cse.buffalo.edu/~knepley/" rel="noreferrer" target="_blank">http://www.cse.buffalo.edu/~knepley/</a>><br>
> <br>
> <br>
> <br>
> -- <br>
> What most experimenters take for granted before they begin their <br>
> experiments is infinitely more interesting than any results to which <br>
> their experiments lead.<br>
> -- Norbert Wiener<br>
> <br>
> <a href="https://www.cse.buffalo.edu/~knepley/" rel="noreferrer" target="_blank">https://www.cse.buffalo.edu/~knepley/</a> <<a href="http://www.cse.buffalo.edu/~knepley/" rel="noreferrer" target="_blank">http://www.cse.buffalo.edu/~knepley/</a>><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="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>