symfem.mappings

Functions to map functions between cells.

Module Contents

Functions

identity(→ symfem.functions.AnyFunction)

Map functions.

l2(→ symfem.functions.AnyFunction)

Map functions, scaling by the determinant of the jacobian.

covariant(→ symfem.functions.AnyFunction)

Map H(curl) functions.

contravariant(→ symfem.functions.AnyFunction)

Map H(div) functions.

double_covariant(→ symfem.functions.MatrixFunction)

Map matrix functions.

double_contravariant(→ symfem.functions.MatrixFunction)

Map matrix functions.

identity_inverse_transpose(→ symfem.functions.AnyFunction)

Inverse transpose of identity().

l2_inverse_transpose(→ symfem.functions.AnyFunction)

Inverse transpose of l2().

covariant_inverse_transpose(→ symfem.functions.AnyFunction)

Inverse transpose of covariant().

contravariant_inverse_transpose(...)

Inverse transpose of contravariant().

identity_inverse(→ symfem.functions.AnyFunction)

Inverse of identity().

l2_inverse(→ symfem.functions.AnyFunction)

Inverse of l2().

covariant_inverse(→ symfem.functions.AnyFunction)

Inverse of covariant().

contravariant_inverse(→ symfem.functions.AnyFunction)

Inverse of contravariant().

double_covariant_inverse(→ symfem.functions.AnyFunction)

Inverse of double_covariant().

double_contravariant_inverse(...)

Inverse of double_contravariant().

get_mapping(...)

Get a mapping.

exception symfem.mappings.MappingNotImplemented

Bases: NotImplementedError

Exception thrown when a mapping is not implemented for an element.

symfem.mappings.identity(f_in: symfem.functions.FunctionInput, map: symfem.geometry.PointType, inverse_map: symfem.geometry.PointType, substitute: bool = True) symfem.functions.AnyFunction

Map functions.

Parameters:
  • f_in – The function

  • map – The map from the reference cell to the physical cell

  • inverse_map – The map to the reference cell from the physical cell

  • substitute – Should the inverse map be substituted in?

Returns:

The mapped function

symfem.mappings.l2(f_in: symfem.functions.FunctionInput, map: symfem.geometry.PointType, inverse_map: symfem.geometry.PointType, substitute: bool = True) symfem.functions.AnyFunction

Map functions, scaling by the determinant of the jacobian.

Parameters:
  • f_in – The function

  • map – The map from the reference cell to the physical cell

  • inverse_map – The map to the reference cell from the physical cell

  • substitute – Should the inverse map be substituted in?

Returns:

The mapped function

symfem.mappings.covariant(f_in: symfem.functions.FunctionInput, map: symfem.geometry.PointType, inverse_map: symfem.geometry.PointType, substitute: bool = True) symfem.functions.AnyFunction

Map H(curl) functions.

Parameters:
  • f_in – The function

  • map – The map from the reference cell to the physical cell

  • inverse_map – The map to the reference cell from the physical cell

  • substitute – Should the inverse map be substituted in?

Returns:

The mapped function

symfem.mappings.contravariant(f_in: symfem.functions.FunctionInput, map: symfem.geometry.PointType, inverse_map: symfem.geometry.PointType, substitute: bool = True) symfem.functions.AnyFunction

Map H(div) functions.

Parameters:
  • f_in – The function

  • map – The map from the reference cell to the physical cell

  • inverse_map – The map to the reference cell from the physical cell

  • substitute – Should the inverse map be substituted in?

Returns:

The mapped function

symfem.mappings.double_covariant(f_in: symfem.functions.FunctionInput, map: symfem.geometry.PointType, inverse_map: symfem.geometry.PointType, substitute: bool = True) symfem.functions.MatrixFunction

Map matrix functions.

Parameters:
  • f_in – The function

  • map – The map from the reference cell to the physical cell

  • inverse_map – The map to the reference cell from the physical cell

  • substitute – Should the inverse map be substituted in?

Returns:

The mapped function

symfem.mappings.double_contravariant(f_in: symfem.functions.FunctionInput, map: symfem.geometry.PointType, inverse_map: symfem.geometry.PointType, substitute: bool = True) symfem.functions.MatrixFunction

Map matrix functions.

Parameters:
  • f_in – The function

  • map – The map from the reference cell to the physical cell

  • inverse_map – The map to the reference cell from the physical cell

  • substitute – Should the inverse map be substituted in?

Returns:

The mapped function

symfem.mappings.identity_inverse_transpose(f_in: symfem.functions.FunctionInput, map: symfem.geometry.PointType, inverse_map: symfem.geometry.PointType, substitute: bool = True) symfem.functions.AnyFunction

Inverse transpose of identity().

Parameters:
  • f_in – The function

  • map – The map from the reference cell to the physical cell

  • inverse_map – The map to the reference cell from the physical cell

  • substitute – Should the inverse map be substituted in?

Returns:

The mapped function

symfem.mappings.l2_inverse_transpose(f_in: symfem.functions.FunctionInput, map: symfem.geometry.PointType, inverse_map: symfem.geometry.PointType, substitute: bool = True) symfem.functions.AnyFunction

Inverse transpose of l2().

Parameters:
  • f_in – The function

  • map – The map from the reference cell to the physical cell

  • inverse_map – The map to the reference cell from the physical cell

  • substitute – Should the inverse map be substituted in?

Returns:

The mapped function

symfem.mappings.covariant_inverse_transpose(f_in: symfem.functions.FunctionInput, map: symfem.geometry.PointType, inverse_map: symfem.geometry.PointType, substitute: bool = True) symfem.functions.AnyFunction

Inverse transpose of covariant().

Parameters:
  • f_in – The function

  • map – The map from the reference cell to the physical cell

  • inverse_map – The map to the reference cell from the physical cell

  • substitute – Should the inverse map be substituted in?

Returns:

The mapped function

symfem.mappings.contravariant_inverse_transpose(f_in: symfem.functions.FunctionInput, map: symfem.geometry.PointType, inverse_map: symfem.geometry.PointType, substitute: bool = True) symfem.functions.AnyFunction

Inverse transpose of contravariant().

Parameters:
  • f_in – The function

  • map – The map from the reference cell to the physical cell

  • inverse_map – The map to the reference cell from the physical cell

  • substitute – Should the inverse map be substituted in?

Returns:

The mapped function

symfem.mappings.identity_inverse(f_in: symfem.functions.FunctionInput, map: symfem.geometry.PointType, inverse_map: symfem.geometry.PointType, substitute: bool = True) symfem.functions.AnyFunction

Inverse of identity().

Parameters:
  • f_in – The function

  • map – The map from the reference cell to the physical cell

  • inverse_map – The map to the reference cell from the physical cell

  • substitute – Should the inverse map be substituted in?

Returns:

The mapped function

symfem.mappings.l2_inverse(f_in: symfem.functions.FunctionInput, map: symfem.geometry.PointType, inverse_map: symfem.geometry.PointType, substitute: bool = True) symfem.functions.AnyFunction

Inverse of l2().

Parameters:
  • f_in – The function

  • map – The map from the reference cell to the physical cell

  • inverse_map – The map to the reference cell from the physical cell

  • substitute – Should the inverse map be substituted in?

Returns:

The mapped function

symfem.mappings.covariant_inverse(f_in: symfem.functions.FunctionInput, map: symfem.geometry.PointType, inverse_map: symfem.geometry.PointType, substitute: bool = True) symfem.functions.AnyFunction

Inverse of covariant().

Parameters:
  • f_in – The function

  • map – The map from the reference cell to the physical cell

  • inverse_map – The map to the reference cell from the physical cell

  • substitute – Should the inverse map be substituted in?

Returns:

The mapped function

symfem.mappings.contravariant_inverse(f_in: symfem.functions.FunctionInput, map: symfem.geometry.PointType, inverse_map: symfem.geometry.PointType, substitute: bool = True) symfem.functions.AnyFunction

Inverse of contravariant().

Parameters:
  • f_in – The function

  • map – The map from the reference cell to the physical cell

  • inverse_map – The map to the reference cell from the physical cell

  • substitute – Should the inverse map be substituted in?

Returns:

The mapped function

symfem.mappings.double_covariant_inverse(f_in: symfem.functions.FunctionInput, map: symfem.geometry.PointType, inverse_map: symfem.geometry.PointType, substitute: bool = True) symfem.functions.AnyFunction

Inverse of double_covariant().

Parameters:
  • f_in – The function

  • map – The map from the reference cell to the physical cell

  • inverse_map – The map to the reference cell from the physical cell

  • substitute – Should the inverse map be substituted in?

Returns:

The mapped function

symfem.mappings.double_contravariant_inverse(f_in: symfem.functions.FunctionInput, map: symfem.geometry.PointType, inverse_map: symfem.geometry.PointType, substitute: bool = True) symfem.functions.AnyFunction

Inverse of double_contravariant().

Parameters:
  • f_in – The function

  • map – The map from the reference cell to the physical cell

  • inverse_map – The map to the reference cell from the physical cell

  • substitute – Should the inverse map be substituted in?

Returns:

The mapped function

symfem.mappings.get_mapping(mapname: str, inverse: bool = False, transpose: bool = False) Callable[[symfem.functions.FunctionInput, symfem.geometry.PointType, symfem.geometry.PointType, bool], symfem.functions.AnyFunction]

Get a mapping.

Parameters:
  • mapname – The name of the mapping

  • inverse – Should the map be inverted

  • transpose – Should the map be transposed

Returns:

A function that performs the mapping