Exterior Derivative#
To be able to solve differential equations at all, one must be capable of taking the derivative of a \(k\)-form. One way this can be done by explicitly evaluating the so-called “incidence” matrix, then multiplying the vector with degrees of freedom with it. Alternatively, one can instead just apply the effect of such a matrix to the vector/matrix in question. This is typically the preferred way, since for many types of basis the incidence matrix is sparse and the entries are values that are very cheap to compute. Still, both options are available for use.
For the k-form operator function, there are four ways the operator can be applied in. These four ways are the result of being able to choose to whether or not to transpose the incidence operator, and if it should be applied on the right.
|
|
|
|
\(\mathbb{E}^{(k+1,k)} x^{(k)} = y^{(k+1)}\) |
\(\left(\mathbb{E}^{(k+1,k)}\right)^T x^{(k+1)} = y^{(k)}\) |
|
\(x^{(k+1)} \mathbb{E}^{(k+1,k)} = y^{(k)}\) |
\(x^{(k)} \left(\mathbb{E}^{(k+1,k)}\right)^T = y^{(k+1)}\) |
- fdg.incidence_matrix(basis_specs: BasisSpecs) numpy.typing.NDArray[numpy.double]#
Return the incidence matrix to transfer derivative degrees of freedom.
- Parameters:
specs (BasisSpecs) – Basis specs for which this incidence matrix should be computed.
- Returns:
One dimensional incidence matrix. It transfers primal degrees of freedom for a derivative to a function space one order less than the original.
- Return type:
array
- fdg.incidence_operator(val: numpy.typing.ArrayLike, /, specs: BasisSpecs, axis: int = 0) numpy.typing.NDArray[numpy.double]#
Apply the incidence operator to an array of degrees of freedom along an axis.
- Parameters:
val (array_like) – Array of degrees of freedom to apply the incidence operator to.
specs (BasisSpecs) – Specifications for basis that determine what set of polynomial is used to take the derivative.
axis (int, default: 0) – Axis along which to apply the incidence operator along.
- Returns:
Array of degrees of freedom that is the result of applying the incidence operator, along the specified axis.
- Return type:
array
- fdg.incidence_kform_operator(specs: KFormSpecs, values: numpy.typing.NDArray[np.double], transpose: bool = False, *, out: numpy.typing.NDArray[numpy.double] | None = None) numpy.typing.NDArray[numpy.double]#
Apply the incidence operator on the k-form.
- Parameters:
specs (KFormSpecs) – Specifications of the input k-form on which this operator is to be applied on.
values (array) – Array which contains the degrees of freedom of all components flattened along the last axis. Treated as a row-major matrix or a vector, depending if 1D or 2D.
transpose (bool, default: False) – Apply the transpose of the incidence operator instead.
out (array, optional) – Array to which the result is written to. The first axis must have the same size as the number of output degrees of freedom of the resulting k-form. If the input was 2D, this must be as well, with the last axis matching the input’s last axis.
- Returns:
Values of the degrees of freedom of the derivative of the input k-form. When an output array is specified through the parameters, another reference to it is returned, otherwise a new array is created to hold the result and returned.
- Return type:
array
- fdg.compute_kform_incidence_matrix(base_space: FunctionSpace, order: int) numpy.typing.NDArray[numpy.double]#
Compute the incidence matrix which maps a k-form to its (k + 1)-form derivative.
- Parameters:
base_space (FunctionSpace) – Base function space, which describes the function space used for 0-forms.
order (int) – Order of the k-form to get the incidence matrix for.
- Returns:
Matrix, which maps degrees of freedom for the input k-form to the degrees of freedom of its (k + 1)-form derivative.
- Return type:
array