Mercurial > repos > public > sbplib_julia
comparison diffOp.jl @ 135:bb1cc9c7877c boundary_conditions
Add outline of idea for implemenation of sats
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 21 Feb 2019 16:45:06 +0100 |
parents | 1aaeb46ba5f4 |
children | 755246142200 |
comparison
equal
deleted
inserted
replaced
134:79699dda29be | 135:bb1cc9c7877c |
---|---|
126 # Slow but maybe convenient? | 126 # Slow but maybe convenient? |
127 function apply(L::Laplace{2}, v::AbstractArray{T,2} where T, i::CartesianIndex{2}) | 127 function apply(L::Laplace{2}, v::AbstractArray{T,2} where T, i::CartesianIndex{2}) |
128 I = Index{Unknown}.(Tuple(i)) | 128 I = Index{Unknown}.(Tuple(i)) |
129 apply(L, v, I) | 129 apply(L, v, I) |
130 end | 130 end |
131 | |
132 """ | |
133 A BoundaryCondition should implement the method | |
134 sat(::DiffOp, v::AbstractArray, data::AbstractArray, ...) | |
135 """ | |
136 abstract type BoundaryCondition end | |
137 | |
138 struct Dirichlet <: BoundaryCondition | |
139 tau::Float64 | |
140 # boundaryId?? | |
141 end | |
142 | |
143 struct Neumann <: BoundaryCondition | |
144 # boundaryId?? | |
145 end | |
146 | |
147 function sat(L::Laplace{2}, bc::Neumann, v::AbstractArray{T,2}, g::AbstractVector{T}, i::CartesianIndex{2}) | |
148 # Hi * e * H_gamma * (d'*v - g) | |
149 # e, d, H_gamma applied based on bc.boundaryId | |
150 end | |
151 | |
152 function sat(L::Laplace{2}, bc::Dirichlet, v::AbstractArray{T,2}, g::AbstractVector{T}, i::CartesianIndex{2}) | |
153 # Hi * (tau/h*e + sig*d) * H_gamma * (e'*v - g) | |
154 # e, d, H_gamma applied based on bc.boundaryId | |
155 end | |
156 |