# ffcx.ir.representationutils

Utility functions for some code shared between representations.

Functions

`create_quadrature_points_and_weights`(...[, ...]) | Create quadrature rule and return points and weights.
`integral_type_to_entity_dim`(integral_type, tdim) | Given integral_type and domain tdim, return the tdim of the integration entity.
`map_integral_points`(points, integral_type, ...) | Map points from reference entity to its parent reference cell.

Classes

`QuadratureRule`(points, weights[, tensor_factors]) | A quadrature rule.

class ffcx.ir.representationutils.QuadratureRule(points, weights, tensor_factors=None)

  Bases: `object`

  A quadrature rule.

  Initialise.

  id()

    Return unique deterministic identifier.

    Note

    This identifier is used to provide unique names to tables and symbols in generated code.

ffcx.ir.representationutils.create_quadrature(cellname: str, degree: int, rule: str, elements: list[_ElementBase]) → tuple[Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str], Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]]

  Create a quadrature rule.

ffcx.ir.representationutils.create_quadrature_points_and_weights(integral_type, cell, degree, rule, elements, use_tensor_product=False)

  Create quadrature rule and return points and weights.

ffcx.ir.representationutils.integral_type_to_entity_dim(integral_type, tdim)

  Given integral_type and domain tdim, return the tdim of the integration entity.

ffcx.ir.representationutils.map_edge_points(points: ndarray[tuple[Any, ...], dtype[float64]], edge: int, cellname: str) → ndarray[tuple[Any, ...], dtype[float64]]

  Map points from a reference edge to a physical edge.

ffcx.ir.representationutils.map_facet_points(points: ndarray[tuple[Any, ...], dtype[float64]], facet: int, cellname: str) → ndarray[tuple[Any, ...], dtype[float64]]

  Map points from a reference facet to a physical facet.

ffcx.ir.representationutils.map_integral_points(points, integral_type, cell, entity)

  Map points from reference entity to its parent reference cell.

ffcx.ir.representationutils.reference_cell_vertices(cellname: str) → ndarray[tuple[Any, ...], dtype[float64]]

  Get the vertices of a reference cell.