Transforming \(k\)-forms#

As was mentioned in the section about k-form Type, the \(k\)-forms described by KForm are defined on the reference domain. As such, they need to be transformed to the physical domain to be able to meaningfully interpret them.

To support that, several functions are provided:

fdg.transform_kform_to_target(order: int, smap: SpaceMap, components: numpy.typing.ArrayLike, *, out: numpy.typing.NDArray[numpy.double] | None = None) numpy.typing.NDArray[numpy.double]#

Transform k-form values based on a space mapping.

Parameters:
  • order (int) – Order of the k-form being transformed.

  • smap (SpaceMap) – Mapping between the reference and target domain to use.

  • components (array_like) – Array with values of components of the k-form in the reference domain at integration points associated with the space mapping.

  • out (array, optional) – Array to use to store the output in.

Returns:

Array with values of the components in the physical space.

Return type:

array

fdg.transform_kform_component_to_target(order: int, smap: SpaceMap, component: numpy.typing.ArrayLike, index: int, *, out: numpy.typing.NDArray[numpy.double] | None = None) numpy.typing.NDArray[numpy.double]#

Transform k-form values based on a space mapping.

Parameters:
  • order (int) – Order of the k-form being transformed.

  • smap (SpaceMap) – Mapping between the reference and target domain to use.

  • component (array_like) – Values of component in the reference domain at integration points associated with the space mapping.

  • index (int) – Index of the component that is to be computed.

  • out (array, optional) – Array to use to store the output in.

Returns:

Array with values of the components in the physical space.

Return type:

array

fdg.transform_covariant_to_target(smap: SpaceMap, components: numpy.typing.ArrayLike, *, out: numpy.typing.NDArray[numpy.double] | None = None) numpy.typing.NDArray[numpy.double]#

Transform covariant 1-form components from reference to target domain.

Parameters:
  • smap (SpaceMap) – Mapping from the reference space to the physical space to use to transform the components.

  • components (array_like) – Array where the first dimension indexes the components in the reference space. All other dimensions will be treated as if flattened.

  • out (array, optional) – Array to used to write the resulting transformed components to. If it is not specified, a new array is created.

Returns:

Array of transformed covariant components. If the out parameter was given, a new reference to it is returned, otherwise a reference to the newly created output array is returned.

Return type:

array

fdg.transform_contravariant_to_target(smap: SpaceMap, components: numpy.typing.ArrayLike, *, out: numpy.typing.NDArray[numpy.double] | None = None) numpy.typing.NDArray[numpy.double]#

Transform contravariant vector components from reference to target domain.

Since the basis of 1-forms are covectors, which are as the name implies covarying, the values of components are contravarying. Once transformed to the target domain, the 1-form can be lowered to a tangent vector field trivially.

Parameters:
  • smap (SpaceMap) – Mapping from the reference space to the physical space to use to transform the components.

  • components (array_like) – Array where the first dimension indexes the components in the reference space. All other dimensions will be treated as if flattened.

  • out (array, optional) – Array to used to write the resulting transformed components to. If it is not specified, a new array is created.

Returns:

Array of transformed covariant components. If the out parameter was given, a new reference to it is returned, otherwise a reference to the newly created output array is returned.

Return type:

array