Note: this is documentation for an old release. View the latest documentation at docs.fenicsproject.org/basix/v0.9.0/cpp/namespacebasix.html

Basix 0.4.0

Home     Installation     Demos     C++ docs     Python docs

Namespaces | Classes | Functions
basix Namespace Reference

Basix: FEniCS runtime basis evaluation library. More...

Namespaces

 cell
 Information about reference cells.
 
 doftransforms
 Functions to transform DOFs in high degree Lagrange spaces.
 
 element
 Interfaces for creating finite elements.
 
 indexing
 Indexing.
 
 lattice
 Lattices of points.
 
 maps
 Information about finite element maps.
 
 math
 Mathematical functions.
 
 moments
 Functions to create integral moment DOFs.
 
 polynomials
 Polynomials.
 
 polyset
 Polynomial expansion sets.
 
 precompute
 Matrix and permutation precomputation.
 
 quadrature
 Quadrature rules.
 

Classes

class  FiniteElement
 A finite element. More...
 

Functions

FiniteElement create_custom_element (cell::type cell_type, int degree, const std::vector< std::size_t > &value_shape, const xt::xtensor< double, 2 > &wcoeffs, const std::array< std::vector< xt::xtensor< double, 2 >>, 4 > &x, const std::array< std::vector< xt::xtensor< double, 3 >>, 4 > &M, maps::type map_type, bool discontinuous, int highest_complete_degree)
 
FiniteElement create_element (element::family family, cell::type cell, int degree, element::lagrange_variant lvariant, bool discontinuous)
 
FiniteElement create_element (element::family family, cell::type cell, int degree, element::lagrange_variant lvariant, element::dpc_variant dvariant, bool discontinuous)
 
FiniteElement create_element (element::family family, cell::type cell, int degree, element::dpc_variant dvariant, bool discontinuous)
 
FiniteElement create_element (element::family family, cell::type cell, int degree, bool discontinuous)
 
FiniteElement create_element (element::family family, cell::type cell, int degree, element::lagrange_variant lvariant)
 
FiniteElement create_element (element::family family, cell::type cell, int degree, element::lagrange_variant lvariant, element::dpc_variant dvariant)
 
FiniteElement create_element (element::family family, cell::type cell, int degree, element::dpc_variant dvariant)
 
FiniteElement create_element (element::family family, cell::type cell, int degree)
 
std::string version ()
 
xt::xtensor< double, 2 > compute_interpolation_operator (const FiniteElement &element_from, const FiniteElement &element_to)
 

Detailed Description

Basix: FEniCS runtime basis evaluation library.

Function Documentation

◆ compute_interpolation_operator()

xt::xtensor< double, 2 > basix::compute_interpolation_operator ( const FiniteElement element_from,
const FiniteElement element_to 
)

Computes a matrix that represents the interpolation between two elements.

If the two elements have the same value size, this function returns the interpolation between them.

If element_from has value size 1 and element_to has value size > 1, then this function returns a matrix to interpolate from a blocked element_from (ie multiple copies of element_from) into element_to.

If element_to has value size 1 and element_from has value size > 1, then this function returns a matrix that interpolates the components of element_from into copies of element_to.

Note
If the elements have different value sizes and both are greater than 1, this function throws a runtime error

In order to interpolate functions between finite element spaces on arbitrary cells, the functions must be pulled back to the reference element (this pull back includes applying DOF transformations). The matrix that this function returns can then be applied, then the result pushed forward to the cell. If element_from and element_to have the same map type, then only the DOF transformations need to be applied, as the pull back and push forward cancel each other out.

Parameters
[in]element_fromThe element to interpolate from
[in]element_toThe element to interpolate to
Returns
Matrix operator that maps the 'from' degrees-of-freedom to the 'to' degrees-of-freedom

◆ create_custom_element()

basix::FiniteElement basix::create_custom_element ( cell::type  cell_type,
int  degree,
const std::vector< std::size_t > &  value_shape,
const xt::xtensor< double, 2 > &  wcoeffs,
const std::array< std::vector< xt::xtensor< double, 2 >>, 4 > &  x,
const std::array< std::vector< xt::xtensor< double, 3 >>, 4 > &  M,
maps::type  map_type,
bool  discontinuous,
int  highest_complete_degree 
)

Create a custom finite element

Parameters
[in]cell_typeThe cell type
[in]degreeThe degree of the element
[in]value_shapeThe value shape of the element
[in]wcoeffsMatrices for the kth value index containing the expansion coefficients defining a polynomial basis spanning the polynomial space for this element
[in]xInterpolation points. Shape is (tdim, entity index, point index, dim)
[in]MThe interpolation matrices. Indices are (tdim, entity index, dof, vs, point_index)
[in]map_typeThe type of map to be used to map values from the reference to a cell
[in]discontinuousIndicates whether or not this is the discontinuous version of the element
[in]highest_complete_degreeThe highest degree n such that a Lagrange (or vector Lagrange) element of degree n is a subspace of this element
Returns
A custom finite element

◆ create_element() [1/8]

basix::FiniteElement basix::create_element ( element::family  family,
cell::type  cell,
int  degree 
)

Create a continuous element

Parameters
[in]familyThe element family
[in]cellThe reference cell type that the element is defined on
[in]degreeThe degree of the element
Returns
A finite element

◆ create_element() [2/8]

basix::FiniteElement basix::create_element ( element::family  family,
cell::type  cell,
int  degree,
bool  discontinuous 
)

Create an element

Parameters
[in]familyThe element family
[in]cellThe reference cell type that the element is defined on
[in]degreeThe degree of the element
[in]discontinuousIndicates whether the element is discontinuous between cells points of the element. The discontinuous element will have the same DOFs, but they will all be associated with the interior of the cell.
Returns
A finite element

◆ create_element() [3/8]

basix::FiniteElement basix::create_element ( element::family  family,
cell::type  cell,
int  degree,
element::dpc_variant  dvariant 
)

Create a continuous element using a given DPC variant

Parameters
[in]familyThe element family
[in]cellThe reference cell type that the element is defined on
[in]degreeThe degree of the element
[in]dvariantThe variant of DPC to use
Returns
A finite element

◆ create_element() [4/8]

basix::FiniteElement basix::create_element ( element::family  family,
cell::type  cell,
int  degree,
element::dpc_variant  dvariant,
bool  discontinuous 
)

Create an element using a given DPC variant

Parameters
[in]familyThe element family
[in]cellThe reference cell type that the element is defined on
[in]degreeThe degree of the element
[in]dvariantThe variant of DPC to use
[in]discontinuousIndicates whether the element is discontinuous between cells points of the element. The discontinuous element will have the same DOFs, but they will all be associated with the interior of the cell.
Returns
A finite element

◆ create_element() [5/8]

basix::FiniteElement basix::create_element ( element::family  family,
cell::type  cell,
int  degree,
element::lagrange_variant  lvariant 
)

Create a continuous element using a given Lagrange variant

Parameters
[in]familyThe element family
[in]cellThe reference cell type that the element is defined on
[in]degreeThe degree of the element
[in]lvariantThe variant of Lagrange to use
Returns
A finite element

◆ create_element() [6/8]

basix::FiniteElement basix::create_element ( element::family  family,
cell::type  cell,
int  degree,
element::lagrange_variant  lvariant,
bool  discontinuous 
)

Create an element using a given Lagrange variant

Parameters
[in]familyThe element family
[in]cellThe reference cell type that the element is defined on
[in]degreeThe degree of the element
[in]lvariantThe variant of Lagrange to use
[in]discontinuousIndicates whether the element is discontinuous between cells points of the element. The discontinuous element will have the same DOFs, but they will all be associated with the interior of the cell.
Returns
A finite element

◆ create_element() [7/8]

basix::FiniteElement basix::create_element ( element::family  family,
cell::type  cell,
int  degree,
element::lagrange_variant  lvariant,
element::dpc_variant  dvariant 
)

Create a continuous element using a given Lagrange variant and a given DPC variant

Parameters
[in]familyThe element family
[in]cellThe reference cell type that the element is defined on
[in]degreeThe degree of the element
[in]lvariantThe variant of Lagrange to use
[in]dvariantThe variant of DPC to use
Returns
A finite element

◆ create_element() [8/8]

basix::FiniteElement basix::create_element ( element::family  family,
cell::type  cell,
int  degree,
element::lagrange_variant  lvariant,
element::dpc_variant  dvariant,
bool  discontinuous 
)

Create an element using a given Lagrange variant and a given DPC variant

Parameters
[in]familyThe element family
[in]cellThe reference cell type that the element is defined on
[in]degreeThe degree of the element
[in]lvariantThe variant of Lagrange to use
[in]dvariantThe variant of DPC to use
[in]discontinuousIndicates whether the element is discontinuous between cells points of the element. The discontinuous element will have the same DOFs, but they will all be associated with the interior of the cell.
Returns
A finite element

◆ version()

std::string basix::version ( )

Return the Basix version number

Returns
version string