Mercurial > repos > public > sbplib_julia
comparison DiffOps/src/laplace.jl @ 252:9405c19b76bc boundary_conditions
Move boundary_value and similar methods of laplce
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 27 Jun 2019 14:43:57 +0200 |
parents | 89a101a63e7a |
children | e960b877e07e |
comparison
equal
deleted
inserted
replaced
251:89a101a63e7a | 252:9405c19b76bc |
---|---|
1 struct Laplace{Dim,T<:Real,N,M,K} <: DiffOpCartesian{Dim} | 1 struct Laplace{Dim,T<:Real,N,M,K} <: DiffOpCartesian{Dim} |
2 grid::EquidistantGrid{Dim,T} | 2 grid::EquidistantGrid{Dim,T} |
3 a::T | 3 a::T |
4 op::D2{Float64,N,M,K} | 4 op::D2{Float64,N,M,K} |
5 end | 5 end |
6 | |
7 boundary_value(L::Laplace, bId::CartesianBoundary) = BoundaryValue(L.op, L.grid, bId) | |
8 normal_derivative(L::Laplace, bId::CartesianBoundary) = NormalDerivative(L.op, L.grid, bId) | |
9 boundary_quadrature(L::Laplace, bId::CartesianBoundary) = throw(MethodError) # TODO: Implement this | |
10 | 6 |
11 function apply(L::Laplace{Dim}, v::AbstractArray{T,Dim} where T, I::CartesianIndex{Dim}) where Dim | 7 function apply(L::Laplace{Dim}, v::AbstractArray{T,Dim} where T, I::CartesianIndex{Dim}) where Dim |
12 error("not implemented") | 8 error("not implemented") |
13 end | 9 end |
14 | 10 |
33 function apply(L::Laplace{2}, v::AbstractArray{T,2} where T, i::CartesianIndex{2}) | 29 function apply(L::Laplace{2}, v::AbstractArray{T,2} where T, i::CartesianIndex{2}) |
34 I = Index{Unknown}.(Tuple(i)) | 30 I = Index{Unknown}.(Tuple(i)) |
35 apply(L, v, I) | 31 apply(L, v, I) |
36 end | 32 end |
37 | 33 |
34 boundary_value(L::Laplace, bId::CartesianBoundary) = BoundaryValue(L.op, L.grid, bId) | |
35 normal_derivative(L::Laplace, bId::CartesianBoundary) = NormalDerivative(L.op, L.grid, bId) | |
36 boundary_quadrature(L::Laplace, bId::CartesianBoundary) = throw(MethodError) # TODO: Implement this | |
38 | 37 |
39 | 38 |
40 """ | 39 """ |
41 BoundaryValue{T,N,M,K} <: TensorMapping{T,2,1} | 40 BoundaryValue{T,N,M,K} <: TensorMapping{T,2,1} |
42 | 41 |