# ufl_legacy.finiteelement package

## Submodules

## ufl_legacy.finiteelement.brokenelement module

class ufl_legacy.finiteelement.brokenelement.BrokenElement(element)

  Bases: `FiniteElementBase`

  The discontinuous version of an existing Finite Element space.

  mapping()

    Not implemented.

  reconstruct(**kwargs)
  shortstr()

    Format as string for pretty printing.

## ufl_legacy.finiteelement.elementlist module

This module provides an extensive list of predefined finite element families. Users or, more likely, form compilers, may register new elements by calling the function register_element.

ufl_legacy.finiteelement.elementlist.canonical_element_description(family, cell, order, form_degree)

  Given basic element information, return corresponding element information on canonical form.

  Input: family, cell, (polynomial) order, form_degree Output: family (canonical), short_name (for printing), order, value shape, reference value shape, sobolev_space.

  This is used by the FiniteElement constructor to ved input data against the element list and aliases defined in ufl.

ufl_legacy.finiteelement.elementlist.feec_element(family, n, r, k)

  Finite element exterior calculus notation n = topological dimension of domain r = polynomial order k = form_degree

ufl_legacy.finiteelement.elementlist.feec_element_l2(family, n, r, k)

  Finite element exterior calculus notation n = topological dimension of domain r = polynomial order k = form_degree

ufl_legacy.finiteelement.elementlist.register_alias(alias, to)

ufl_legacy.finiteelement.elementlist.register_element(family, short_name, value_rank, sobolev_space, mapping, degree_range, cellnames)

  Register new finite element family.

ufl_legacy.finiteelement.elementlist.register_element2(family, value_rank, sobolev_space, mapping, degree_range, cellnames)

  Register new finite element family.

ufl_legacy.finiteelement.elementlist.show_elements()

  Shows all registered elements.

## ufl_legacy.finiteelement.enrichedelement module

This module defines the UFL finite element classes.

class ufl_legacy.finiteelement.enrichedelement.EnrichedElement(*elements)

  Bases: `EnrichedElementBase`

  The vector sum of several finite element spaces:

  \[\textrm{EnrichedElement}(V, Q) = \{v + q | v \in V, q \in Q\}.\]

  Dual basis is a concatenation of subelements dual bases; primal basis is a concatenation of subelements primal bases; resulting element is not nodal even when subelements are. Structured basis may be exploited in form compilers.

  is_cellwise_constant()

    Return whether the basis functions of this element is spatially constant over each cell.

  shortstr()

    Format as string for pretty printing.

class ufl_legacy.finiteelement.enrichedelement.EnrichedElementBase(*elements)

  Bases: `FiniteElementBase`

  The vector sum of several finite element spaces:

  \[\textrm{EnrichedElement}(V, Q) = \{v + q | v \in V, q \in Q\}.\]
  mapping()

    Not implemented.

  reconstruct(**kwargs)
  sobolev_space()

    Return the underlying Sobolev space.

class ufl_legacy.finiteelement.enrichedelement.NodalEnrichedElement(*elements)

  Bases: `EnrichedElementBase`

  The vector sum of several finite element spaces:

  \[\textrm{EnrichedElement}(V, Q) = \{v + q | v \in V, q \in Q\}.\]

  Primal basis is reorthogonalized to dual basis which is a concatenation of subelements dual bases; resulting element is nodal.

  is_cellwise_constant()

    Return whether the basis functions of this element is spatially constant over each cell.

  shortstr()

    Format as string for pretty printing.

## ufl_legacy.finiteelement.facetelement module

ufl_legacy.finiteelement.facetelement.FacetElement(element)

  Constructs the restriction of a finite element to the facets of the cell.

## ufl_legacy.finiteelement.finiteelement module

This module defines the UFL finite element classes.

class ufl_legacy.finiteelement.finiteelement.FiniteElement(family, cell=None, degree=None, form_degree=None, quad_scheme=None, variant=None)

  Bases: `FiniteElementBase`

  The basic finite element class for all simple finite elements.

  mapping()

    Not implemented.

  reconstruct(family=None, cell=None, degree=None, quad_scheme=None, variant=None)

    Construct a new FiniteElement object with some properties replaced with new values.

  shortstr()

    Format as string for pretty printing.

  sobolev_space()

    Return the underlying Sobolev space.

  variant()

    Return the variant used to initialise the element.

## ufl_legacy.finiteelement.finiteelementbase module

This module defines the UFL finite element classes.

class ufl_legacy.finiteelement.finiteelementbase.FiniteElementBase(family, cell, degree, quad_scheme, value_shape, reference_value_shape)

  Bases: `object`

  Base class for all finite elements.

  cell()

    Return cell of finite element.

  degree(component=None)

    Return polynomial degree of finite element.

  extract_component(i)

    Recursively extract component index relative to a (simple) element and that element for given value component index.

  extract_reference_component(i)

    Recursively extract reference component index relative to a (simple) element and that element for given reference value component index.

  extract_subelement_component(i)

    Extract direct subelement index and subelement relative component index for a given component index.

  extract_subelement_reference_component(i)

    Extract direct subelement index and subelement relative reference component index for a given reference component index.

  family()

    Return finite element family.

  is_cellwise_constant(component=None)

    Return whether the basis functions of this element is spatially constant over each cell.

  mapping()

    Not implemented.

  num_sub_elements()

    Return number of sub-elements.

  quadrature_scheme()

    Return quadrature scheme of finite element.

  reference_value_shape()

    Return the shape of the value space on the reference cell.

  reference_value_size()

    Return the integer product of the reference value shape.

  sub_elements()

    Return list of sub-elements.

  symmetry()

    Return the symmetry dict, which is a mapping \(c_0 \to c_1\) meaning that component \(c_0\) is represented by component \(c_1\). A component is a tuple of one or more ints.

  value_shape()

    Return the shape of the value space on the global domain.

  value_size()

    Return the integer product of the value shape.

  variant()

    Return the variant used to initialise the element.

## ufl_legacy.finiteelement.hdivcurl module

class ufl_legacy.finiteelement.hdivcurl.HCurlElement(element)

  Bases: `FiniteElementBase`

  A curl-conforming version of an outer product element, assuming this makes mathematical sense.

  mapping()

    Not implemented.

  reconstruct(**kwargs)
  shortstr()

    Format as string for pretty printing.

  sobolev_space()

    Return the underlying Sobolev space.

class ufl_legacy.finiteelement.hdivcurl.HDivElement(element)

  Bases: `FiniteElementBase`

  A div-conforming version of an outer product element, assuming this makes mathematical sense.

  mapping()

    Not implemented.

  reconstruct(**kwargs)
  shortstr()

    Format as string for pretty printing.

  sobolev_space()

    Return the underlying Sobolev space.

class ufl_legacy.finiteelement.hdivcurl.WithMapping(wrapee, mapping)

  Bases: `FiniteElementBase`

  Specify an alternative mapping for the wrappee. For example, to use identity mapping instead of Piola map with an element E, write remapped = WithMapping(E, “identity”)

  mapping()

    Not implemented.

  reconstruct(**kwargs)
  reference_value_shape()

    Return the shape of the value space on the reference cell.

  shortstr()
  value_shape()

    Return the shape of the value space on the global domain.

## ufl_legacy.finiteelement.interiorelement module

ufl_legacy.finiteelement.interiorelement.InteriorElement(element)

  Constructs the restriction of a finite element to the interior of the cell.

## ufl_legacy.finiteelement.mixedelement module

This module defines the UFL finite element classes.

class ufl_legacy.finiteelement.mixedelement.MixedElement(*elements, **kwargs)

  Bases: `FiniteElementBase`

  A finite element composed of a nested hierarchy of mixed or simple elements.

  degree(component=None)

    Return polynomial degree of finite element.

  extract_component(i)

    Recursively extract component index relative to a (simple) element and that element for given value component index.

  extract_reference_component(i)

    Recursively extract reference_component index relative to a (simple) element and that element for given value reference_component index.

  extract_subelement_component(i)

    Extract direct subelement index and subelement relative component index for a given component index.

  extract_subelement_reference_component(i)

    Extract direct subelement index and subelement relative reference_component index for a given reference_component index.

  is_cellwise_constant(component=None)

    Return whether the basis functions of this element is spatially constant over each cell.

  mapping()

    Not implemented.

  num_sub_elements()

    Return number of sub elements.

  reconstruct(**kwargs)
  reconstruct_from_elements(*elements)

    Reconstruct a mixed element from new subelements.

  shortstr()

    Format as string for pretty printing.

  sub_elements()

    Return list of sub elements.

  symmetry()

    Return the symmetry dict, which is a mapping \(c_0 \to c_1\) meaning that component \(c_0\) is represented by component \(c_1\). A component is a tuple of one or more ints.

class ufl_legacy.finiteelement.mixedelement.TensorElement(family, cell=None, degree=None, shape=None, symmetry=None, quad_scheme=None, variant=None)

  Bases: `MixedElement`

  A special case of a mixed finite element where all elements are equal.

  extract_subelement_component(i)

    Extract direct subelement index and subelement relative component index for a given component index.

  flattened_sub_element_mapping()
  mapping()

    Not implemented.

  reconstruct(**kwargs)
  shortstr()

    Format as string for pretty printing.

  symmetry()

    Return the symmetry dict, which is a mapping \(c_0 \to c_1\) meaning that component \(c_0\) is represented by component \(c_1\). A component is a tuple of one or more ints.

  variant()

    Return the variant used to initialise the element.

class ufl_legacy.finiteelement.mixedelement.VectorElement(family, cell=None, degree=None, dim=None, form_degree=None, quad_scheme=None, variant=None)

  Bases: `MixedElement`

  A special case of a mixed finite element where all elements are equal.

  mapping()

    Not implemented.

  reconstruct(**kwargs)
  shortstr()

    Format as string for pretty printing.

  variant()

    Return the variant used to initialise the element.

## ufl_legacy.finiteelement.restrictedelement module

This module defines the UFL finite element classes.

class ufl_legacy.finiteelement.restrictedelement.RestrictedElement(element, restriction_domain)

  Bases: `FiniteElementBase`

  Represents the restriction of a finite element to a type of cell entity.

  is_cellwise_constant()

    Return whether the basis functions of this element is spatially constant over each cell.

  mapping()

    Not implemented.

  num_restricted_sub_elements()

    Return number of restricted sub elements.

  num_sub_elements()

    Return number of sub elements.

  reconstruct(**kwargs)
  restricted_sub_elements()

    Return list of restricted sub elements.

  restriction_domain()

    Return the domain onto which the element is restricted.

  shortstr()

    Format as string for pretty printing.

  sub_element()

    Return the element which is restricted.

  sub_elements()

    Return list of sub elements.

  symmetry()

    Return the symmetry dict, which is a mapping \(c_0 \to c_1\) meaning that component \(c_0\) is represented by component \(c_1\). A component is a tuple of one or more ints.

## ufl_legacy.finiteelement.tensorproductelement module

This module defines the UFL finite element classes.

class ufl_legacy.finiteelement.tensorproductelement.TensorProductElement(*elements, **kwargs)

  Bases: `FiniteElementBase`

  The tensor product of \(d\) element spaces:

  \[V = V_1 \otimes V_2 \otimes ... \otimes V_d\]

  Given bases \(\{\phi_{j_i}\}\) of the spaces \(V_i\) for \(i = 1, ...., d\), \(\{ \phi_{j_1} \otimes \phi_{j_2} \otimes \cdots \otimes \phi_{j_d} \}\) forms a basis for \(V\).

  mapping()

    Not implemented.

  num_sub_elements()

    Return number of subelements.

  reconstruct(**kwargs)
  shortstr()

    Short pretty-print.

  sobolev_space()

    Return the underlying Sobolev space of the TensorProductElement.

  sub_elements()

    Return subelements (factors).

## Module contents

This module defines the UFL finite element classes.