FunctionSpace

class dolfin.cpp.function.FunctionSpace(*args)

Bases: dolfin.cpp.common.Variable, dolfin.cpp.function.HierarchicalFunctionSpace

This class represents a finite element function space defined by a mesh, a finite element, and a local-to-global mapping of the degrees of freedom (dofmap).

Overloaded versions

  • FunctionSpace(mesh, element, dofmap)

    Create function space for given mesh, element and dofmap (shared data)

    Arguments
    mesh (Mesh)

    The mesh.

    element (FiniteElement)

    The element.

    dofmap (GenericDofMap)

    The dofmap.

  • FunctionSpace(mesh)

    Create empty function space for later initialization. This constructor is intended for use by any sub-classes which need to construct objects before the initialisation of the base class. Data can be attached to the base class using FunctionSpace::attach(...).

    Arguments
    mesh (Mesh)

    The mesh.

  • FunctionSpace(V)

    Copy constructor

    Arguments
    V (FunctionSpace)

    The object to be copied.

assign()

Assignment operator

Arguments
V (FunctionSpace)
Another function space.
child()

Return the child FunctionSpace in the hierarchy

collapse()

Overloaded versions

  • collapse()

    Collapse a subspace and return a new function space

    Returns
    FunctionSpace

    The new function space.

  • collapse(collapsed_dofs)

    Collapse a subspace and return a new function space and a map from new to old dofs

    Arguments
    collapsed_dofs (std::unordered_map<std::size_t, std::size_t>)

    The map from new to old dofs.

    Returns
    FunctionSpace

    The new function space.

component()

Return component

Returns
numpy.array(int)
The component (relative to superspace).
dim()

Return dimension of function space

Returns
int
The dimension of the function space.
dofmap()

Return dofmap

Returns
GenericDofMap
The dofmap.
element()

Return finite element

Returns
FiniteElement
The finite element.
extract_sub_space()

Extract subspace for component

Arguments
component (numpy.array(int))
The component.
Returns
FunctionSpace
The subspace.
has_cell()

Check if function space has given cell

Arguments
cell (Cell)
The cell.
Returns
bool
True if the function space has the given cell.
has_element()

Check if function space has given element

Arguments
element (FiniteElement)
The finite element.
Returns
bool
True if the function space has the given element.
interpolate()

Interpolate function v into function space, returning the vector of expansion coefficients

Arguments
expansion_coefficients (GenericVector)
The expansion coefficients.
v (GenericFunction)
The function to be interpolated.
leaf_node()

Return the finest FunctionSpace in hierarchy

mesh()

Return mesh

Returns
Mesh
The mesh.
parent()

Return the parent FunctionSpace in the hierarchy

print_dofmap()

Print dofmap (useful for debugging)

root_node()

Return the coarsest FunctionSpace in hierarchy

sub()

Extract subspace for component

Arguments
i (int)
Index of the subspace.
Returns
FunctionSpace
The subspace.
thisown

The membership flag