Mercurial > repos > public > sbplib_julia
changeset 154:3193bac1c086 boundary_conditions
More sketching of how things might work
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 23 Apr 2019 09:53:34 +0200 |
parents | 754c36796ac8 |
children | 9fdbae11dd77 |
files | diffOp.jl |
diffstat | 1 files changed, 38 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/diffOp.jl Wed Apr 17 09:43:56 2019 +0200 +++ b/diffOp.jl Tue Apr 23 09:53:34 2019 +0200 @@ -102,6 +102,8 @@ grid::Grid.EquidistantGrid{Dim,T} a::T op::D2{Float64,N,M,K} + e::BoundaryValue + d::NormalDerivative end function apply(L::Laplace{Dim}, v::AbstractArray{T,Dim} where T, I::CartesianIndex{Dim}) where Dim @@ -130,6 +132,35 @@ apply(L, v, I) end +struct BoundaryOperator + +end + +struct BoundaryValue + op::D2{Float64,N,M,K} +end + +function apply(e::BoundaryValue) + +end + +function apply_adjoint(e::BoundaryValue) + +end + +struct NormalDerivative + op::D2{Float64,N,M,K} +end + +function apply(e::NormalDerivative) + +end + +function apply_adjoint(e::NormalDerivative) + +end + + # Boundary operators function apply_e(L::Laplace{2}, v::AbstractArray{T,2} where T, ::CartesianBoundary{1,R}, j::Int) where R @@ -185,3 +216,10 @@ # e, d, H_gamma applied based on bc.boundaryId end +function apply(s::MyWaveEq{D}, v::AbstractArray{T,D}, i::CartesianIndex{D}) where D + return apply(s.L, v, i) + + sat(s.L, Dirichlet{CartesianBoundary{1,Lower}}(s.tau), v, s.g_w, i) + + sat(s.L, Dirichlet{CartesianBoundary{1,Upper}}(s.tau), v, s.g_e, i) + + sat(s.L, Dirichlet{CartesianBoundary{2,Lower}}(s.tau), v, s.g_s, i) + + sat(s.L, Dirichlet{CartesianBoundary{2,Upper}}(s.tau), v, s.g_n, i) + +end