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.TensorBasis
— TypeTensorBasis(
numbernodes1d,
numberquadraturepoints1d,
numbercomponents,
dimension,
nodes1d,
quadraturepoints1d,
quadratureweights1d,
interpolation1d,
gradient1d;
numberelements1d = 1,
)
Tensor product basis
Arguments:
numbernodes1d
: number of nodes in 1 dimensionnumberquadraturepoints1d
: number of quadrature points in 1 dimensionnumbercomponents
: number of componentsdimension
: dimension of the basisnodes1d
: coordinates of the nodes in 1 dimensionquadraturepoints1d
: coordinates of the quadrature points in 1 dimensionquadratureweights1d
: quadrature weights in 1 dimensioninterpolation1d
: interpolation matrix from nodes to quadrature points in 1 dimensiongradient1d
: 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
LFAToolkit.NonTensorBasis
— TypeNonTensorBasis(
numbernodes,
numberquadraturepoints,
numbercomponents,
dimension,
nodes,
quadraturepoints,
quadratureweights,
interpolation,
gradient;
numberelements = 1,
)
Non-tensor basis
Arguments:
numbernodes
: number of nodesnumberquadraturepoints
: number of quadrature pointsnumbercomponents
: number of componentsdimension
: dimension of the basisnodes
: coordinates of the nodesquadraturepoints
: coordinates of the quadrature pointsquadratureweights
: quadrature weightsinterpolation
: interpolation matrix from nodes to quadrature pointsgradient
: gradient matrix from nodes to quadrature points
Keyword Arguments:
numberelements = 1
: number of subelements, for macroelement bases
Returns:
- non-tensor product basis object
Singe Element Bases
These bases represent common tensor product finite element bases used for continuous Galerkin methods.
LFAToolkit.TensorH1LagrangeBasis
— FunctionTensorH1LagrangeBasis(
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 dimensionnumberquadraturepoints1d::Int
: number of quadrature points in 1 dimensionnumbercomponents::Int
: number of componentsdimension::Int
: dimension of basis
Keyword Arguments:
collocatedquadrature::Bool = false
: Gauss-Legendre (false
) or Gauss-Legendre-Lobatto (true
) quadrature pointsmapping::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
LFAToolkit.TensorH1UniformBasis
— FunctionTensorH1UniformBasis(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 dimensionnumberquadraturepoints1d::Int
: number of Gauss-Legendre quadrature points in 1 dimensionnumbercomponents::Int
: number of componentsdimension::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
Macro-Element Bases
These bases represent a macro-element consisting of multiple overlapping micro elements, where the micro elements are created as above.
LFAToolkit.TensorH1LagrangeMacroBasis
— FunctionTensorH1LagrangeMacroBasis(
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 dimensionnumberquadraturepoints1d::Int
: number of quadrature points in 1 dimensionnumbercomponents::Int
: number of componentsdimension::Int
: dimension of basisnumberelements1d::Int
: number of elements in macro-element
Keyword Arguments:
collocatedquadrature::Bool = false
: Gauss-Legendre (false
) or Gauss-Legendre-Lobatto (true
) quadrature pointsmapping::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
LFAToolkit.TensorH1UniformMacroBasis
— FunctionTensorH1UniformMacroBasis(
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 dimensionnumberquadraturepoints1d::Int
: number of Gauss-Legendre quadrature points in 1 dimensionnumbercomponents::Int
: number of componentsdimension::Int
: dimension of basisnumberelements1d::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
P Prolongation Basis
This basis provides prolongation from a single element to a single element of higher order.
LFAToolkit.TensorH1LagrangePProlongationBasis
— FunctionTensorH1LagrangePProlongationBasis(
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 dimensionnumberfinenodes1d::Int
: number of fine grid Gauss-Legendre-Lobatto nodes in 1 dimensionnumbercomponents::Int
: number of componentsdimension::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
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.TensorH1LagrangeHProlongationBasis
— FunctionTensorH1LagrangeHProlongationBasis(
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 elementnumbercomponents::Int
: number of componentsdimension::Int
: dimension of basisnumberfineelements1d::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
LFAToolkit.TensorH1UniformHProlongationBasis
— FunctionTensorH1UniformHProlongationBasis(
numbernodes1d,
numbercomponents,
dimension,
numberfineelements1d,
)
Tensor product h-prolongation basis on uniformly spaced points
Arguments:
numbernodes1d::Int
: number of uniformly spaced nodes per elementnumbercomponents::Int
: number of componentsdimension::Int
: dimension of basisnumberfineelements1d::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
LFAToolkit.TensorH1LagrangeHProlongationMacroBasis
— FunctionTensorH1LagrangeHProlongationMacroBasis(
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 elementnumbercomponents::Int
: number of componentsdimension::Int
: dimension of basisnumbercoarseelements1d::Int
: number of coarse grid elements in macro-elementnumberfineelements1d::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
LFAToolkit.TensorH1UniformHProlongationMacroBasis
— FunctionTensorH1UniformHProlongationMacroBasis(
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 elementnumbercomponents::Int
: number of componentsdimension::Int
: dimension of basisnumbercoarseelements1d::Int
: number of coarse grid elements in macro-elementnumberfineelements1d::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