Getting the normal vector of a cell in <dim,spacedim> where dim<spacedim

15 views
Skip to first unread message

Bruno Blais

unread,
Nov 18, 2019, 12:19:53 PM11/18/19
to deal.II User Group
Hello,
I am currently working with triangulations that do not have matching dim-spacedim. For instance a Triangulation<2,3>. For a specific calculation, I would need the normal vector of the cell of the triangulation (so the vector perpendicular to the current cell at the gauss points). Is there any function that would allow me to calculate this vector?
I have looked at the cellAcessor class and the GeometryInfo struct, but so far the majority of the content seems geared towards gathering the normal of the faces of a cell. In this case, I am interested in the normal of the cell itself, not its faces.

In case this is not readily accessible, would you have a suggestion on how to calculate it in an efficient manner? I am thinking that a cross product between two vectors of the cell would do the job, but I am afraid that this would not work for non Q1 mapping.
Thanks you very much :)!
Bruno

Wolfgang Bangerth

unread,
Nov 18, 2019, 12:27:44 PM11/18/19
to dea...@googlegroups.com

Bruno,

> I am currently working with triangulations that do not have matching
> dim-spacedim. For instance a Triangulation<2,3>. For a specific
> calculation, I would need the normal vector of the cell of the
> triangulation (so the vector perpendicular to the current cell at the
> gauss points). Is there any function that would allow me to calculate
> this vector?
> I have looked at the cellAcessor class and the GeometryInfo struct, but
> so far the majority of the content seems geared towards gathering the
> normal of the faces of a cell. In this case, I am interested in the
> normal of the cell itself, not its faces.

Yes, you're looking at the wrong place. I bet you need this at the
quadrature points, and there the place to look is the FEValues class. It
has a member normal() that does what you need when you use it via an
FEValues (rather than FEFaceValues) object:

https://www.dealii.org/current/doxygen/deal.II/classFEValuesBase.html#ac25ec6835799c3b6c7c842f8acb05eb3

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

Bruno Blais

unread,
Nov 18, 2019, 12:40:08 PM11/18/19
to deal.II User Group
Wolfgang,
Thanks, this is exactly what I needed at exactly the right place...
I feel slightly dumb right now not having found it :(
Thanks for the quick answer.
Bruno
Reply all
Reply to author
Forward
0 new messages