Finite Element Basis

The finite element basis objects represent the discretization of the problem.

There are convenience constructors for H1 tensor product bases on uniformly spaced, Gauss-Lobatto, or Gauss-Legendre points with Gauss-Lobatto or Gauss-Legendre quadrature. There are also nonpolynomial bases available derived from conformal maps such as sausage_transformation, kosloff_talezer_transformation, and hale_trefethen_strip_transformation. Users can create additional finite element bases if the prerequisite information is provided.

Base Classes

These are the bases classes for finite element bases. The constructors for these base classes can be used to create user defined finite elements.

LFAToolkit.TensorBasisType
TensorBasis(
    numbernodes1d,
    numberquadraturepoints1d,
    numbercomponents,
    dimension,
    nodes1d,
    quadraturepoints1d,
    quadratureweights1d,
    interpolation1d,
    gradient1d;
    numberelements1d = 1,
)

Tensor product basis

Arguments:

  • numbernodes1d: number of nodes in 1 dimension
  • numberquadraturepoints1d: number of quadrature points in 1 dimension
  • numbercomponents: number of components
  • dimension: dimension of the basis
  • nodes1d: coordinates of the nodes in 1 dimension
  • quadraturepoints1d: coordinates of the quadrature points in 1 dimension
  • quadratureweights1d: quadrature weights in 1 dimension
  • interpolation1d: interpolation matrix from nodes to quadrature points in 1 dimension
  • gradient1d: gradient matrix from nodes to quadrature points in 1 dimension

Keyword Arguments:

  • numberelements1d = 1: number of subelements, for macroelement bases

Returns:

  • tensor product basis object
source
LFAToolkit.NonTensorBasisType
NonTensorBasis(
    numbernodes,
    numberquadraturepoints,
    numbercomponents,
    dimension,
    nodes,
    quadraturepoints,
    quadratureweights,
    interpolation,
    gradient;
    numberelements = 1,
)

Non-tensor basis

Arguments:

  • numbernodes: number of nodes
  • numberquadraturepoints: number of quadrature points
  • numbercomponents: number of components
  • dimension: dimension of the basis
  • nodes: coordinates of the nodes
  • quadraturepoints: coordinates of the quadrature points
  • quadratureweights: quadrature weights
  • interpolation: interpolation matrix from nodes to quadrature points
  • gradient: gradient matrix from nodes to quadrature points

Keyword Arguments:

  • numberelements = 1: number of subelements, for macroelement bases

Returns:

  • non-tensor product basis object
source

Singe Element Bases

These bases represent common tensor product finite element bases used for continuous Galerkin methods.

LFAToolkit.TensorH1LagrangeBasisFunction
TensorH1LagrangeBasis(
    numbernodes1d,
    numberquadraturepoints1d,
    numbercomponents,
    dimension;
    collocatedquadrature = false,
    mapping = nothing,
)

Tensor product basis on Gauss-Legendre-Lobatto points with Gauss-Legendre (default) or Gauss-Legendre-Lobatto quadrature points

Arguments:

  • numbernodes1d::Int: number of Gauss-Legendre-Lobatto nodes in 1 dimension
  • numberquadraturepoints1d::Int: number of quadrature points in 1 dimension
  • numbercomponents::Int: number of components
  • dimension::Int: dimension of basis

Keyword Arguments:

  • collocatedquadrature::Bool = false: Gauss-Legendre (false) or Gauss-Legendre-Lobatto (true) quadrature points
  • mapping::Union{Tuple{Function,Function},Nothing} = nothing: quadrature point mapping - sausage, Kosloff-Talezer, Hale-Trefethen strip, or no transformation

Returns:

  • H1 Lagrange tensor product basis object

Example:

# generate transformed basis from conformal maps with Gauss-Legendre quadrature points
mapping = hale_trefethen_strip_transformation(1.4);
basis = TensorH1LagrangeBasis(4, 4, 3, 2, collocatedquadrature = true, mapping = mapping);

# verify
println(basis)

# output

tensor product basis:
    numbernodes1d: 4
    numberquadraturepoints1d: 4
    numbercomponents: 3
    dimension: 2
source
LFAToolkit.TensorH1UniformBasisFunction
TensorH1UniformBasis(numbernodes1d, numberquadraturepoints1d, numbercomponents, dimension)

Tensor product basis on uniformly spaced points with Gauss-Legendre quadrature points

Arguments:

  • numbernodes1d::Int: number of uniformly spaced nodes in 1 dimension
  • numberquadraturepoints1d::Int: number of Gauss-Legendre quadrature points in 1 dimension
  • numbercomponents::Int: number of components
  • dimension::Int: dimension of basis

Returns:

  • H1 Lagrange tensor product basis on uniformly spaced nodes object

Example:

# generate H1 Lagrange tensor product basis on uniformly spaced nodes
basis = TensorH1UniformBasis(4, 3, 2, 1);

# verify
println(basis)

# output

tensor product basis:
    numbernodes1d: 4
    numberquadraturepoints1d: 3
    numbercomponents: 2
    dimension: 1
source

Macro-Element Bases

These bases represent a macro-element consisting of multiple overlapping micro elements, where the micro elements are created as above.

LFAToolkit.TensorH1LagrangeMacroBasisFunction
TensorH1LagrangeMacroBasis(
    numbernodes1d,
    numberquadraturepoints1d,
    numbercomponents,
    dimension,
    numberelements1;
    collocatedquadrature = false,
    mapping = nothing,
)

Tensor product macro-element basis on Gauss-Legendre-Lobatto points with Gauss-Legendre (default) or Gauss-Legendre-Lobatto quadrature points

Arguments:

  • numbernodes1d::Int: number of Gauss-Legendre-Lobatto nodes in 1 dimension
  • numberquadraturepoints1d::Int: number of quadrature points in 1 dimension
  • numbercomponents::Int: number of components
  • dimension::Int: dimension of basis
  • numberelements1d::Int: number of elements in macro-element

Keyword Arguments:

  • collocatedquadrature::Bool = false: Gauss-Legendre (false) or Gauss-Legendre-Lobatto (true) quadrature points
  • mapping::Union{Tuple{Function,Function},Nothing} = nothing: quadrature point mapping - sausage, Kosloff-Talezer, Hale-Trefethen strip, or no transformation

Returns:

  • H1 Lagrange tensor product macro-element basis object

Example:

# generate H1 Lagrange tensor macro-element product basis
basis = TensorH1LagrangeMacroBasis(4, 4, 1, 2, 2);

# generate basis with Gauss-Legendre quadrature points
basis = TensorH1LagrangeMacroBasis(4, 4, 1, 2, 2; collocatedquadrature = true);

# verify
println(basis)

# output

macro-element tensor product basis:
    numbernodes1d: 7
    numberquadraturepoints1d: 8
    numbercomponents: 1
    numberelements1d: 2
    dimension: 2
source
LFAToolkit.TensorH1UniformMacroBasisFunction
TensorH1UniformMacroBasis(
    numbernodes1d,
    numberquadraturepoints1d,
    numbercomponents,
    dimension,
    numberelements1d,
)

Tensor product macro-element basis on uniformly points with Gauss-Legendre quadrature

Arguments:

  • numbernodes1d::Int: number of uniformly spaced nodes in 1 dimension
  • numberquadraturepoints1d::Int: number of Gauss-Legendre quadrature points in 1 dimension
  • numbercomponents::Int: number of components
  • dimension::Int: dimension of basis
  • numberelements1d::Int: number of elements in macro-element

Returns:

  • H1 Lagrange tensor product macro-element basis on uniformly space nodes object

Example:

# generate H1 Lagrange tensor product macro-element basis on uniformly spaced nodes
basis = TensorH1UniformMacroBasis(4, 3, 1, 2, 2);

# verify
println(basis)

# output

macro-element tensor product basis:
    numbernodes1d: 7
    numberquadraturepoints1d: 6
    numbercomponents: 1
    numberelements1d: 2
    dimension: 2
source

P Prolongation Basis

This basis provides prolongation from a single element to a single element of higher order.

LFAToolkit.TensorH1LagrangePProlongationBasisFunction
TensorH1LagrangePProlongationBasis(
    numbercoarsenodes1d,
    numberfinenodes1d,
    numbercomponents,
    dimension,
)

Tensor product p-prolongation basis on Gauss-Legendre-Lobatto points

Arguments:

  • numbercoarsenodes1d::Int: number of coarse grid Gauss-Legendre-Lobatto nodes in 1 dimension
  • numberfinenodes1d::Int: number of fine grid Gauss-Legendre-Lobatto nodes in 1 dimension
  • numbercomponents::Int: number of components
  • dimension::Int: dimension of basis

Returns:

  • H1 Lagrange tensor product p-prolongation basis object

Example:

# generate H1 Lagrange tensor product p-prolongation basis
basisctof = TensorH1LagrangePProlongationBasis(2, 3, 1, 2);

# verify
println(basisctof)

# output

tensor product basis:
    numbernodes1d: 2
    numberquadraturepoints1d: 3
    numbercomponents: 1
    dimension: 2
source

H Prolongation Bases

These bases provide prolongation from a single element to a macro-element of the same order or a macro-element to a macro-element with a larger number of elements.

LFAToolkit.TensorH1LagrangeHProlongationBasisFunction
TensorH1LagrangeHProlongationBasis(
    numbernodes1d,
    numbercomponents,
    dimension,
    numberfineelements1d,
)

Tensor product h-prolongation basis on Gauss-Legendre-Lobatto points

Arguments:

  • numbernodes1d::Int: number of Gauss-Legendre-Lobatto nodes in 1 dimension per element
  • numbercomponents::Int: number of components
  • dimension::Int: dimension of basis
  • numberfineelements1d::Int: number of fine grid elements

Returns:

  • H1 Lagrange tensor product h-prolongation basis object

Example:

# generate H1 Lagrange tensor product h-prolongation basis
basis = TensorH1LagrangeHProlongationBasis(4, 3, 2, 2);

# verify
println(basis)

# output

tensor product basis:
    numbernodes1d: 4
    numberquadraturepoints1d: 7
    numbercomponents: 3
    dimension: 2
source
LFAToolkit.TensorH1UniformHProlongationBasisFunction
TensorH1UniformHProlongationBasis(
    numbernodes1d,
    numbercomponents,
    dimension,
    numberfineelements1d,
)

Tensor product h-prolongation basis on uniformly spaced points

Arguments:

  • numbernodes1d::Int: number of uniformly spaced nodes per element
  • numbercomponents::Int: number of components
  • dimension::Int: dimension of basis
  • numberfineelements1d::Int: number of fine grid elements

Returns:

  • H1 Lagrange tensor product h-prolongation basis on uniformly spaced nodes object

Example:

# generate H1 Lagrange tensor product h-prolongation basis on uniformly spaced nodes
basis = TensorH1UniformHProlongationBasis(4, 3, 2, 2);

# verify
println(basis)

# output

tensor product basis:
    numbernodes1d: 4
    numberquadraturepoints1d: 7
    numbercomponents: 3
    dimension: 2
source
LFAToolkit.TensorH1LagrangeHProlongationMacroBasisFunction
TensorH1LagrangeHProlongationMacroBasis(
    numbernodes1d,
    numbercomponents,
    dimension,
    numbercoarseelements1d,
    numberfineelements1d,
)

Tensor product macro-element h-prolongation basis on Gauss-Legendre-Lobatto points

Arguments:

  • numbernodes1d::Int: number of Gauss-Legendre-Lobatto nodes in 1 dimension per element
  • numbercomponents::Int: number of components
  • dimension::Int: dimension of basis
  • numbercoarseelements1d::Int: number of coarse grid elements in macro-element
  • numberfineelements1d::Int: number of fine grid elements in macro-element

Returns:

  • H1 Lagrange tensor product h-prolongation macro-element basis object

Example:

# generate H1 Lagrange tensor product h-prolongation macro-element basis
basis = TensorH1LagrangeHProlongationMacroBasis(4, 1, 2, 2, 4);

# verify
println(basis)

# output

macro-element tensor product basis:
    numbernodes1d: 7
    numberquadraturepoints1d: 13
    numbercomponents: 1
    numberelements1d: 2
    dimension: 2
source
LFAToolkit.TensorH1UniformHProlongationMacroBasisFunction
TensorH1UniformHProlongationMacroBasis(
    numbernodes1d,
    numbercomponents,
    dimension,
    numbercoarseelements1d,
    numberfineelements1d,
)

Tensor product macro-element h-prolongation basis on uniformly spaced points

Arguments:

  • numbernodes1d::Int: number of uniformly spaced nodes per element
  • numbercomponents::Int: number of components
  • dimension::Int: dimension of basis
  • numbercoarseelements1d::Int: number of coarse grid elements in macro-element
  • numberfineelements1d::Int: number of fine grid elements in macro-element

Returns:

  • H1 Lagrange tensor product h-prolongation macro-element basis on uniformly spaced nodes object

Example:

# generate H1 Lagrange tensor product h-prolongation macro-element basis on uniformly spaced nodes
basis = TensorH1UniformHProlongationMacroBasis(4, 1, 2, 2, 4);

# verify
println(basis)

# output

macro-element tensor product basis:
    numbernodes1d: 7
    numberquadraturepoints1d: 13
    numbercomponents: 1
    numberelements1d: 2
    dimension: 2
source