Rodin/Variational/FaceNormal.h file

Unit normal vector on mesh faces for DG and face-based formulations.

This file defines the FaceNormal class, which represents a unit normal vector on codimension-one mesh entities (faces in 3D, edges in 2D). Face normals are fundamental in face-based finite element formulations, notably in Discontinuous Galerkin (DG) methods where numerical fluxes, jumps, and averages depend on a consistent face orientation.

Mathematical Foundation

Let $ F $ be a codimension-one polytope of the mesh. A face normal is a vector field $ \mathbf{n}_F $ such that

\[ \|\mathbf{n}_F\| = 1. \]

Geometrically, the normal is orthogonal to the tangent space of the face.

For an interior face shared by two adjacent cells $ K_1 $ and $ K_2 $ , the normal is defined only up to sign unless one chooses which adjacent cell defines the outward direction. In trace-based formulations, this side is determined by the chosen trace domain.

For a boundary face, there is a unique adjacent cell $ K $ , and the normal is oriented automatically outward from that cell.

Orientation Convention

The orientation is chosen as follows:

  • Boundary face (one adjacent cell): the normal is oriented automatically outward from the unique incident cell.
  • Interior face (two adjacent cells): the normal is oriented outward from the unique adjacent cell whose attribute belongs to the trace domain.

Consequently, on interior faces the normal is trace-dependent, while on boundary faces it is determined geometrically from the unique incident cell.

Trace Semantics

The FaceNormal object supports both boundary and interior codimension-one entities, but the meaning differs slightly:

  • On a boundary face, no trace domain is required, since there is only one adjacent cell and the outward direction is unambiguous.
  • On an interior face, a trace domain is required to select which side of the interface defines the outward direction. If no trace domain is provided, or if none of the adjacent cells matches it, the normal is considered undefined and an exception is raised.

This behavior makes FaceNormal suitable for DG interface terms where one needs a normal consistent with a chosen side of the interface.

Applications in DG Methods

Typical uses include:

  • Numerical fluxes: $ \hat{f}(u^+, u^-, \mathbf{n}) $
  • Jump terms: $ [\![u]\!] = u^+ \mathbf{n}^+ + u^- \mathbf{n}^- $
  • Average-normal couplings: $ \{\!\{\nabla u\}\!\} \cdot \mathbf{n} $
  • Penalty terms: $ \frac{\sigma}{h} [\![u]\!] \cdot [\![v]\!] $

Difference from BoundaryNormal

  • FaceNormal: defined on all codimension-one mesh entities; on interior faces its orientation may depend on the trace domain.
  • BoundaryNormal: defined only on the boundary of the domain and always oriented outward.

Manifold Assumption

This implementation assumes that a codimension-one mesh entity is incident to either:

  • exactly one cell (boundary face), or
  • exactly two cells (interior face).

Non-manifold situations with more than two incident cells are not supported.

Usage Example

FaceNormal n(mesh);

// DG numerical flux on interfaces
auto flux = InterfaceIntegral(Average(u) * Dot(n.traceOf(omega), Jump(v)));

// Normal component of a vector field on a boundary region
auto un = Dot(velocity, n);

Namespaces

namespace Rodin
The Rodin library for finite element methods and shape optimization.
namespace Rodin::Variational
Module which provides the necessary tools for constructing and solving variational problems.

Classes

class Rodin::Variational::FaceNormal
Unit normal vector on codimension-one mesh entities.