finiteelement Package¶
finiteelement
Package¶
This module defines the UFL finite element classes.
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.finiteelement.elementlist.
register_alias
(alias, to)¶
-
ufl.finiteelement.elementlist.
register_element
(family, short_name, value_rank, degree_range, cellnames)¶ Register new finite element family
-
ufl.finiteelement.elementlist.
show_elements
()¶
enrichedelement
Module¶
This module defines the UFL finite element classes.
-
class
ufl.finiteelement.enrichedelement.
EnrichedElement
(*elements)¶ Bases:
ufl.finiteelement.finiteelementbase.FiniteElementBase
The vector sum of two finite element spaces:
EnrichedElement(V, Q) = {v + q | v in V, q in Q}.
-
is_cellwise_constant
()¶ Return whether the basis functions of this element is spatially constant over each cell.
-
reconstruct
(**kwargs)¶ Construct a new EnrichedElement object with some properties replaced with new values.
-
shortstr
()¶ Format as string for pretty printing.
-
feec
Module¶
-
ufl.finiteelement.feec.
FEEC_aliases
(name, cell, r, k)¶ FEEC_aliases(name, cell, r, k):
name: “P Lambda” or “P- Lambda” cell: “interval”, “triangle”, “tetrahedron” r (polynomial degree): 1 <= r < ... k (form degree): 0 <= k <= n
where n is the topological dimension of the cell.
The families
P_r Lambda^k P-_r Lambda^k
map to H^1/H(curl)/H(div)/L^2 conforming finite element spaces based on the notation used in”Finite element exterior calculus, homological techniques and applications,”, Arnold, Falk and Winther, Acta Numerica, 2006, Table 5.1 and 5.2 (p. 60)
finiteelement
Module¶
This module defines the UFL finite element classes.
-
class
ufl.finiteelement.finiteelement.
FiniteElement
(family, domain=None, degree=None, quad_scheme=None, form_degree=None)¶ Bases:
ufl.finiteelement.finiteelementbase.FiniteElementBase
The basic finite element class for all simple finite elements
Create finite element
- Arguments
- family (string)
- The finite element family
- domain
- The geometric domain
- degree (int)
- The polynomial degree (optional)
- quad_scheme
- The quadrature scheme (optional)
- form_degree (int)
- The form degree (FEEC notation, used when field is viewed as k-form)
-
reconstruct
(**kwargs)¶ Construct a new FiniteElement object with some properties replaced with new values.
-
shortstr
()¶ Format as string for pretty printing.
finiteelementbase
Module¶
This module defines the UFL finite element classes.
-
class
ufl.finiteelement.finiteelementbase.
FiniteElementBase
(family, domain, degree, quad_scheme, value_shape)¶ Bases:
object
Base class for all finite elements
Initialize basic finite element data
-
basic_element_instances
()¶
-
cell
()¶ Return cell of finite element
-
cell_restriction
()¶ Return the cell type onto which the element is restricted.
-
degree
(component=None)¶ Return polynomial degree of finite element
-
domain
(component=None)¶ Return the domain on which this element is defined.
-
extract_component
(i)¶ Recursively extract component index relative to a (simple) element and that element for given value component index
-
extract_subelement_component
(i)¶ Extract direct subelement index and subelement relative component index for a given 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.
-
num_sub_elements
()¶ Return number of sub elements
-
quadrature_scheme
()¶ Return quadrature scheme of finite element
-
regions
()¶ Return the regions referenced by this element and its subelements.
-
sub_elements
()¶ Return list of sub elements
-
symmetry
()¶ Return the symmetry dict, which is a mapping c0 -> c1 meaning that component c0 is represented by component c1.
-
unique_basic_elements
()¶
-
value_shape
()¶ Return the shape of the value space
-
mixedelement
Module¶
This module defines the UFL finite element classes.
-
class
ufl.finiteelement.mixedelement.
MixedElement
(*elements, **kwargs)¶ Bases:
ufl.finiteelement.finiteelementbase.FiniteElementBase
A finite element composed of a nested hierarchy of mixed or simple elements
Create mixed finite element from given list of elements
-
degree
(component=None)¶ Return polynomial degree of finite element
-
domain
(component=None)¶ Return the domain on which this element is defined.
-
extract_component
(i)¶ Recursively extract component index relative to a (simple) element and that element for given value component index
-
extract_subelement_component
(i)¶ Extract direct subelement index and subelement relative component index for a given component index
-
is_cellwise_constant
(component=None)¶ Return whether the basis functions of this element is spatially constant over each cell.
-
mixed_sub_elements
()¶ Return list of mixed sub elements.
-
num_mixed_sub_elements
()¶ Return number of mixed sub elements.
-
num_sub_elements
()¶ Return number of sub elements.
-
reconstruct
(**kwargs)¶ Construct a new MixedElement object with some properties replaced with new values.
-
reconstruct_from_elements
(*elements)¶ Reconstruct a mixed element from new subelements.
-
regions
()¶ Return the regions referenced by this element and its subelements.
-
shortstr
()¶ Format as string for pretty printing.
-
sub_elements
()¶ Return list of sub elements.
-
symmetry
()¶ Return the symmetry dict, which is a mapping c0 -> c1 meaning that component c0 is represented by component c1. A component is a tuple of one or more ints.
-
-
class
ufl.finiteelement.mixedelement.
TensorElement
(family, domain, degree, shape=None, symmetry=None, quad_scheme=None)¶ Bases:
ufl.finiteelement.mixedelement.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)¶ Extract direct subelement index and subelement relative component index for a given component index
-
reconstruct
(**kwargs)¶
-
shortstr
()¶ Format as string for pretty printing.
-
symmetry
()¶ Return the symmetry dict, which is a mapping c0 -> c1 meaning that component c0 is represented by component c1.
-
-
class
ufl.finiteelement.mixedelement.
VectorElement
(family, domain, degree, dim=None, quad_scheme=None, form_degree=None)¶ Bases:
ufl.finiteelement.mixedelement.MixedElement
A special case of a mixed finite element where all elements are equal
Create vector element (repeated mixed element)
- Arguments
- family (string)
- The finite element family
- domain
- The geometric domain
- degree (int)
- The polynomial degree
- dim (int)
- The value dimension of the element (optional)
- quad_scheme
- The quadrature scheme (optional)
- form_degree (int)
- The form degree (FEEC notation, used when field is viewed as k-form)
-
reconstruct
(**kwargs)¶
-
shortstr
()¶ Format as string for pretty printing.
restrictedelement
Module¶
This module defines the UFL finite element classes.
-
class
ufl.finiteelement.restrictedelement.
RestrictedElement
(element, cell_restriction)¶ Bases:
ufl.finiteelement.finiteelementbase.FiniteElementBase
Represents the restriction of a finite element to a type of cell entity.
-
cell_restriction
()¶ Return the domain onto which the element is restricted.
-
element
()¶ Return the element which is restricted.
-
is_cellwise_constant
()¶ Return whether the basis functions of this element is spatially constant over each cell.
-
num_restricted_sub_elements
()¶ Return number of restricted sub elements.
-
num_sub_elements
()¶ Return number of sub elements
-
reconstruct
(**kwargs)¶ Construct a new RestrictedElement object with some properties replaced with new values.
-
restricted_sub_elements
()¶ Return list of restricted sub elements.
-
shortstr
()¶ Format as string for pretty printing.
-
sub_elements
()¶ Return list of sub elements
-
symmetry
()¶ Return the symmetry dict, which is a mapping c0 -> c1 meaning that component c0 is represented by component c1.
-
tensorproductelement
Module¶
This module defines the UFL finite element classes.
-
class
ufl.finiteelement.tensorproductelement.
TensorProductElement
(*elements)¶ Bases:
ufl.finiteelement.finiteelementbase.FiniteElementBase
The tensor product of d element spaces:
\[V = V_0 \otimes V_1 \otimes ... \otimes V_d\]Given bases {phi_i} for V_i for i = 1, ...., d, { phi_0 * phi_1 * ... * phi_d } forms a basis for V.
Create TensorProductElement from a given list of elements.
-
num_sub_elements
()¶ Return number of subelements.
-
num_tensorproduct_sub_elements
()¶ Return number of tensorproduct sub elements.
-
shortstr
()¶ Short pretty-print.
-
sub_elements
()¶ Return subelements (factors).
-
tensorproduct_sub_elements
()¶ Return list of tensorproduct sub elements.
-