\(k\)-form Type#
While Degrees of Freedom may be used to describe a function defined on a reference domain, this is not very useful when dealing with \(k\)-forms, since they have multiple components, with their functions spaces being variations of the same base space, depending on their covector basis bundle. As such, two types are provided:
To specify and obtain information about \(k\)-forms there is
KFormSpecstype.To hold and manipulate degrees of freedom of components there is
KFormtype.
- class fdg.KFormSpecs(order: int, base_space: FunctionSpace)#
Differential k-form specification.
- Parameters:
order (int) – Order of the k-form.
base_space (FunctionSpace) – Base space to use for the k-forms. This is also the space in which 0-forms are defined.
- get_component_basis(idx: int) CovectorBasis#
Get covector basis bundle for a component.
- Parameters:
idx (int) – Index of the component.
- Returns:
Covector basis bundle corresponding to the k-form component with the specified index.
- Return type:
- get_component_function_space(idx: int) FunctionSpace#
Get the function space for a component.
- Parameters:
idx (int) – Index of the component.
- Returns:
Function space corresponding to the k-form component with the specified index.
- Return type:
- get_component_slice(idx: int) slice#
Get the slice corresponding to degrees of freedom of a k-form component.
The resulting slice can be used to index into the flattened array of degrees of freedom to get the DoFs corresponding to a praticular component.
- base_space#
Base function space the k-form is based in.
- Type:
- component_dof_counts#
Number of DoFs in each component.
- Type:
numpy.typing.NDArray[numpy.int64]
- class fdg.KForm(specs: KFormSpecs)#
Type holding the degrees of freedom of a k-form.
- Parameters:
specs (KFormSpecs) – Specification of the k-form that is to be created.
- get_component_dofs(idx: int) numpy.tying.NDArray[numpy.double]#
Get the array containing the degrees of freedom for a k-form component.
- Parameters:
idx (int) – Index of the k-form component.
- Returns:
Array containing the degrees of freedom. This is not a copy, so changing values in it will change the values of degrees of freedom.
- Return type:
array
- specs#
Specifications of the k-form.
- Type:
- values#
Values of all k-form degrees of freedom.
- Type:
numpy.typing.NDArray[numpy.double]