# ffcx.analysis

Compiler stage 1: Analysis.

This module implements the analysis/preprocessing of variational forms, including automatic selection of elements, degrees and form representation type.

Functions

`analyze_ufl_objects`(ufl_objects, scalar_type) | Analyze ufl object(s).

Classes

`UFLData`(form_data, unique_elements, ...) | UFL data.

class ffcx.analysis.UFLData(form_data: tuple[ufl.algorithms.formdata.FormData, ...], unique_elements: list[basix.ufl._ElementBase], element_numbers: dict[basix.ufl._ElementBase, int], unique_coordinate_elements: list[basix.ufl._ElementBase], expressions: list[tuple[ufl.core.expr.Expr, npt.NDArray[np.floating], ufl.core.expr.Expr]])

  Bases: `NamedTuple`

  UFL data.

  Create new instance of UFLData(form_data, unique_elements, element_numbers, unique_coordinate_elements, expressions)

  element_numbers: dict[_ElementBase, int]

    Alias for field number 2

  expressions: list[tuple[Expr, ndarray[tuple[Any, ...], dtype[floating]], Expr]]

    Alias for field number 4

  form_data: tuple[FormData, ...]

    Alias for field number 0

  unique_coordinate_elements: list[_ElementBase]

    Alias for field number 3

  unique_elements: list[_ElementBase]

    Alias for field number 1

ffcx.analysis.analyze_ufl_objects(ufl_objects: list[Form | _ElementBase | Mesh | tuple[Expr, ndarray[tuple[Any, ...], dtype[floating]]]], scalar_type: type[Any] | dtype[Any] | _SupportsDType[dtype[Any]] | tuple[Any, Any] | list[Any] | _DTypeDict | str | None) → UFLData

  Analyze ufl object(s).

  Parameters:

    - ufl_objects – UFL objects

    - scalar_type – Scalar type that should be used for the analysis

  Returns:

    form_datas: Form_data objects unique_elements: Unique elements across all forms and expressions element_numbers: Mapping to unique numbers for all elements unique_coordinate_elements: Unique coordinate elements across all forms and expressions expressions: List of all expressions after post-processing, with its evaluation points

    > and the original expression

  Return type:

    A data structure holding