comparison diffOp.jl @ 145:e0c8f5cf3a3f boundary_conditions

Rename boundary indentifiers and use them inte the sat functions
author Jonatan Werpers <jonatan@werpers.com>
date Mon, 25 Feb 2019 10:19:11 -0800
parents 755246142200
children f54dd4408fa7
comparison
equal deleted inserted replaced
143:755246142200 145:e0c8f5cf3a3f
164 A BoundaryCondition should implement the method 164 A BoundaryCondition should implement the method
165 sat(::DiffOp, v::AbstractArray, data::AbstractArray, ...) 165 sat(::DiffOp, v::AbstractArray, data::AbstractArray, ...)
166 """ 166 """
167 abstract type BoundaryCondition end 167 abstract type BoundaryCondition end
168 168
169 struct Dirichlet{Id<:BoundaryIdentifier} <: BoundaryCondition 169 struct Dirichlet{Bid<:BoundaryIdentifier} <: BoundaryCondition
170 tau::Float64 170 tau::Float64
171 end 171 end
172 172
173 struct Neumann{Id<:BoundaryIdentifier} <: BoundaryCondition 173 struct Neumann{Bid<:BoundaryIdentifier} <: BoundaryCondition
174 end 174 end
175 175
176 function sat(L::Laplace{2}, bc::Neumann, v::AbstractArray{T,2} where T, g::AbstractVector{T}, i::CartesianIndex{2}) 176 function sat(L::Laplace{2}, bc::Neumann{CartesianBoundary{1,R}}, v::AbstractArray{T,2} where T, g::AbstractVector{T}, i::CartesianIndex{2}) where R
177
177 # Hi * e * H_gamma * (d'*v - g) 178 # Hi * e * H_gamma * (d'*v - g)
178 # e, d, H_gamma applied based on bc.boundaryId 179 # e, d, H_gamma applied based on bc.boundaryId
179 end 180 end
180 181
181 function sat(L::Laplace{2}, bc::Dirichlet, v::AbstractArray{T,2} where T, g::AbstractVector{T}, i::CartesianIndex{2}) 182 function sat(L::Laplace{2}, bc::Dirichlet{CartesianBoundary{1,R}}, v::AbstractArray{T,2} where T, g::AbstractVector{T}, i::CartesianIndex{2})
182 # Hi * (tau/h*e + sig*d) * H_gamma * (e'*v - g) 183 # Hi * (tau/h*e + sig*d) * H_gamma * (e'*v - g)
183 # e, d, H_gamma applied based on bc.boundaryId 184 # e, d, H_gamma applied based on bc.boundaryId
184 end 185 end
185 186