Mercurial > repos > public > sbplib_julia
diff src/SbpOperators/volumeops/derivatives/second_derivative_variable.jl @ 917:eb054537fc63 feature/variable_derivatives
More docs
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 18 Feb 2022 07:39:07 +0100 |
parents | fc1f03fc8d65 |
children | ba5f4a0ec879 |
line wrap: on
line diff
--- a/src/SbpOperators/volumeops/derivatives/second_derivative_variable.jl Fri Feb 18 07:19:08 2022 +0100 +++ b/src/SbpOperators/volumeops/derivatives/second_derivative_variable.jl Fri Feb 18 07:39:07 2022 +0100 @@ -31,6 +31,26 @@ return SecondDerivativeVariable(grid, coeff, inner_stencil, closure_stencils, 1) end +@doc raw""" + SecondDerivativeVariable(grid::EquidistantGrid, coeff::AbstractArray, stencil_set, dir) + +Create a `TensorMapping` for the second derivative with a variable coefficient +`coeff` on `grid` from the stencils in `stencil_set`. The direction is +determined by `dir`. + +`coeff` is a grid function on `grid`. + +# Example +With +``` +D = SecondDerivativeVariable(g, c, stencil_set, 2) +``` +then `D*u` approximates +```math +\frac{\partial}{\partial y} c(x,y) \frac{\partial u}{\partial y}, +``` +on ``(0,1)тип(0,1)`` represented by `g`. +""" function SecondDerivativeVariable(grid::EquidistantGrid, coeff::AbstractArray, stencil_set, dir) inner_stencil = parse_nested_stencil(eltype(coeff), stencil_set["D2variable"]["inner_stencil"]) closure_stencils = parse_nested_stencil.(eltype(coeff), stencil_set["D2variable"]["closure_stencils"])