Mercurial > repos > public > sbplib_julia
changeset 704:a7efedbdede9 feature/laplace_opset
Update docs
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Mon, 15 Feb 2021 17:31:32 +0100 |
parents | 988e9cfcd58d |
children | bf1387f867b8 |
files | src/SbpOperators/volumeops/laplace/laplace.jl |
diffstat | 1 files changed, 20 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/src/SbpOperators/volumeops/laplace/laplace.jl Mon Feb 15 17:20:03 2021 +0100 +++ b/src/SbpOperators/volumeops/laplace/laplace.jl Mon Feb 15 17:31:32 2021 +0100 @@ -1,23 +1,23 @@ """ - Laplace{T,Dim,...}() + Laplace{T, Dim, ...} <: TensorMapping{T,Dim,Dim} Laplace(grid::EquidistantGrid, fn; order) Implements the Laplace operator, approximating ∑d²/xᵢ² , i = 1,...,`Dim` as a -`TensorMapping`. Additionally, `Laplace` stores the quadrature, and boundary +`TensorMapping`. Additionally, `Laplace` stores the inner product and boundary operators relevant for constructing a SBP finite difference scheme as `TensorMapping`s. Laplace(grid::EquidistantGrid, fn; order) creates the Laplace operator on an -equidistant grid, where the operators are read from a TOML. The laplace operator -is created using laplace(grid,...). +equidistant grid, where the operators are read from a TOML. The differential operator +is created using `laplace(grid,...)`. """ -struct Laplace{T, Dim, Rb, TMdiffop<:TensorMapping{T,Dim,Dim}, # Differential operator tensor mapping - TMqop<:TensorMapping{T,Dim,Dim}, # Quadrature operator tensor mapping - TMbop<:TensorMapping{T,Rb,Dim}, # Boundary operator tensor mapping - TMbqop<:TensorMapping{T,Rb,Rb}, # Boundary quadrature tensor mapping +struct Laplace{T, Dim, Rb, TMdiffop<:TensorMapping{T,Dim,Dim}, # Differential operator + TMipop<:TensorMapping{T,Dim,Dim}, # Inner product operator + TMbop<:TensorMapping{T,Rb,Dim}, # Boundary operator + TMbqop<:TensorMapping{T,Rb,Rb}, # Boundary quadrature BID<:BoundaryIdentifier} <: TensorMapping{T,Dim,Dim} D::TMdiffop # Difference operator - H::TMqop # Quadrature (norm) operator - H_inv::TMqop # Inverse quadrature (norm) operator + H::TMipop # Inner product operator + H_inv::TMipop # Inverse inner product operator e::Dict{BID,TMbop} # Boundary restriction operators d::Dict{BID,TMbop} # Normal derivative operators H_boundary::Dict{BID,TMbqop} # Boundary quadrature operators @@ -53,10 +53,10 @@ LazyTensors.domain_size(L::Laplace) = LazyTensors.domain_size(L.D) LazyTensors.apply(L::Laplace, v::AbstractArray, I...) = LazyTensors.apply(L.D,v,I...) -quadrature(L::Laplace) = L.H -export quadrature -inverse_quadrature(L::Laplace) = L.H_inv -export inverse_quadrature +inner_product(L::Laplace) = L.H +export inner_product +inverse_inner_product(L::Laplace) = L.H_inv +export inverse_inner_product boundary_restriction(L::Laplace,bid::BoundaryIdentifier) = L.e[bid] export boundary_restriction normal_derivative(L::Laplace,bid::BoundaryIdentifier) = L.d[bid] @@ -65,21 +65,21 @@ export boundary_quadrature """ - laplace(grid::EquidistantGrid{Dim}, inner_stencil, closure_stencils) + laplace(grid::EquidistantGrid, 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. +`Δ` approximates the Laplace operator ∑d²/xᵢ² , i = 1,...,N on the N-dimensional +`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{Dim}, inner_stencil, closure_stencils) where Dim +function laplace(grid::EquidistantGrid, inner_stencil, closure_stencils) Δ = second_derivative(grid, inner_stencil, closure_stencils, 1) - for d = 2:Dim + for d = 2:dimension(grid) Δ += second_derivative(grid, inner_stencil, closure_stencils, d) end return Δ