Finite Element Bases

Interval Element Basis Functions

class FEMpy.FEBasis.IntervalBasis1D(basis_type)[source]

Defines a finite element basis function set on a one-dimensional interval.

Creates a complete set of finite element basis functions for a one-dimensional domain of either linear or quadratic basis types.

Parameters:

basis_type ({101, ‘linear’, 102, ‘quadratic’}) – Finite element basis type. Can either be called as a integer code or a string identifier to indicate the type of basis function we are using.

  • 101, ‘linear’ : 1-dimensional, linear basis.
  • 102, ‘quadratic’ : 1-dimensional, quadratic basis.
basis_type

Basis type standardized to an integer code.

Type:int
Raises:TypeError – If the basis type is not a string identifier or an integer code.
basis_type

Basis type standardized to an integer code.

fe_local_basis(x, vertices, basis_idx, derivative_order)[source]

Defines the finite element local basis functions.

Parameters:
  • x (float or array_like) – A value or array of points to evaluate the function on.
  • vertices (array_like) – Global node coordinates for the mesh element En.
  • basis_idx (int) – Local basis index value.
  • derivative_order (int) – The derivative order to take the basis function to.
Returns:

The local basis function (or derivative of funtion) evaluated at the points in x.

Return type:

float

2D Triangular Element Basis Functions

class FEMpy.FEBasis.TriangularBasis2D(basis_type)[source]

Defines a finite element basis function set on a two-dimensional domian with triangular elements.

Creates a complete set of finite element basis functions for a two-dimensional domain with triangular elements of either linear or quadratic basis types.

Parameters:
  • basis_type ({201, ‘linear’, ‘linear2D_tri’, 202, ‘quadratic’, ‘quadratic2D_tri’})
  • Finite element basis type. Can either be called as a integer code or a string identifier to indicate the
  • type of basis function we are using.
  • - 201, ‘linear’, ‘linear2D_tri (1-dimensional, linear basis on triangular elements.)
  • - 202, ‘quadratic’, ‘quadratic2D_tri (1-dimensional, quadratic basis on triangular elements.)
basis_type

Basis type standardized to an integer code.

Type:int
Raises:TypeError – If the basis type is not a string identifier or an integer code.
fe_local_basis(coords, vertices, basis_idx, derivative_order)[source]

Defines the finite element local basis functions.

Parameters:
  • coords (array_like) – The x and y coordinate values to evaluate the function on. e.g., (`x`, `y`).
  • vertices (array_like) – Global node coordinates for all vertices of triangular mesh nodes on the mesh element En.
  • basis_idx (int) – Local basis index value.
  • derivative_order (tuple of int) – The derivative orders to take the basis function to. Should be specified as a tuple with the orders corresponding to the coordinate axes in the basis functions. e.g., (`x_order`, `y_order`).
Returns:

The local basis function (or derivative of function) evaluated at the points in coords.

Return type:

float