Skip to content

Commit

Permalink
Scrap ExtendInner BC
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas Lycken committed Dec 26, 2014
1 parent a8c7bf9 commit 535e54f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
6 changes: 0 additions & 6 deletions src/Interpolations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export
ExtrapReflect,
OnCell,
OnGrid,
ExtendInner,
Flat,
LinearBC

Expand All @@ -28,7 +27,6 @@ type OnCell <: GridRepresentation end

abstract BoundaryCondition
type None <: BoundaryCondition end
type ExtendInner <: BoundaryCondition end
type Flat <: BoundaryCondition end
type LinearBC <: BoundaryCondition end

Expand Down Expand Up @@ -77,8 +75,6 @@ for IT in (
Constant{OnCell},
Linear{OnGrid},
Linear{OnCell},
Quadratic{ExtendInner,OnCell},
Quadratic{ExtendInner,OnGrid},
Quadratic{Flat,OnCell},
Quadratic{Flat,OnGrid},
Quadratic{LinearBC,OnCell}
Expand Down Expand Up @@ -129,8 +125,6 @@ end

# This creates prefilter specializations for all interpolation types that need them
for IT in (
Quadratic{ExtendInner,OnCell},
Quadratic{ExtendInner,OnGrid},
Quadratic{Flat,OnCell},
Quadratic{Flat,OnGrid},
Quadratic{LinearBC,OnCell}
Expand Down
12 changes: 4 additions & 8 deletions src/quadratic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,14 @@ type Quadratic{BC<:BoundaryCondition,GR<:GridRepresentation} <: InterpolationTyp

Quadratic{BC<:BoundaryCondition,GR<:GridRepresentation}(::BC, ::GR) = Quadratic{BC,GR}()

function bc_gen(::Quadratic{ExtendInner}, N)
function bc_gen(q::Quadratic, N)
quote
# We've already done extrapolation, so if we're here, we know that
# 1 <= x_d <= size(itp,d), but ExtendInner mandates that the two
# outermost cells are treated specially. Therefore, we need to
# further clamp the indices of the spline coefficients by one cell in
# each direction.
@nexprs $N d->(ix_d = clamp(iround(x_d), 2, size(itp,d)-1))
pad = padding($q)
@nexprs $N d->(ix_d = clamp(iround(x_d), 1, size(itp,d)) + pad)
end
end

function indices(::Quadratic{ExtendInner}, N)
function indices(q::Quadratic, N)
quote
@nexprs $N d->begin
ixp_d = ix_d + 1
Expand Down

0 comments on commit 535e54f

Please sign in to comment.