basix.ufl_wrapper

Functions to directly wrap Basix elements in UFL.

Functions

create_element(family, cell, degree[, ...])

Create a UFL element using Basix.

create_tensor_element(family, cell, degree)

Create a UFL tensor element using Basix.

create_vector_element(family, cell, degree)

Create a UFL vector element using Basix.

Classes

BasixElement(element)

A wrapper allowing Basix elements to be used with UFL.

class basix.ufl_wrapper.BasixElement(element: basix._basixcpp.FiniteElement)

Bases: ufl.finiteelement.finiteelementbase.FiniteElementBase

A wrapper allowing Basix elements to be used with UFL.

Create a basix element.

mapping() str

Return the map type.

basix.ufl_wrapper.create_element(family: typing.Union[basix._basixcpp.ElementFamily, str], cell: typing.Union[basix._basixcpp.CellType, str], degree: int, lagrange_variant: basix._basixcpp.LagrangeVariant = <LagrangeVariant.unset: -1>, dpc_variant: basix._basixcpp.DPCVariant = <DPCVariant.unset: -1>, discontinuous=False) basix.ufl_wrapper.BasixElement

Create a UFL element using Basix.

Parameters
  • family – The element’s family as a Basix enum or a string.

  • cell – The cell type as a Basix enum or a string.

  • degree – The degree of the finite element.

  • lagrange_variant – The variant of Lagrange to be used.

  • dpc_variant – The variant of DPC to be used.

  • discontinuous – If set to True, the discontinuous version of this element will be created.

basix.ufl_wrapper.create_tensor_element(family: typing.Union[basix._basixcpp.ElementFamily, str], cell: typing.Union[basix._basixcpp.CellType, str], degree: int, lagrange_variant: basix._basixcpp.LagrangeVariant = <LagrangeVariant.unset: -1>, dpc_variant: basix._basixcpp.DPCVariant = <DPCVariant.unset: -1>, discontinuous=False) ufl.finiteelement.mixedelement.TensorElement

Create a UFL tensor element using Basix.

A tensor element is an element which uses multiple copies of a scalar element to represent a tensor-valued function.

Parameters
  • family – The element’s family as a Basix enum or a string.

  • cell – The cell type as a Basix enum or a string.

  • degree – The degree of the finite element.

  • lagrange_variant – The variant of Lagrange to be used.

  • dpc_variant – The variant of DPC to be used.

  • discontinuous – If set to True, the discontinuous version of this element will be created.

basix.ufl_wrapper.create_vector_element(family: typing.Union[basix._basixcpp.ElementFamily, str], cell: typing.Union[basix._basixcpp.CellType, str], degree: int, lagrange_variant: basix._basixcpp.LagrangeVariant = <LagrangeVariant.unset: -1>, dpc_variant: basix._basixcpp.DPCVariant = <DPCVariant.unset: -1>, discontinuous=False) ufl.finiteelement.mixedelement.VectorElement

Create a UFL vector element using Basix.

A vector element is an element which uses multiple copies of a scalar element to represent a vector-valued function.

Parameters
  • family – The element’s family as a Basix enum or a string.

  • cell – The cell type as a Basix enum or a string.

  • degree – The degree of the finite element.

  • lagrange_variant – The variant of Lagrange to be used.

  • dpc_variant – The variant of DPC to be used.

  • discontinuous – If set to True, the discontinuous version of this element will be created.