comparison src/SbpOperators/volumeops/laplace/laplace.jl @ 751:f94feb005e7d feature/laplace_opset

Change from Dict to StaticDict in Laplace
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Fri, 19 Mar 2021 16:56:58 +0100
parents c16abc564b82
children fc83d672be36
comparison
equal deleted inserted replaced
750:f88b2117dc69 751:f94feb005e7d
16 TMbqop<:TensorMapping{T,Rb,Rb}, # Boundary quadrature 16 TMbqop<:TensorMapping{T,Rb,Rb}, # Boundary quadrature
17 BID<:BoundaryIdentifier} <: TensorMapping{T,Dim,Dim} 17 BID<:BoundaryIdentifier} <: TensorMapping{T,Dim,Dim}
18 D::TMdiffop # Differential operator 18 D::TMdiffop # Differential operator
19 H::TMipop # Inner product operator 19 H::TMipop # Inner product operator
20 H_inv::TMipop # Inverse inner product operator 20 H_inv::TMipop # Inverse inner product operator
21 e::Dict{BID,TMbop} # Boundary restriction operators 21 e::StaticDict{BID,TMbop} # Boundary restriction operators
22 d::Dict{BID,TMbop} # Normal derivative operators 22 d::StaticDict{BID,TMbop} # Normal derivative operators
23 H_boundary::Dict{BID,TMbqop} # Boundary quadrature operators 23 H_boundary::StaticDict{BID,TMbqop} # Boundary quadrature operators
24 end 24 end
25 export Laplace 25 export Laplace
26 26
27 function Laplace(grid::AbstractGrid, fn; order) 27 function Laplace(grid::AbstractGrid, fn; order)
28 # TODO: Removed once we can construct the volume and 28 # TODO: Removed once we can construct the volume and
45 n_ids = length(ids) 45 n_ids = length(ids)
46 e_pairs = ntuple(i -> Pair(ids[i],boundary_restriction(grid,e_closure_stencil,ids[i])),n_ids) 46 e_pairs = ntuple(i -> Pair(ids[i],boundary_restriction(grid,e_closure_stencil,ids[i])),n_ids)
47 d_pairs = ntuple(i -> Pair(ids[i],normal_derivative(grid,d_closure_stencil,ids[i])),n_ids) 47 d_pairs = ntuple(i -> Pair(ids[i],normal_derivative(grid,d_closure_stencil,ids[i])),n_ids)
48 Hᵧ_pairs = ntuple(i -> Pair(ids[i],inner_product(boundary_grid(grid,ids[i]),H_closure_stencils)),n_ids) 48 Hᵧ_pairs = ntuple(i -> Pair(ids[i],inner_product(boundary_grid(grid,ids[i]),H_closure_stencils)),n_ids)
49 49
50 return Laplace(Δ, H, H⁻¹, Dict(e_pairs), Dict(d_pairs), Dict(Hᵧ_pairs)) 50 return Laplace(Δ, H, H⁻¹, StaticDict(e_pairs), StaticDict(d_pairs), StaticDict(Hᵧ_pairs))
51 end 51 end
52 52
53 LazyTensors.range_size(L::Laplace) = LazyTensors.range_size(L.D) 53 LazyTensors.range_size(L::Laplace) = LazyTensors.range_size(L.D)
54 LazyTensors.domain_size(L::Laplace) = LazyTensors.domain_size(L.D) 54 LazyTensors.domain_size(L::Laplace) = LazyTensors.domain_size(L.D)
55 LazyTensors.apply(L::Laplace, v::AbstractArray, I...) = LazyTensors.apply(L.D,v,I...) 55 LazyTensors.apply(L::Laplace, v::AbstractArray, I...) = LazyTensors.apply(L.D,v,I...)