comparison src/SbpOperators/volumeops/derivatives/first_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 """
2 first_derivative(g, ..., [direction])
3
4 The first-derivative operator `D1` as a `LazyTensor` on the given grid.
5
6 `D1` approximates the first-derivative d/dξ on `g` along the coordinate
7 dimension specified by `direction`.
8 """
9 function first_derivative end
10
1 """ 11 """
2 first_derivative(g::TensorGrid, stencil_set, direction) 12 first_derivative(g::TensorGrid, stencil_set, direction)
3
4 Creates the first-derivative operator `D1` as a `LazyTensor`
5
6 `D1` approximates the first-derivative d/dξ on `g` along the coordinate dimension specified by
7 `direction`, using the stencil `inner_stencil` in the interior and a set of stencils `closure_stencils`
8 for the points in the closure regions.
9 13
10 See also: [`VolumeOperator`](@ref), [`LazyTensors.inflate`](@ref). 14 See also: [`VolumeOperator`](@ref), [`LazyTensors.inflate`](@ref).
11 """ 15 """
12 function first_derivative(g::TensorGrid, stencil_set, direction) 16 function first_derivative(g::TensorGrid, stencil_set, direction)
13 D₁ = first_derivative(g.grids[direction], stencil_set) 17 D₁ = first_derivative(g.grids[direction], stencil_set)
15 end 19 end
16 20
17 """ 21 """
18 first_derivative(g::EquidistantGrid, stencil_set) 22 first_derivative(g::EquidistantGrid, stencil_set)
19 23
20 Creates a `first_derivative` operator on a `EquidistantGrid` given a `StencilSet`. 24 The first derivative operator on a `EquidistantGrid` given a
25 `StencilSet`. Uses the `D1` stencil in the stencil set.
21 """ 26 """
22 function first_derivative(g::EquidistantGrid, stencil_set::StencilSet) 27 function first_derivative(g::EquidistantGrid, stencil_set::StencilSet)
23 inner_stencil = parse_stencil(stencil_set["D1"]["inner_stencil"]) 28 inner_stencil = parse_stencil(stencil_set["D1"]["inner_stencil"])
24 closure_stencils = parse_stencil.(stencil_set["D1"]["closure_stencils"]) 29 closure_stencils = parse_stencil.(stencil_set["D1"]["closure_stencils"])
25 return first_derivative(g, inner_stencil, closure_stencils); 30 return first_derivative(g, inner_stencil, closure_stencils);
26 end 31 end
27 32
28 """ 33 """
29 first_derivative(g::EquidistantGrid, inner_stencil, closure_stencils) 34 first_derivative(g::EquidistantGrid, inner_stencil, closure_stencils)
30 35
31 Creates a `first_derivative` operator on a `EquidistantGrid` given an `inner_stencil` and a`closure_stencils`. 36 The first derivative operator on a `EquidistantGrid` given an
37 `inner_stencil` and a`closure_stencils`.
32 """ 38 """
33 function first_derivative(g::EquidistantGrid, inner_stencil::Stencil, closure_stencils) 39 function first_derivative(g::EquidistantGrid, inner_stencil::Stencil, closure_stencils)
34 h⁻¹ = inverse_spacing(g) 40 h⁻¹ = inverse_spacing(g)
35 return VolumeOperator(g, scale(inner_stencil,h⁻¹), scale.(closure_stencils,h⁻¹), odd) 41 return VolumeOperator(g, scale(inner_stencil,h⁻¹), scale.(closure_stencils,h⁻¹), odd)
36 end 42 end