comparison src/SbpOperators/volumeops/laplace/laplace.jl @ 951:66e8faf4bb4b feature/laplace_opset

Reviwe: Some more comments
author Jonatan Werpers <jonatan@werpers.com>
date Mon, 14 Mar 2022 08:25:11 +0100
parents 1484073dfe27
children 1bb28e47990f
comparison
equal deleted inserted replaced
950:97e9a8337a86 951:66e8faf4bb4b
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 stencil set (parsed from TOML)
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# Differential operator 9 D::TM # Difference operator
10 stencil_set # Stencil set of the operator 10 stencil_set # 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)
50 for d = 2:dimension(grid) 50 for d = 2:dimension(grid)
51 Δ += second_derivative(grid, inner_stencil, closure_stencils, d) 51 Δ += second_derivative(grid, inner_stencil, closure_stencils, d)
52 end 52 end
53 return Δ 53 return Δ
54 end 54 end
55 # REVIEW: Do we need this method? Couldn't it just be inlined in the constructor on :19?