Mercurial > repos > public > sbplib_julia
comparison DiffOps/src/laplace.jl @ 283:12a12a5cd973 boundary_conditions
Fix tests for Laplace2D.
| author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
|---|---|
| date | Thu, 09 Jan 2020 13:38:06 +0100 |
| parents | ce6a2f3f732a |
| children | 0b8e041a1873 |
comparison
equal
deleted
inserted
replaced
| 282:ce6a2f3f732a | 283:12a12a5cd973 |
|---|---|
| 31 quadrature(L::Laplace) = Quadrature(L.op, L.grid) | 31 quadrature(L::Laplace) = Quadrature(L.op, L.grid) |
| 32 inverse_quadrature(L::Laplace) = InverseQuadrature(L.op, L.grid) | 32 inverse_quadrature(L::Laplace) = InverseQuadrature(L.op, L.grid) |
| 33 boundary_value(L::Laplace, bId::CartesianBoundary) = BoundaryValue(L.op, L.grid, bId) | 33 boundary_value(L::Laplace, bId::CartesianBoundary) = BoundaryValue(L.op, L.grid, bId) |
| 34 normal_derivative(L::Laplace, bId::CartesianBoundary) = NormalDerivative(L.op, L.grid, bId) | 34 normal_derivative(L::Laplace, bId::CartesianBoundary) = NormalDerivative(L.op, L.grid, bId) |
| 35 boundary_quadrature(L::Laplace, bId::CartesianBoundary) = BoundaryQuadrature(L.op, L.grid, bId) | 35 boundary_quadrature(L::Laplace, bId::CartesianBoundary) = BoundaryQuadrature(L.op, L.grid, bId) |
| 36 export quadrature | |
| 36 | 37 |
| 37 """ | 38 """ |
| 38 Quadrature{Dim,T<:Real,N,M,K} <: TensorMapping{T,Dim,Dim} | 39 Quadrature{Dim,T<:Real,N,M,K} <: TensorMapping{T,Dim,Dim} |
| 39 | 40 |
| 40 Implements the quadrature operator `H` of Dim dimension as a TensorMapping | 41 Implements the quadrature operator `H` of Dim dimension as a TensorMapping |
| 156 bId::CartesianBoundary | 157 bId::CartesianBoundary |
| 157 end | 158 end |
| 158 export BoundaryQuadrature | 159 export BoundaryQuadrature |
| 159 | 160 |
| 160 # TODO: Make this independent of dimension | 161 # TODO: Make this independent of dimension |
| 161 # TODO: Dispatch directly on Index{R}? | |
| 162 function LazyTensors.apply(q::BoundaryQuadrature{T}, v::AbstractArray{T,1}, I::NTuple{1,Index}) where T | 162 function LazyTensors.apply(q::BoundaryQuadrature{T}, v::AbstractArray{T,1}, I::NTuple{1,Index}) where T |
| 163 h = spacing(q.grid)[3-dim(q.bId)] | 163 h = spacing(q.grid)[3-dim(q.bId)] |
| 164 N = size(v) | 164 N = size(v) |
| 165 return apply_quadrature(q.op, h, v[I[1]], I[1], N[1]) | 165 return apply_quadrature(q.op, h, v[I[1]], I[1], N[1]) |
| 166 end | 166 end |
