Rodin/Variational/Trace.h file

Matrix trace operator for matrix-valued functions.

This file defines the Trace class, which computes the trace (sum of diagonal elements) of matrix-valued functions in variational formulations.

Mathematical Foundation

For a square matrix $ A \in \mathbb{R}^{n \times n} $ , the trace is:

\[ \text{tr}(A) = \sum_{i=1}^n A_{ii} \]

Properties

The trace operator satisfies:

  • Linearity: $ \text{tr}(A + B) = \text{tr}(A) + \text{tr}(B) $
  • Scalar multiplication: $ \text{tr}(\alpha A) = \alpha \text{tr}(A) $
  • Cyclic property: $ \text{tr}(ABC) = \text{tr}(CAB) = \text{tr}(BCA) $
  • Transpose invariance: $ \text{tr}(A^T) = \text{tr}(A) $

Applications

  • Linear elasticity: $ \text{tr}(\boldsymbol{\varepsilon}) $ (volumetric strain)
  • Continuum mechanics: invariants of stress/strain tensors
  • Fluid dynamics: divergence from velocity gradient
  • General tensor operations

Usage Example

// Volumetric strain in linear elasticity
auto strain = 0.5 * (Jacobian(u) + Transpose(Jacobian(u)));
auto volumetric_strain = Trace(strain);  // tr(ε)

Namespaces

namespace Rodin
The Rodin library for Shape and Topology Optimization.
namespace Rodin::FormLanguage
Module for writing high level abstract expressions.
namespace Rodin::Variational
Module which provides the necessary tools for constructing variational problems.

Classes

template<class NestedDerived>
class Rodin::Variational::Trace<FunctionBase<NestedDerived>>
Trace of a FunctionBase instance.