<div dir="ltr"><div dir="ltr">On Sun, Mar 7, 2021 at 4:51 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"><br>
On 07/03/2021 22:30, Matthew Knepley wrote:<br>
> On Sun, Mar 7, 2021 at 4:13 PM 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>
> 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>><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>
> > Matt,<br>
> ><br>
> > Thanks for your answer.<br>
> ><br>
> > However, DMPlexComputeCellGeometryFVM does not compute what I<br>
> 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<br>
> 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>
> <br>
> <br>
> You just want area-weighted normals I think, which means that you just <br>
> multiply by the area,<br>
> which comes back in the same function.<br>
><br>
<br>
Ah by the area times 2, of course, my bad.<br>
Do you order height-1 elements in a certain way ? I need to access the <br>
facet (resp. edge) opposite to a vertex in a tet (resp. triangle).<br></blockquote><div><br></div><div>Yes. Now that I have pretty much settled on it, I will put it in the manual. It is currently here:</div><div><br></div><div> <a href="https://gitlab.com/petsc/petsc/-/blob/main/src/dm/impls/plex/plexinterpolate.c#L56">https://gitlab.com/petsc/petsc/-/blob/main/src/dm/impls/plex/plexinterpolate.c#L56</a></div><div><br></div><div>All normals are outward facing, but hopefully the ordering in the sourse file makes sense.</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">
Thanks<br>
<br>
-- <br>
Nicolas<br>
<br>
<br>
> Thanks,<br>
> <br>
> Matt<br>
> <br>
> 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<br>
> experimenting the<br>
> > past weeks, it seems that if I call P0P1P2P3 a tetrahedron<br>
> 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<br>
> 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>>><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><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<br>
> I need<br>
> > to use<br>
> > > DMPlexGetOrientedFace or can I rely on either the tet<br>
> vertices<br>
> > > ordering,<br>
> > > or the faces ordering ? Could<br>
> 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<br>
> to use the<br>
> > > function below.<br>
> > ><br>
> > > Alternatively, is there a function that computes the<br>
> normals<br>
> > - without<br>
> > > bringing out the big guns ?<br>
> > ><br>
> > ><br>
> > > This will compute the normals<br>
> > ><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<br>
> their<br>
> > > experiments is infinitely more interesting than any<br>
> 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><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>