Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/volumeops/derivatives/second_derivative_variable.jl @ 1372:3f7f826489a1 feature/variable_derivatives
Remove type annotation for coeff
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 26 May 2023 21:45:51 +0200 |
parents | d0e48c2e6aad |
children | 4f3dd84891f6 |
comparison
equal
deleted
inserted
replaced
1371:d0e48c2e6aad | 1372:3f7f826489a1 |
---|---|
7 Approximates the d/dξ c d/dξ on `g` along the coordinate dimension specified | 7 Approximates the d/dξ c d/dξ on `g` along the coordinate dimension specified |
8 by `direction`. | 8 by `direction`. |
9 """ | 9 """ |
10 function second_derivative_variable end | 10 function second_derivative_variable end |
11 | 11 |
12 function second_derivative_variable(g::TensorGrid, coeff::AbstractArray, stencil_set, dir::Int) | 12 function second_derivative_variable(g::TensorGrid, coeff, stencil_set, dir::Int) |
13 inner_stencil = parse_nested_stencil(eltype(coeff), stencil_set["D2variable"]["inner_stencil"]) | 13 inner_stencil = parse_nested_stencil(eltype(coeff), stencil_set["D2variable"]["inner_stencil"]) |
14 closure_stencils = parse_nested_stencil.(eltype(coeff), stencil_set["D2variable"]["closure_stencils"]) | 14 closure_stencils = parse_nested_stencil.(eltype(coeff), stencil_set["D2variable"]["closure_stencils"]) |
15 | 15 |
16 return second_derivative_variable(g, coeff, inner_stencil, closure_stencils, dir) | 16 return second_derivative_variable(g, coeff, inner_stencil, closure_stencils, dir) |
17 end | 17 end |
18 | 18 |
19 function second_derivative_variable(g::EquidistantGrid, coeff::AbstractArray, stencil_set) | 19 function second_derivative_variable(g::EquidistantGrid, coeff, stencil_set) |
20 return second_derivative_variable(TensorGrid(g), coeff, stencil_set, 1) | 20 return second_derivative_variable(TensorGrid(g), coeff, stencil_set, 1) |
21 end | 21 end |
22 | 22 |
23 function second_derivative_variable(g::TensorGrid, coeff::AbstractArray, inner_stencil::NestedStencil, closure_stencils, dir) | 23 function second_derivative_variable(g::TensorGrid, coeff, inner_stencil::NestedStencil, closure_stencils, dir) |
24 check_coefficient(g, coeff) | 24 check_coefficient(g, coeff) |
25 | 25 |
26 Δxᵢ = spacing(g.grids[dir]) | 26 Δxᵢ = spacing(g.grids[dir]) |
27 scaled_inner_stencil = scale(inner_stencil, 1/Δxᵢ^2) | 27 scaled_inner_stencil = scale(inner_stencil, 1/Δxᵢ^2) |
28 scaled_closure_stencils = scale.(Tuple(closure_stencils), 1/Δxᵢ^2) | 28 scaled_closure_stencils = scale.(Tuple(closure_stencils), 1/Δxᵢ^2) |