Mercurial > repos > public > sbplib_julia
view src/SbpOperators/volumeops/laplace/laplace.jl @ 946:469ed954b493 feature/tensormapping_application_promotion
Allow volume_operator, boundary_operator, and constant_interior_scaling_operator to act on arbitrary arrays
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Sat, 12 Mar 2022 22:26:23 +0100 |
parents | b4acd25943f4 |
children | 1784b1c0af3e |
line wrap: on
line source
""" laplace(grid::EquidistantGrid{Dim}, inner_stencil, closure_stencils) Creates the Laplace operator operator `Δ` as a `TensorMapping` `Δ` approximates the Laplace operator ∑d²/xᵢ² , i = 1,...,`Dim` on `grid`, using the stencil `inner_stencil` in the interior and a set of stencils `closure_stencils` for the points in the closure regions. On a one-dimensional `grid`, `Δ` is equivalent to `second_derivative`. On a multi-dimensional `grid`, `Δ` is the sum of multi-dimensional `second_derivative`s where the sum is carried out lazily. """ function laplace(grid::EquidistantGrid, inner_stencil, closure_stencils) Δ = second_derivative(grid, inner_stencil, closure_stencils, 1) for d = 2:dimension(grid) Δ += second_derivative(grid, inner_stencil, closure_stencils, d) end return Δ end export laplace