comparison src/SbpOperators/boundaryops/boundary_restriction.jl @ 571:205238c342da feature/boundary_ops

Add methods for closure size of a boundary restriction
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 01 Dec 2020 16:01:08 +0100
parents a8fe91861116
children 64f1b269e9fc
comparison
equal deleted inserted replaced
570:a8fe91861116 571:205238c342da
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
43
42 LazyTensors.range_size(e::BoundaryRestriction) = () 44 LazyTensors.range_size(e::BoundaryRestriction) = ()
43 LazyTensors.domain_size(e::BoundaryRestriction) = (e.size,) 45 LazyTensors.domain_size(e::BoundaryRestriction) = (e.size,)
44 46
45 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
46 apply_stencil(e.stencil,v,1) 48 apply_stencil(e.stencil,v,1)