Rodin/Variational/Derivative.h file

Directional derivative operator for scalar functions.

This file defines the Derivative class, which computes directional derivatives of scalar functions. This generalizes the gradient concept to derivatives in specific directions.

Mathematical Foundation

The directional derivative of a function $ u $ in direction $ \mathbf{v} $ is:

\[ D_{\mathbf{v}} u = \nabla u \cdot \mathbf{v} = \lim_{h \to 0} \frac{u(x + h\mathbf{v}) - u(x)}{h} \]

Coordinate Derivatives

Special cases are partial derivatives:

  • $ \frac{\partial u}{\partial x_i} = D_{\mathbf{e}_i} u $ where $ \mathbf{e}_i $ is the $ i $ -th coordinate direction.

Applications

  • Normal derivatives: $ \frac{\partial u}{\partial n} = \nabla u \cdot \mathbf{n} $
  • Material derivatives in fluid dynamics
  • Characteristic methods for PDEs
  • Shape sensitivity analysis

Usage Example

// Normal derivative on boundary
auto n = BoundaryNormal();
auto normal_deriv = Derivative(u, n);  // \partialu/\partialn = \nabla u\cdotn

Namespaces

namespace Rodin
The Rodin library for finite element methods and shape optimization.
namespace Rodin::FormLanguage
Namespace Rodin::FormLanguage.
namespace Rodin::Variational
Namespace Rodin::Variational.

Classes

template<class NestedDerived, class FES, Variational::ShapeFunctionSpaceType Space>
struct Rodin::FormLanguage::Traits<Variational::Derivative<Variational::ShapeFunction<NestedDerived, FES, Space>>>
Type traits for Derivative over a shape function: exposes the shape function space, the finite element space, the scalar type and the operand type.
template<class FES, class Data, class Derived>
class Rodin::Variational::DerivativeBase<GridFunction<FES, Data>, Derived>
CRTP base for the partial derivative of a grid function.
template<class NestedDerived, class FES, ShapeFunctionSpaceType SpaceType>
class Rodin::Variational::Derivative<ShapeFunction<NestedDerived, FES, SpaceType>>
Partial derivative of a shape function.