Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/quadrature/inverse_diagonal_quadrature.jl @ 561:04d7b4eb63ef feature/quadrature_as_outer_product
Merge with default
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Mon, 30 Nov 2020 16:28:32 +0100 |
parents | src/SbpOperators/quadrature/inverse_diagonal_inner_product.jl@d1929491180b src/SbpOperators/quadrature/inverse_diagonal_inner_product.jl@9b5710ae6587 |
children |
comparison
equal
deleted
inserted
replaced
559:08e27dee76c3 | 561:04d7b4eb63ef |
---|---|
59 apply(Hi::InverseDiagonalQuadrature{T}, v::AbstractVector{T}, i) where T | 59 apply(Hi::InverseDiagonalQuadrature{T}, v::AbstractVector{T}, i) where T |
60 Implements the application `(Hi*v)[i]` an `Index{R}` where `R` is one of the regions | 60 Implements the application `(Hi*v)[i]` an `Index{R}` where `R` is one of the regions |
61 `Lower`,`Interior`,`Upper`. If `i` is another type of index (e.g an `Int`) it will first | 61 `Lower`,`Interior`,`Upper`. If `i` is another type of index (e.g an `Int`) it will first |
62 be converted to an `Index{R}`. | 62 be converted to an `Index{R}`. |
63 """ | 63 """ |
64 function LazyTensors.apply(Hi::InverseDiagonalQuadrature{T}, v::AbstractVector{T}, I::Index{Lower}) where T | 64 function LazyTensors.apply(Hi::InverseDiagonalQuadrature{T}, v::AbstractVector{T}, i::Index{Lower}) where T |
65 return @inbounds Hi.h_inv*Hi.closure[Int(I)]*v[Int(I)] | 65 return @inbounds Hi.h_inv*Hi.closure[Int(i)]*v[Int(i)] |
66 end | 66 end |
67 | 67 |
68 function LazyTensors.apply(Hi::InverseDiagonalQuadrature{T}, v::AbstractVector{T}, I::Index{Upper}) where T | 68 function LazyTensors.apply(Hi::InverseDiagonalQuadrature{T}, v::AbstractVector{T}, i::Index{Upper}) where T |
69 N = length(v); | 69 N = length(v); |
70 return @inbounds Hi.h_inv*Hi.closure[N-Int(I)+1]*v[Int(I)] | 70 return @inbounds Hi.h_inv*Hi.closure[N-Int(i)+1]*v[Int(i)] |
71 end | 71 end |
72 | 72 |
73 function LazyTensors.apply(Hi::InverseDiagonalQuadrature{T}, v::AbstractVector{T}, I::Index{Interior}) where T | 73 function LazyTensors.apply(Hi::InverseDiagonalQuadrature{T}, v::AbstractVector{T}, i::Index{Interior}) where T |
74 return @inbounds Hi.h_inv*v[Int(I)] | 74 return @inbounds Hi.h_inv*v[Int(i)] |
75 end | 75 end |
76 | 76 |
77 function LazyTensors.apply(Hi::InverseDiagonalQuadrature{T}, v::AbstractVector{T}, i) where T | 77 function LazyTensors.apply(Hi::InverseDiagonalQuadrature{T}, v::AbstractVector{T}, i) where T |
78 N = length(v); | 78 N = length(v); |
79 r = getregion(i, closure_size(Hi), N) | 79 r = getregion(i, closure_size(Hi), N) |