comparison src/SbpOperators/volumeops/laplace/laplace.jl @ 769:0158c3fd521c operator_storage_array_of_table

Merge in default
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 15 Jul 2021 00:06:16 +0200
parents 1accc3e051d0
children 3cd582257072 b4acd25943f4
comparison
equal deleted inserted replaced
768:7c87a33963c5 769:0158c3fd521c
1 """ 1 """
2 Laplace(grid::EquidistantGrid{Dim}, inner_stencil, closure_stencils) 2 laplace(grid::EquidistantGrid{Dim}, inner_stencil, closure_stencils)
3 3
4 Creates the Laplace operator operator `Δ` as a `TensorMapping` 4 Creates the Laplace operator operator `Δ` as a `TensorMapping`
5 5
6 `Δ` approximates the Laplace operator ∑d²/xᵢ² , i = 1,...,`Dim` on `grid`, using 6 `Δ` approximates the Laplace operator ∑d²/xᵢ² , i = 1,...,`Dim` on `grid`, using
7 the stencil `inner_stencil` in the interior and a set of stencils `closure_stencils` 7 the stencil `inner_stencil` in the interior and a set of stencils `closure_stencils`
8 for the points in the closure regions. 8 for the points in the closure regions.
9 9
10 On a one-dimensional `grid`, `Δ` is a `SecondDerivative`. On a multi-dimensional `grid`, `Δ` is the sum of 10 On a one-dimensional `grid`, `Δ` is equivalent to `second_derivative`. On a
11 multi-dimensional `SecondDerivative`s where the sum is carried out lazily. 11 multi-dimensional `grid`, `Δ` is the sum of multi-dimensional `second_derivative`s
12 where the sum is carried out lazily.
12 """ 13 """
13 function Laplace(grid::EquidistantGrid{Dim}, inner_stencil, closure_stencils) where Dim 14 function laplace(grid::EquidistantGrid{Dim}, inner_stencil, closure_stencils) where Dim
14 Δ = SecondDerivative(grid, inner_stencil, closure_stencils, 1) 15 Δ = second_derivative(grid, inner_stencil, closure_stencils, 1)
15 for d = 2:Dim 16 for d = 2:Dim
16 Δ += SecondDerivative(grid, inner_stencil, closure_stencils, d) 17 Δ += second_derivative(grid, inner_stencil, closure_stencils, d)
17 end 18 end
18 return Δ 19 return Δ
19 end 20 end
20 export Laplace 21 export laplace