Finite Element Operator Gallery
The following PDEs are available in the operator gallery.
Scalar Mass, Diffusion, Advection, and SUPG Advection Operators
LFAToolkit.GalleryOperator
— FunctionGalleryOperator(
name,
numbernodes1d,
numberquadraturepoints1d,
mesh;
collocatedquadrature = false,
mapping = nothing,
parameters = nothing,
)
Finite element operator from a gallery of options
Arguments:
name::String
: string containing name of operatornumbernodes1d::Int
: polynomial order of TensorH1LagrangeBasisnumberquadraturepoints1d::Int
: number of quadrature points in one dimension for basismesh::Mesh
: mesh for operator
Keyword Arguments:
collocatedquadrature::Bool = false
: Gauss-Legendre or Gauss-Legendre-Lobatto quadrature pointsmappingUnion{Tuple{Function,Function},Nothing} = nothing
: quadrature point mapping - sausage, Kosloff-Talezer, Hale-Trefethen strip, or no transformationparametersUnion{NamedTuple,Nothing} = nothing
: named tuple of model parameters
Returns:
- finite element operator object
Mass matrix example:
# setup
mesh = Mesh2D(1.0, 1.0);
mass = GalleryOperator("mass", 4, 4, mesh);
# verify
println(mass)
# output
finite element operator:
2d mesh:
dx: 1.0
dy: 1.0
2 inputs:
operator field:
tensor product basis:
numbernodes1d: 4
numberquadraturepoints1d: 4
numbercomponents: 1
dimension: 2
evaluation mode:
interpolation
operator field:
tensor product basis:
numbernodes1d: 4
numberquadraturepoints1d: 4
numbercomponents: 1
dimension: 2
evaluation mode:
quadratureweights
1 output:
operator field:
tensor product basis:
numbernodes1d: 4
numberquadraturepoints1d: 4
numbercomponents: 1
dimension: 2
evaluation mode:
interpolation
Diffusion operator example:
# setup
mesh = Mesh2D(1.0, 1.0);
diffusion = GalleryOperator("diffusion", 4, 4, mesh);
# verify
println(diffusion)
# output
finite element operator:
2d mesh:
dx: 1.0
dy: 1.0
2 inputs:
operator field:
tensor product basis:
numbernodes1d: 4
numberquadraturepoints1d: 4
numbercomponents: 1
dimension: 2
evaluation mode:
gradient
operator field:
tensor product basis:
numbernodes1d: 4
numberquadraturepoints1d: 4
numbercomponents: 1
dimension: 2
evaluation mode:
quadratureweights
1 output:
operator field:
tensor product basis:
numbernodes1d: 4
numberquadraturepoints1d: 4
numbercomponents: 1
dimension: 2
evaluation mode:
gradient
Advection operator example:
# setup
mesh = Mesh2D(1.0, 1.0);
advection = GalleryOperator("advection", 4, 4, mesh);
# verify
println(advection)
# output
finite element operator:
2d mesh:
dx: 1.0
dy: 1.0
2 inputs:
operator field:
tensor product basis:
numbernodes1d: 4
numberquadraturepoints1d: 4
numbercomponents: 1
dimension: 2
evaluation mode:
interpolation
operator field:
tensor product basis:
numbernodes1d: 4
numberquadraturepoints1d: 4
numbercomponents: 1
dimension: 2
evaluation mode:
quadratureweights
1 output:
operator field:
tensor product basis:
numbernodes1d: 4
numberquadraturepoints1d: 4
numbercomponents: 1
dimension: 2
evaluation mode:
gradient
SUPG mass matrix example:
# setup
mesh = Mesh2D(1.0, 1.0);
parameters = (wind = [1.0, 1.0], τ = 1.0);
supgmass = GalleryOperator("supg mass", 4, 4, mesh, parameters = parameters);
# verify
println(supgmass)
# output
finite element operator:
2d mesh:
dx: 1.0
dy: 1.0
2 inputs:
operator field:
tensor product basis:
numbernodes1d: 4
numberquadraturepoints1d: 4
numbercomponents: 1
dimension: 2
evaluation mode:
interpolation
operator field:
tensor product basis:
numbernodes1d: 4
numberquadraturepoints1d: 4
numbercomponents: 1
dimension: 2
evaluation mode:
quadratureweights
1 output:
operator field:
tensor product basis:
numbernodes1d: 4
numberquadraturepoints1d: 4
numbercomponents: 1
dimension: 2
evaluation modes:
interpolation
gradient
SUPG advection operator example:
# setup
mesh = Mesh2D(1.0, 1.0);
parameters = nothing;
supgadvection = GalleryOperator("supg advection", 4, 4, mesh, parameters = parameters);
# verify
println(supgadvection)
# output
finite element operator:
2d mesh:
dx: 1.0
dy: 1.0
2 inputs:
operator field:
tensor product basis:
numbernodes1d: 4
numberquadraturepoints1d: 4
numbercomponents: 1
dimension: 2
evaluation modes:
interpolation
gradient
operator field:
tensor product basis:
numbernodes1d: 4
numberquadraturepoints1d: 4
numbercomponents: 1
dimension: 2
evaluation mode:
quadratureweights
1 output:
operator field:
tensor product basis:
numbernodes1d: 4
numberquadraturepoints1d: 4
numbercomponents: 1
dimension: 2
evaluation mode:
gradient
Vector Mass and Diffusion Operators
LFAToolkit.GalleryVectorOperator
— FunctionGalleryVectorOperator(name, numbernodes1d, numberquadraturepoints1d, numberelements1d, mesh)
Finite element operator from a gallery of options
Arguments:
name::String
: string containing name of operatornumbernodes1d::Int
: polynomial order of TensorH1LagrangeBasisnumberquadraturepoints1d::Int
: number of quadrature points in one dimension for basisnumbercomponents::Int
: number of componentsmesh::Mesh
: mesh for operator
Returns:
- finite element operator object
Mass matrix example:
# setup
mesh = Mesh2D(1.0, 1.0);
mass = GalleryVectorOperator("mass", 4, 4, 3, mesh);
# verify
println(mass)
# output
finite element operator:
2d mesh:
dx: 1.0
dy: 1.0
2 inputs:
operator field:
tensor product basis:
numbernodes1d: 4
numberquadraturepoints1d: 4
numbercomponents: 3
dimension: 2
evaluation mode:
interpolation
operator field:
tensor product basis:
numbernodes1d: 4
numberquadraturepoints1d: 4
numbercomponents: 3
dimension: 2
evaluation mode:
quadratureweights
1 output:
operator field:
tensor product basis:
numbernodes1d: 4
numberquadraturepoints1d: 4
numbercomponents: 3
dimension: 2
evaluation mode:
interpolation
Diffusion operator example:
# setup
mesh = Mesh2D(1.0, 1.0);
diffusion = GalleryVectorOperator("diffusion", 4, 4, 3, mesh);
# verify
println(diffusion)
# output
finite element operator:
2d mesh:
dx: 1.0
dy: 1.0
2 inputs:
operator field:
tensor product basis:
numbernodes1d: 4
numberquadraturepoints1d: 4
numbercomponents: 3
dimension: 2
evaluation mode:
gradient
operator field:
tensor product basis:
numbernodes1d: 4
numberquadraturepoints1d: 4
numbercomponents: 3
dimension: 2
evaluation mode:
quadratureweights
1 output:
operator field:
tensor product basis:
numbernodes1d: 4
numberquadraturepoints1d: 4
numbercomponents: 3
dimension: 2
evaluation mode:
gradient
Scalar Macro-Element Mass and Diffusion Operators
LFAToolkit.GalleryMacroElementOperator
— FunctionGalleryMacroElementOperator(
name,
numbernodes1d,
numberquadraturepoints1d,
numberelements1d,
mesh;
mapping = nothing,
parameters = nothing,
)
Finite element operator from a gallery of options
Arguments:
name::String
: string containing name of operatornumbernodes1d::Int
: polynomial order of TensorH1LagrangeBasisnumberquadraturepoints1d::Int
: number of quadrature points in one dimension for basisnumberelements1d::Int
: number of elements in macro-elementmesh::Mesh
: mesh for operator
Keyword Arguments:
mapping::Union{Tuple{Function,Function},Nothing} = nothing
: quadrature point mapping - sausage, Kosloff-Talezer, Hale-Trefethen strip, or no transformationparameters::Union{NamedTuple,Nothing}
= nothing: named tuple of model parameters
Returns:
- finite element operator object
Mass matrix example:
# setup
mesh = Mesh2D(1.0, 1.0);
mass = GalleryMacroElementOperator("mass", 4, 4, 2, mesh);
# verify
println(mass)
# output
finite element operator:
2d mesh:
dx: 1.0
dy: 1.0
2 inputs:
operator field:
macro-element tensor product basis:
numbernodes1d: 7
numberquadraturepoints1d: 8
numbercomponents: 1
numberelements1d: 2
dimension: 2
evaluation mode:
interpolation
operator field:
macro-element tensor product basis:
numbernodes1d: 7
numberquadraturepoints1d: 8
numbercomponents: 1
numberelements1d: 2
dimension: 2
evaluation mode:
quadratureweights
1 output:
operator field:
macro-element tensor product basis:
numbernodes1d: 7
numberquadraturepoints1d: 8
numbercomponents: 1
numberelements1d: 2
dimension: 2
evaluation mode:
interpolation
Diffusion operator example:
# setup
mesh = Mesh2D(1.0, 1.0);
diffusion = GalleryMacroElementOperator("diffusion", 4, 4, 2, mesh);
# verify
println(diffusion)
# output
finite element operator:
2d mesh:
dx: 1.0
dy: 1.0
2 inputs:
operator field:
macro-element tensor product basis:
numbernodes1d: 7
numberquadraturepoints1d: 8
numbercomponents: 1
numberelements1d: 2
dimension: 2
evaluation mode:
gradient
operator field:
macro-element tensor product basis:
numbernodes1d: 7
numberquadraturepoints1d: 8
numbercomponents: 1
numberelements1d: 2
dimension: 2
evaluation mode:
quadratureweights
1 output:
operator field:
macro-element tensor product basis:
numbernodes1d: 7
numberquadraturepoints1d: 8
numbercomponents: 1
numberelements1d: 2
dimension: 2
evaluation mode:
gradient
Advection operator example:
# setup
mesh = Mesh2D(1.0, 1.0);
advection = GalleryVectorOperator("advection", 4, 4, 1, mesh);
# verify
println(advection)
# output
finite element operator:
2d mesh:
dx: 1.0
dy: 1.0
2 inputs:
operator field:
tensor product basis:
numbernodes1d: 4
numberquadraturepoints1d: 4
numbercomponents: 1
dimension: 2
evaluation mode:
interpolation
operator field:
tensor product basis:
numbernodes1d: 4
numberquadraturepoints1d: 4
numbercomponents: 1
dimension: 2
evaluation mode:
quadratureweights
1 output:
operator field:
tensor product basis:
numbernodes1d: 4
numberquadraturepoints1d: 4
numbercomponents: 1
dimension: 2
evaluation mode:
gradient