Physics is governed by Partial differential algebraic equations which involve derivatives of fields. The ability to differentiate and integrate tensor fields is thus a key feature in numerical codes. In general relativity or in non-cartesian coordinate systems, differentiation and integration takes place on manifolds with non-necessarily-Lorentzian metric.
Examples of tensor fields which are linked one-to-the-other by differentiations are:
Integration is used to compute global quantities from local ones, ie. the current flowing through a wire, the energy in a physical system, etc. The generalized Stokes theorem (discussed below) is of particular importance when computing the integral of a derivative:
\[ \int_{\delta\Omega} \omega = \int_\Omega d\omega \]
Please refer to the reference document Discrete Differential Forms for Computational Modeling for a way more detailled description of the theory presented in this section.
A whole zoo of differential operators has been developed over the centuries : gradient, rotational, divergency, 4-gradient, 4-divergency, directional derivative, material derivative, covariant derivative, Lie derivative, etc. During the 20th century, mathematicians proposed a refactoring of it known as Exterior calculus, which revealed highly suitable for discretization (now known as Discrete exterior calculus). Only two fundamental operators are defined and can be used to build any possible differential operator on any-dimension manifold:
Those operators must be applied on differential forms, which can be assimilated to antisymmetric tensor fields. The exterior derivative transforms a \(k-\)form into a \(k+1-\)form. The Hodge star transforms a \(k-\)form into a \(n-k-\)form where \(n\) is the dimension of the manifold. The codifferential operator \(\delta = (-1)^{n(k+1)+1}\star d \star\) transforms a \(k-\)form into a \(k-1-\)form.
The generic Laplacian is defined as \(\delta d + d \delta\).
An important relation is the Poincarré Lemma \(dd = 0\). It leads to the very deep physical concept of gauge invariance, which tells us potentials are defined up to a derivative (because \(d(A+d\alpha) = dA + dd\alpha = dA\)).
A \(k-\)simplex is an oriented discrete element of dimension \(k\) belonging to the discrete manifold. Ie. a \(0\)-simplex is a node, a \(1\)-simplex is an edge, a \(2\)-simplex is a face and a \(3\)-simplex is a cell. It can be defined for any dimension \(n\) of the discrete manifold.
In SimiLie, a simplex derives from ddc::DiscreteElement
, associated to a shift vector with \(k\) 1
and \(n-k\) 0
, and a boolean flag negative
giving the orientation.
A \(k-\)chain - at least in the sense it is used in SimiLie - is basically a set of \(k-\)simplices.
1
, every simplex belonging to the chain thus has to be oriented accordingly to the chain purpose.The boundary operator associates to a \(k-\)simplex a \(k-1-\)chain containing the simplices which form the boundary of the simplex. It can also associate to a \(k-\)chain a \(k-1-\)chain forming the boundary of the chain.
A \(k-\)cosimplex is the association of a simplex and of a real (or complex) number.
A \(k-\)cochain is basically a set of cosimplices. This is a discrete differential \(k-\)form. It can be represented as a rank-k antisymmetric tensor field (there is a Cochain constructor which takes an antisymmetric tensor as argument).
The coboundary operator associates to a \(k-\)cochain a \(k+1-\)cosimplex or a \(k+1-\)cochain containing the cosimplices which form the coboundary of the cochain. Please refer to Discrete Differential Forms for Computational Modeling for more details. This is the discrete exterior derivative \(d\).
The Hodge star operator implements the formula:
\[ \star^{i_1, \dots, i_k}_{j_{k+1}, \dots, j_n} = \frac{\sqrt{\left|\det [g_{ab}]\right|}}{k!} g^{i_1 j_1}\cdots g^{i_k j_k} \,\varepsilon_{j_1, \dots, j_n} \]
With \(g\) the metric and \(\varepsilon\) the Levi-Civita tensor. It is expected to be applied on a differential form \(\omega_{i_1, \dots, i_k}\).