Rodin/Variational/FaceNormal.h file

Normal vector on mesh faces for DG methods.

This file defines the FaceNormal class, which represents the unit normal vector on mesh faces (both interior and boundary). Face normals are crucial for Discontinuous Galerkin (DG) methods where numerical fluxes depend on the normal direction at element interfaces.

Mathematical Foundation

For a face $ F $ shared by elements $ K^+ $ and $ K^- $ , the face normal $ \mathbf{n} $ satisfies:

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

Orientation Convention

The normal direction is chosen according to a consistent orientation:

  • For interior faces: points from $ K^+ $ to $ K^- $
  • For boundary faces: points outward from the domain

Applications in DG Methods

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

Difference from BoundaryNormal

  • FaceNormal: Defined on all faces (interior + boundary)
  • BoundaryNormal: Only defined on domain boundary

Usage Example

FaceNormal n(mesh);

// DG numerical flux on interior faces
auto flux = InterfaceIntegral(Average(u) * Dot(n, Jump(v)));

// Normal component of vector field
auto normal_component = Dot(velocity, n);

Namespaces

namespace Rodin
The Rodin library for Shape and Topology Optimization.
namespace Rodin::Variational
Module which provides the necessary tools for constructing variational problems.

Classes

class Rodin::Variational::FaceNormal
Unit normal vector on mesh faces.