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, options)

Analyze ufl object(s).

Classes

UFLData(form_data, unique_elements, ...)

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

class ffcx.analysis.UFLData(form_data, unique_elements, element_numbers, unique_coordinate_elements, expressions)[source]

Bases: NamedTuple

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[Any, dtype[float64]], 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, options: Dict) UFLData[source]

Analyze ufl object(s).

Options

ufl_objects options

FFCx options. These options take priority over all other set options.

Returns a data structure holding

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

ffcx.analysis.convert_element(element: FiniteElementBase) _ElementBase[source]

Convert and element to a FFCx element.

ffcx.analysis.warn()

Issue a warning, or maybe ignore it or raise an exception.

message

Text of the warning message.

category

The Warning category subclass. Defaults to UserWarning.

stacklevel

How far up the call stack to make this warning appear. A value of 2 for example attributes the warning to the caller of the code calling warn().

source

If supplied, the destroyed object which emitted a ResourceWarning

skip_file_prefixes

An optional tuple of module filename prefixes indicating frames to skip during stacklevel computations for stack frame attribution.