comparison src/SbpOperators/volumeops/laplace/laplace.jl @ 989:7bf3121c6864 feature/stencil_set_type

Add type StencilSet
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Thu, 17 Mar 2022 21:31:20 +0100
parents 1bb28e47990f
children 99d1f5651d0b
comparison
equal deleted inserted replaced
988:83046af6143a 989:7bf3121c6864
1 """ 1 """
2 Laplace{T, Dim, TM} <: TensorMapping{T, Dim, Dim} 2 Laplace{T, Dim, TM} <: TensorMapping{T, Dim, Dim}
3 3
4 Implements the Laplace operator, approximating ∑d²/xᵢ² , i = 1,...,`Dim` as a 4 Implements the Laplace operator, approximating ∑d²/xᵢ² , i = 1,...,`Dim` as a
5 `TensorMapping`. Additionally `Laplace` stores the stencil set (parsed from TOML) 5 `TensorMapping`. Additionally `Laplace` stores the `StencilSet`
6 used to construct the `TensorMapping`. 6 used to construct the `TensorMapping`.
7 """ 7 """
8 struct Laplace{T, Dim, TM<:TensorMapping{T, Dim, Dim}} <: TensorMapping{T, Dim, Dim} 8 struct Laplace{T, Dim, TM<:TensorMapping{T, Dim, Dim}} <: TensorMapping{T, Dim, Dim}
9 D::TM # Difference operator 9 D::TM # Difference operator
10 stencil_set # Stencil set of the operator 10 stencil_set::StencilSet # Stencil set of the operator
11 end 11 end
12 12
13 """ 13 """
14 Laplace(grid::Equidistant, stencil_set) 14 Laplace(grid::Equidistant, stencil_set)
15 15
16 Creates the `Laplace` operator `Δ` on `grid` given a parsed TOML 16 Creates the `Laplace` operator `Δ` on `grid` given a `stencil_set`.
17 `stencil_set`. See also [`laplace`](@ref). 17
18 See also [`laplace`](@ref).
18 """ 19 """
19 function Laplace(grid::EquidistantGrid, stencil_set) 20 function Laplace(grid::EquidistantGrid, stencil_set)
20 inner_stencil = parse_stencil(stencil_set["D2"]["inner_stencil"]) 21 inner_stencil = parse_stencil(stencil_set["D2"]["inner_stencil"])
21 closure_stencils = parse_stencil.(stencil_set["D2"]["closure_stencils"]) 22 closure_stencils = parse_stencil.(stencil_set["D2"]["closure_stencils"])
22 Δ = laplace(grid, inner_stencil,closure_stencils) 23 Δ = laplace(grid, inner_stencil,closure_stencils)