finat.ufl package¶
Submodules¶
finat.ufl.brokenelement module¶
Element.
- class finat.ufl.brokenelement.BrokenElement(element)[source]¶
Bases:
FiniteElementBase
The discontinuous version of an existing Finite Element space.
Init.
- property embedded_subdegree¶
Return embedded subdegree.
- property embedded_superdegree¶
Return embedded superdegree.
- property sobolev_space¶
Return the underlying Sobolev space.
finat.ufl.elementlist module¶
Element.
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.
- finat.ufl.elementlist.canonical_element_description(family, cell, order, form_degree)[source]¶
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.
- finat.ufl.elementlist.feec_element(family, n, r, k)[source]¶
Finite element exterior calculus notation.
n = topological dimension of domain r = polynomial order k = form_degree
- finat.ufl.elementlist.feec_element_l2(family, n, r, k)[source]¶
Finite element exterior calculus notation.
n = topological dimension of domain r = polynomial order k = form_degree
finat.ufl.enrichedelement module¶
This module defines the UFL finite element classes.
- class finat.ufl.enrichedelement.EnrichedElement(*elements)[source]¶
Bases:
EnrichedElementBase
The vector sum of several finite element spaces.
\[\begin{split}\\textrm{EnrichedElement}(V, Q) = \\{v + q | v \\in V, q \\in Q\\}.\end{split}\]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.
Doc.
- class finat.ufl.enrichedelement.EnrichedElementBase(*elements)[source]¶
Bases:
FiniteElementBase
The vector sum of several finite element spaces.
Doc.
- property embedded_subdegree¶
Return embedded subdegree.
- property embedded_superdegree¶
Return embedded superdegree.
- property sobolev_space¶
Return the underlying Sobolev space.
- class finat.ufl.enrichedelement.NodalEnrichedElement(*elements)[source]¶
Bases:
EnrichedElementBase
The vector sum of several finite element spaces.
\[\begin{split}\\textrm{EnrichedElement}(V, Q) = \\{v + q | v \\in V, q \\in Q\\}.\end{split}\]Primal basis is reorthogonalized to dual basis which is a concatenation of subelements dual bases; resulting element is nodal.
Doc.
finat.ufl.finiteelement module¶
This module defines the UFL finite element classes.
- class finat.ufl.finiteelement.FiniteElement(family, cell=None, degree=None, form_degree=None, quad_scheme=None, variant=None)[source]¶
Bases:
FiniteElementBase
The basic finite element class for all simple finite elements.
Create finite element.
- Args:
family: The finite element family cell: The geometric cell degree: The polynomial degree (optional) form_degree: The form degree (FEEC notation, used when field is
viewed as k-form)
quad_scheme: The quadrature scheme (optional) variant: Hint for the local basis function variant (optional)
- property embedded_subdegree¶
Return embedded subdegree.
- property embedded_superdegree¶
Return embedded superdegree.
- reconstruct(family=None, cell=None, degree=None, quad_scheme=None, variant=None)[source]¶
Construct a new FiniteElement object with some properties replaced with new values.
- property sobolev_space¶
Return the underlying Sobolev space.
finat.ufl.finiteelementbase module¶
This module defines the UFL finite element classes.
- class finat.ufl.finiteelementbase.FiniteElementBase(family, cell, degree, quad_scheme, value_shape, reference_value_shape)[source]¶
Bases:
AbstractFiniteElement
Base class for all finite elements.
Initialize basic finite element data.
- property cell¶
Return cell of finite element.
- property embedded_subdegree¶
Doc.
- property embedded_superdegree¶
Doc.
- extract_component(i)[source]¶
Recursively extract component index relative to a (simple) element.
and that element for given value component index.
- extract_reference_component(i)[source]¶
Recursively extract reference component index relative to a (simple) element.
and that element for given reference value component index.
- extract_subelement_component(i)[source]¶
Extract direct subelement index and subelement relative component index for a given component index.
- extract_subelement_reference_component(i)[source]¶
Extract direct subelement index and subelement relative.
reference component index for a given reference component index.
- is_cellwise_constant(component=None)[source]¶
Return whether the basis functions of this element is spatially constant over each cell.
- property num_sub_elements¶
Return number of sub-elements.
- property pullback¶
Get the pull back.
- property reference_value_shape¶
Return the shape of the value space on the reference cell.
- property reference_value_size¶
Return the integer product of the reference value shape.
- abstract property sobolev_space¶
Return the underlying Sobolev space.
- property sub_elements¶
Return list of sub-elements.
- symmetry()[source]¶
Return the symmetry dict.
This 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.
- property value_shape¶
Return the shape of the value space on the global domain.
- property value_size¶
Return the integer product of the value shape.
finat.ufl.hdivcurl module¶
Doc.
- class finat.ufl.hdivcurl.CallableSobolevSpace(name, parents=None)[source]¶
Bases:
SobolevSpace
A Sobolev space that can be called to create HDiv and HCurl elements.
Instantiate a SobolevSpace object.
- Args:
name: The name of this space, parents: A set of Sobolev spaces of which this space is a subspace.
- class finat.ufl.hdivcurl.HCurlElement(element)[source]¶
Bases:
FiniteElementBase
A curl-conforming version of an outer product element, assuming this makes mathematical sense.
Doc.
- property embedded_subdegree¶
Return embedded subdegree.
- property embedded_superdegree¶
Return embedded superdegree.
- property sobolev_space¶
Return the underlying Sobolev space.
- class finat.ufl.hdivcurl.HDivElement(element)[source]¶
Bases:
FiniteElementBase
A div-conforming version of an outer product element, assuming this makes mathematical sense.
Doc.
- property embedded_subdegree¶
Return embedded subdegree.
- property embedded_superdegree¶
Return embedded superdegree.
- property sobolev_space¶
Return the underlying Sobolev space.
- class finat.ufl.hdivcurl.WithMapping(wrapee, mapping)[source]¶
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”)
Doc.
- property embedded_subdegree¶
Return embedded subdegree.
- property embedded_superdegree¶
Return embedded superdegree.
- property reference_value_shape¶
Doc.
- property sobolev_space¶
Return the underlying Sobolev space.
- property value_shape¶
Doc.
finat.ufl.mixedelement module¶
This module defines the UFL finite element classes.
- class finat.ufl.mixedelement.MixedElement(*elements, **kwargs)[source]¶
Bases:
FiniteElementBase
A finite element composed of a nested hierarchy of mixed or simple elements.
Create mixed finite element from given list of elements.
- property embedded_subdegree¶
Return embedded subdegree.
- property embedded_superdegree¶
Return embedded superdegree.
- extract_component(i)[source]¶
Recursively extract component index relative to a (simple) element.
and that element for given value component index.
- extract_reference_component(i)[source]¶
Recursively extract reference_component index relative to a (simple) element.
and that element for given value reference_component index.
- extract_subelement_component(i)[source]¶
Extract direct subelement index and subelement relative.
component index for a given component index.
- extract_subelement_reference_component(i)[source]¶
Extract direct subelement index and subelement relative.
reference_component index for a given reference_component index.
- is_cellwise_constant(component=None)[source]¶
Return whether the basis functions of this element is spatially constant over each cell.
- property num_sub_elements¶
Return number of sub elements.
- property pullback¶
Get the pull back.
- property sobolev_space¶
Doc.
- property sub_elements¶
Return list of sub elements.
- class finat.ufl.mixedelement.TensorElement(family, cell=None, degree=None, shape=None, symmetry=None, quad_scheme=None, variant=None)[source]¶
Bases:
MixedElement
A special case of a mixed finite element where all elements are equal.
Create tensor element (repeated mixed element with optional symmetries).
- extract_subelement_component(i)[source]¶
Extract direct subelement index and subelement relative.
component index for a given component index.
- property pullback¶
Get pull back.
- class finat.ufl.mixedelement.VectorElement(family, cell=None, degree=None, dim=None, form_degree=None, quad_scheme=None, variant=None)[source]¶
Bases:
MixedElement
A special case of a mixed finite element where all elements are equal.
Create vector element (repeated mixed element).
finat.ufl.restrictedelement module¶
This module defines the UFL finite element classes.
- class finat.ufl.restrictedelement.RestrictedElement(element, restriction_domain)[source]¶
Bases:
FiniteElementBase
Represents the restriction of a finite element to a type of cell entity.
Doc.
- is_cellwise_constant()[source]¶
Return whether the basis functions of this element is spatially constant over each cell.
- property num_sub_elements¶
Return number of sub elements.
- property sobolev_space¶
Doc.
- property sub_elements¶
Return list of sub elements.
finat.ufl.tensorproductelement module¶
This module defines the UFL finite element classes.
- class finat.ufl.tensorproductelement.TensorProductElement(*elements, **kwargs)[source]¶
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\).
Create TensorProductElement from a given list of elements.
- property embedded_subdegree¶
Doc.
- property embedded_superdegree¶
Doc.
- property num_sub_elements¶
Return number of subelements.
- property sobolev_space¶
Return the underlying Sobolev space of the TensorProductElement.
- property sub_elements¶
Return subelements (factors).
Module contents¶
Legacy UFL features.