comparison src/SbpOperators/boundaryops/boundary_restriction.jl @ 579:cd7d3949f692 feature/boundary_ops

Change name from closuresize() to closure_size()
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 01 Dec 2020 17:43:13 +0100
parents cae4d5b428d6
children 0779713f95a2
comparison
equal deleted inserted replaced
578:b24b910a9025 579:cd7d3949f692
37 37
38 function BoundaryRestriction(grid::EquidistantGrid{1}, closureStencil::Stencil{T,N}, region::Region) where {T,N} 38 function BoundaryRestriction(grid::EquidistantGrid{1}, closureStencil::Stencil{T,N}, region::Region) where {T,N}
39 return BoundaryRestriction{T,typeof(region),N}(closureStencil,size(grid)[1]) 39 return BoundaryRestriction{T,typeof(region),N}(closureStencil,size(grid)[1])
40 end 40 end
41 41
42 closuresize(::BoundaryRestriction{T,R,N}) where {T,R,N} = N 42 closure_size(::BoundaryRestriction{T,R,N}) where {T,R,N} = N
43 43
44 LazyTensors.range_size(e::BoundaryRestriction) = () 44 LazyTensors.range_size(e::BoundaryRestriction) = ()
45 LazyTensors.domain_size(e::BoundaryRestriction) = (e.size,) 45 LazyTensors.domain_size(e::BoundaryRestriction) = (e.size,)
46 46
47 function LazyTensors.apply(e::BoundaryRestriction{T,Lower}, v::AbstractVector{T}) where T 47 function LazyTensors.apply(e::BoundaryRestriction{T,Lower}, v::AbstractVector{T}) where T
64 function LazyTensors.apply_transpose(e::BoundaryRestriction{T}, v::AbstractArray{T,0}, i::Index) where T 64 function LazyTensors.apply_transpose(e::BoundaryRestriction{T}, v::AbstractArray{T,0}, i::Index) where T
65 return zero(T) 65 return zero(T)
66 end 66 end
67 67
68 function LazyTensors.apply_transpose(e::BoundaryRestriction{T}, v::AbstractArray{T,0}, i) where T 68 function LazyTensors.apply_transpose(e::BoundaryRestriction{T}, v::AbstractArray{T,0}, i) where T
69 r = getregion(i, closuresize(e), e.size) 69 r = getregion(i, closure_size(e), e.size)
70 apply_transpose(e, v, Index(i,r)) 70 apply_transpose(e, v, Index(i,r))
71 end 71 end