symfem.elements.bernstein

Bernstein elements on simplices.

This element’s definition appears in https://doi.org/10.1007/s00211-010-0327-2 (Kirby, 2011) and https://doi.org/10.1137/11082539X (Ainsworth, Andriamaro, Davydov, 2011)

Classes

BernsteinFunctional

Functional for a Bernstein element.

Bernstein

Bernstein finite element.

Functions

single_choose(→ sympy.core.expr.Expr)

Calculate choose function of a set of powers.

choose(→ sympy.core.expr.Expr)

Calculate choose function of a set of powers.

bernstein_polynomials(→ list[sympy.core.expr.Expr])

Return a list of Bernstein polynomials.

Module Contents

symfem.elements.bernstein.single_choose(n: int, k: int) sympy.core.expr.Expr

Calculate choose function of a set of powers.

Parameters:
  • n – Number of items

  • k – Number to select

Returns:

Number of ways to pick k items from n items (ie n choose k)

symfem.elements.bernstein.choose(n: int, powers: list[int]) sympy.core.expr.Expr

Calculate choose function of a set of powers.

Parameters:
  • n – Number of items

  • k – Numbers to select

Returns:

A multichoose function

symfem.elements.bernstein.bernstein_polynomials(n: int, d: int, vars: symfem.symbols.AxisVariablesNotSingle = x) list[sympy.core.expr.Expr]

Return a list of Bernstein polynomials.

Parameters:
  • n – The polynomial order

  • d – The topological dimension

  • vars – The variables to use

Returns:

Bernstein polynomials

class symfem.elements.bernstein.BernsteinFunctional(reference: symfem.references.Reference, integral_domain: symfem.references.Reference, index: int, degree: int, entity: tuple[int, int])

Bases: symfem.functionals.BaseFunctional

Functional for a Bernstein element.

ref
index
degree
moment
dof_point() symfem.geometry.PointType

Get the location of the DOF in the cell.

Returns:

Location of the DOF

_eval_symbolic(function: symfem.functions.Function) symfem.functions.Function

Apply the functional to a function.

Parameters:

function – The function

Returns:

Evaluation of the functional

get_tex() tuple[str, list[str]]

Get a representation of the functional as TeX, and list of terms involved.

Returns:

TeX representation

discrete(poly_degree: int) symfem.functionals.DiscreteDof

Get points and weights that define this DOF discretely.

Parameters:

poly_degree – The polynomial degree of the element. This may be used to decide which degree quadrature rule to use

Returns:

Points and weights

property nderivs: int

Number of derivatives.

class symfem.elements.bernstein.Bernstein(reference: symfem.references.Reference, order: int)

Bases: symfem.finite_element.CiarletElement

Bernstein finite element.

property lagrange_subdegree: int

Get the Lagrange subdegree of the element.

This is the degree of the highest degree Lagrange space whose polynomial space is a subspace of this element’s polynomial space.

property lagrange_superdegree: int | None

Get the Lagrange superdegree of the element.

This is the degree of the highest degree Lagrange space whose polynomial space is a superspace of this element’s polynomial space.

property polynomial_subdegree: int

Get the polynomial subdegree of the element.

This is the degree of the highest degree complete polynomial space that is a subspace of this element’s polynomial space.

property polynomial_superdegree: int | None

Get the polynomial superdegree of the element.

This is the degree of the highest degree complete polynomial space that is a superspace of this element’s polynomial space.

names = ['Bernstein', 'Bernstein-Bezier']
references = ['interval', 'triangle', 'tetrahedron']
min_order = 0
continuity = 'C0'
value_type = 'scalar'
last_updated = '2023.12'