FunctionSpace¶
-
class
dolfin.functions.functionspace.
FunctionSpace
(mesh, family, degree, form_degree=None, constrained_domain=None, restriction=None)¶ Bases:
dolfin.functions.functionspace.FunctionSpaceBase
FunctionSpace represents a finite element function space.
Create finite element function space.
- Arguments
- mesh (
Mesh
) - the mesh
- family (string)
- specification of the element family, see below for alternatives.
- degree (int)
- the degree of the element.
- form_degree (int)
- the form degree (FEEC notation, used when field is viewed as k-form)
- constrained_domain
- constrained subdomain with map function.
- restriction
- restriction of the element (e.g. to cell facets).
- mesh (
Which families and degrees that are supported is determined by the form compiler used to generate the element, but typical families include
Name Usage Argyris* “ARG” Arnold-Winther* “AW” Brezzi-Douglas-Fortin-Marini* “BDFM” Brezzi-Douglas-Marini “BDM” Bubble “B” Crouzeix-Raviart “CR” Discontinuous Lagrange “DG” Discontinuous Raviart-Thomas “DRT” Hermite* “HER” Lagrange “CG” Mardal-Tai-Winther* “MTW” Morley* “MOR” Nedelec 1st kind H(curl) “N1curl” Nedelec 2nd kind H(curl) “N2curl” Quadrature “Q” Raviart-Thomas “RT” Real “R” *only partly supported.
- Examples of usage
To define a discrete function space over e.g. the unit square:
mesh = UnitSquare(32,32) V = FunctionSpace(mesh, "CG", 1)
Here,
"CG"
stands for Continuous Galerkin, implying the standard Lagrange family of elements. Instead of"CG"
, we could have written"Lagrange"
. With degree 1, we get the linear Lagrange element. Other examples include:# Discontinuous element of degree 0 V = FunctionSpace(mesh, "DG", 0) # Brezzi-Douglas-Marini element of degree 2 W = FunctionSpace(mesh, "BDM", 2) # Real element with one global degree of freedom R = FunctionSpace(mesh, "R", 0)
-
restriction
(meshfunction)¶