Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/volumeops/derivatives/second_derivative.jl @ 1329:e94ddef5e72f refactor/grids
Clean up documentation for changed types in SbpOperatorClean up documentation for changed types in SbpOperatorss
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 02 May 2023 22:09:33 +0200 |
parents | 356ec6a72974 |
children | 08f06bfacd5c |
comparison
equal
deleted
inserted
replaced
1328:f00a205ae347 | 1329:e94ddef5e72f |
---|---|
1 """ | 1 """ |
2 second_derivative(g::EquidistantGrid, inner_stencil, closure_stencils, direction) | 2 second_derivative(g::EquidistantGrid, stencil_set, direction) |
3 | 3 |
4 Creates the second-derivative operator `D2` as a `LazyTensor` | 4 Creates the second-derivative operator `D2` as a `LazyTensor` |
5 | 5 |
6 `D2` approximates the second-derivative d²/dξ² on `g` along the coordinate dimension specified by | 6 `D2` approximates the second-derivative d²/dξ² on `g` along the coordinate |
7 `direction`, using the stencil `inner_stencil` in the interior and a set of stencils `closure_stencils` | 7 dimension specified by `direction`. |
8 for the points in the closure regions. | |
9 | 8 |
10 See also: [`VolumeOperator`](@ref), [`LazyTensors.inflate`](@ref). | 9 See also: [`VolumeOperator`](@ref), [`LazyTensors.inflate`](@ref). |
11 """ | 10 """ |
12 function second_derivative(g::TensorGrid, stencil_set, direction) | 11 function second_derivative(g::TensorGrid, stencil_set, direction) |
13 D₂ = second_derivative(g.grids[direction], stencil_set) | 12 D₂ = second_derivative(g.grids[direction], stencil_set) |
15 end | 14 end |
16 | 15 |
17 """ | 16 """ |
18 second_derivative(g, stencil_set) | 17 second_derivative(g, stencil_set) |
19 | 18 |
20 Creates a `second_derivative` operator on a 1D `g` given a `stencil_set`. | 19 Creates a `second_derivative` operator on a 1D `g` given a `stencil_set`. Uses |
20 the `D2` stencil in the stencil set. | |
21 """ | 21 """ |
22 function second_derivative(g::EquidistantGrid, stencil_set::StencilSet) | 22 function second_derivative(g::EquidistantGrid, stencil_set::StencilSet) |
23 inner_stencil = parse_stencil(stencil_set["D2"]["inner_stencil"]) | 23 inner_stencil = parse_stencil(stencil_set["D2"]["inner_stencil"]) |
24 closure_stencils = parse_stencil.(stencil_set["D2"]["closure_stencils"]) | 24 closure_stencils = parse_stencil.(stencil_set["D2"]["closure_stencils"]) |
25 return second_derivative(g, inner_stencil, closure_stencils) | 25 return second_derivative(g, inner_stencil, closure_stencils) |
26 end | 26 end |
27 | 27 |
28 """ | 28 """ |
29 second_derivative(g, inner_stencil, closure_stencils) | 29 second_derivative(g, inner_stencil, closure_stencils) |
30 | 30 |
31 Creates a `second_derivative` operator on a 1D `g` given `inner_stencil` and `closure_stencils`. | 31 Creates a `second_derivative` operator on a 1D `g` given `inner_stencil` and |
32 `closure_stencils`. | |
32 """ | 33 """ |
33 function second_derivative(g::EquidistantGrid, inner_stencil::Stencil, closure_stencils) | 34 function second_derivative(g::EquidistantGrid, inner_stencil::Stencil, closure_stencils) |
34 h⁻¹ = inverse_spacing(g) | 35 h⁻¹ = inverse_spacing(g) |
35 return VolumeOperator(g, scale(inner_stencil,h⁻¹^2), scale.(closure_stencils,h⁻¹^2), even) | 36 return VolumeOperator(g, scale(inner_stencil,h⁻¹^2), scale.(closure_stencils,h⁻¹^2), even) |
36 end | 37 end |