comparison diffOp.jl @ 84:48079bd39969

Change to using tuples in stencils and ops
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 25 Jan 2019 15:20:40 +0100
parents 81d9510cb2d0
children 8d505e9bc715 c0729ade65da
comparison
equal deleted inserted replaced
77:2be36b38389d 84:48079bd39969
31 function apply(c::Penalty, g, i::Int) 31 function apply(c::Penalty, g, i::Int)
32 error("not implemented") 32 error("not implemented")
33 end 33 end
34 34
35 # Differential operator for a*d^2/dx^2 35 # Differential operator for a*d^2/dx^2
36 struct Laplace{D, T<:Real} <: DiffOp 36 struct Laplace{Dim,T<:Real,N,M,K} <: DiffOp
37 grid::Grid.EquidistantGrid{D,T} 37 grid::Grid.EquidistantGrid{Dim,T}
38 a::T 38 a::T
39 op::D2{Float64} 39 op::D2{Float64,N,M,K}
40 end 40 end
41 41
42 # u = L*v 42 # u = L*v
43 function apply!(L::Laplace{1}, u::AbstractVector, v::AbstractVector) 43 function apply!(L::Laplace{1}, u::AbstractVector, v::AbstractVector)
44 h = Grid.spacings(L.grid)[1] 44 h = Grid.spacings(L.grid)[1]