Mercurial > repos > public > sbplib_julia
comparison 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 |
comparison
equal
deleted
inserted
replaced
916:fc1f03fc8d65 | 917:eb054537fc63 |
---|---|
29 | 29 |
30 function SecondDerivativeVariable(grid::EquidistantGrid{1}, coeff::AbstractVector, inner_stencil, closure_stencils) | 30 function SecondDerivativeVariable(grid::EquidistantGrid{1}, coeff::AbstractVector, inner_stencil, closure_stencils) |
31 return SecondDerivativeVariable(grid, coeff, inner_stencil, closure_stencils, 1) | 31 return SecondDerivativeVariable(grid, coeff, inner_stencil, closure_stencils, 1) |
32 end | 32 end |
33 | 33 |
34 @doc raw""" | |
35 SecondDerivativeVariable(grid::EquidistantGrid, coeff::AbstractArray, stencil_set, dir) | |
36 | |
37 Create a `TensorMapping` for the second derivative with a variable coefficient | |
38 `coeff` on `grid` from the stencils in `stencil_set`. The direction is | |
39 determined by `dir`. | |
40 | |
41 `coeff` is a grid function on `grid`. | |
42 | |
43 # Example | |
44 With | |
45 ``` | |
46 D = SecondDerivativeVariable(g, c, stencil_set, 2) | |
47 ``` | |
48 then `D*u` approximates | |
49 ```math | |
50 \frac{\partial}{\partial y} c(x,y) \frac{\partial u}{\partial y}, | |
51 ``` | |
52 on ``(0,1)тип(0,1)`` represented by `g`. | |
53 """ | |
34 function SecondDerivativeVariable(grid::EquidistantGrid, coeff::AbstractArray, stencil_set, dir) | 54 function SecondDerivativeVariable(grid::EquidistantGrid, coeff::AbstractArray, stencil_set, dir) |
35 inner_stencil = parse_nested_stencil(eltype(coeff), stencil_set["D2variable"]["inner_stencil"]) | 55 inner_stencil = parse_nested_stencil(eltype(coeff), stencil_set["D2variable"]["inner_stencil"]) |
36 closure_stencils = parse_nested_stencil.(eltype(coeff), stencil_set["D2variable"]["closure_stencils"]) | 56 closure_stencils = parse_nested_stencil.(eltype(coeff), stencil_set["D2variable"]["closure_stencils"]) |
37 | 57 |
38 return SecondDerivativeVariable(grid, coeff, inner_stencil, closure_stencils, dir) | 58 return SecondDerivativeVariable(grid, coeff, inner_stencil, closure_stencils, dir) |