Derivative operators
Below are the first and second derivative summation by parts operators. All stencils are written in 1D and then extended to two dimensions by looping over the required axis.
FaADE.Derivatives
— ModuleDerivatives
Module containing first and second derivative variable coefficient SBP operators.
Derivative operators with structs belong to the abstract type
.
FaADE.Derivatives.DerivativeOperatorType
— TypeAbstract type for derivative operators
First derivative operators
The below operators are for first derivatives
FaADE.Derivatives.D₁
— FunctionFirst derivative SBP operator.
Also available as and internally uses in place operator D₁!
.
FaADE.Derivatives.D₁!
— Function1D and 2D in place first derivative operator.
See also FirstDerivativeBoundary!
and FirstDerivativeInternal!
.
FaADE.Derivatives.D₁!
— MethodD₁!(uₓ::AbstractVector{T},u::AbstractVector{T},n::Integer,Δx::T,order::Integer)
1D D₁!
.
FaADE.Derivatives.D₁!
— MethodD₁!(uₓ::AbstractArray{T},u::AbstractArray{T},nx::Integer,ny::Integer,Δx::T,Δy::T,order::Int,ordery::Int,α::T) where T
2D D₁!
.
FaADE.Derivatives.D₁!
— MethodD₁!(uₓ::AbstractArray{T},u::AbstractArray{T},n::Integer,Δ::T,order::Integer,α::T,dim::Integer) where T
1D implementation for 2D problems for D₁!
.
FaADE.Derivatives.D₁
— MethodD₁(u::AbstractMatrix{T},nx::Integer,ny::Integer,Δx::T,Δy::T;order::Integer=2) where T
2D implementation of D₁
operator.
FaADE.Derivatives.D₁
— MethodD₁(u::AbstractVector{T},Δx::T;order::Integer=2) where T
1D implementation of D₁
operator.
julia> n = 101
julia> x = collect(LinRange(0.0,1.0,n))
julia> u = sin.(x)
julia> Δx = 1/(n-1)
julia> D₁(u,Δx,order=2)
Second Derivative operators
FaADE.Derivatives.D₂
— FunctionSecond derivative variable coefficient SBP operator
FaADE.Derivatives.D₂!
— Function1D and 2D in place second derivative operator.
Internally uses SecondDerivativeInternal!
.
FaADE.Derivatives.D₂!
— MethodD₂!(uₓₓ::AbstractVector{T},u::AbstractVector{T},c::AbstractVector{T},n::Integer,Δx::T,order::Val,α::T) where T
FaADE.Derivatives.D₂
— MethodMatrix version of D₂
.
FaADE.Derivatives.D₂
— MethodVector version of D₂
.
Internals
First derivative internals
FaADE.Derivatives.FirstDerivativeBoundary!
— FunctionFirstDerivativeBoundary!
1D in place function for first derivative on boundary nodes
FaADE.Derivatives.FirstDerivativeBoundary!
— MethodFirstDerivativeBoundary!(uₓ::AT,K::AT,u::AT,Δx::TT,NT::NodeType,DO::Val{O},α::TT) where {TT,AT<:AbstractVector{TT}}
$u_x \leftarrow \alpha u_x + K d_x u$
FaADE.Derivatives.FirstDerivativeBoundary!
— MethodFirstDerivativeBoundary!(uₓ::AT,u::AT,Δx::TT,NT::NodeType,DO::Val{O},α::TT) where {TT,AT<:AbstractVector{TT}}
$u_x \leftarrow \alpha u_x + d_x u$
FaADE.Derivatives.FirstDerivativeInternal
— FunctionFirstDerivativeInternal(u,Δx,order,index,multiplier)
Single node 1D first derivative function. Includes 2nd, 4th and 6th order stencils.
FaADE.Derivatives.FirstDerivativeInternal!
— FunctionFirstDerivativeInternal!(uₓ::AT,u::AT,Δx::T,n::Int,order::Val{O},α::T)
In place first derivative function for internal nodes.
FaADE.Derivatives.FirstDerivativePeriodic
— MethodFirstDerivativePeriodic
Single node 1D first derivative periodic stencil
FaADE.Derivatives.FirstDerivativeTranspose!
— FunctionFirstDerivativeTranspose!
In place 1D first derivative function
TODO: Check sign on internal nodes
FaADE.Derivatives.FirstDerivativeTransposeBoundary!
— FunctionFirstDerivativeTransposeBoundary!(dest,u,Δx,NodeType,::Val{order},multiplier)
In place 1D first derivative stencil for boundary nodes
Second Derivative internals
FaADE.Derivatives.SecondDerivativeBoundary!
— FunctionSecondDerivativeBoundary!
Since boundary stencils for the second derivative are not symmetric, Left and Right nodes are separate functions
FaADE.Derivatives.SecondDerivativeBoundaryPeriodic!
— MethodSecondDerivativeBoundaryPeriodic!(uₓₓ::AT,u::AT,c::AT,Δx::TT,::NodeType{TN},::Val{O},α::TT) where {TT,AT<:AbstractVector{TT},TN}
Second derivative periodic stencil for boundary nodes only.
FaADE.Derivatives.SecondDerivativeInternal!
— FunctionSecondDerivativeInternal!
Single node 1D second derivative function.
See also FirstDerivativeInternal!
for in place multi-node functions
FaADE.Derivatives.SecondDerivativeInternal!
— MethodSecondDerivativeInternal!(uₓₓ::AbstractVector{TT},u::AbstractVector{TT},cx::AbstractVector{TT},Δx::TT,nx::Integer,::Val{2},α::TT)
In place second derivative function for internal nodes.
FaADE.Derivatives.SecondDerivativePeriodic
— FunctionSecondDerivativePeriodic
Pointwise 1D second derivative periodic stencils.
FaADE.Derivatives.SecondDerivativePeriodic!
— MethodSecondDerivativePeriodic!(dest::VT,u::VT,c::VT,Δx::TT,DO::Val,n::Integer,α::TT) where {TT,VT}
In place periodic second derivative stencil.