[petsc-users] dmplex face normals orientation

Matthew Knepley knepley at gmail.com
Fri Apr 14 04:00:31 CDT 2017


On Wed, Apr 12, 2017 at 10:52 AM, Ingo Gaertner <ingogaertner.tus at gmail.com>
wrote:

> Hello,
> I have problems determining the orientation of the face normals of a
> DMPlex.
>
> I create a DMPlex, for example with DMPlexCreateHexBoxMesh().
> Next, I get the face normals using DMPlexComputeGeometryFVM(DM dm, Vec
> *cellgeom, Vec *facegeom). facegeom gives the correct normals, but I don't
> know how the inside/outside is defined with respect to the adjacant cells?
>

The normal should be outward, unless the face has orientation < 0.


> Finally, I iterate over all cells. For each cell I iterate over the
> bounding faces (obtained from DMPlexGetCone) and try to obtain their
> orientation with respect to the current cell using
> DMPlexGetConeOrientation(). However, the six integers for the orientation
> are the same for each cell. I expect them to flip between neighbour cells,
> because if a face normal is pointing outside for any cell, the same normal
> is pointing inside for its neighbour. Apparently I have a misunderstanding
> here.
>

I see the orientations changing sign for adjacent cells. Want to send a
simple code? You should see this
for examples. You can run SNES ex12 with -dm_view ::ascii_info_detail to
see the change in sign.

  Thanks,

     Matt


> How can I make use of the face normals in facegeom and the orientation
> values from DMPlexGetConeOrientation() to get the outside face normals for
> each cell?
>
> Thank you
> Ingo
>
>
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Virenfrei.
> www.avast.com
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
> <#m_-6432344443275881332_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>



-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170414/0df8b671/attachment.html>


More information about the petsc-users mailing list