Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaLampert committed Oct 29, 2024
1 parent 3bc83e7 commit 52158ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/interpolation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,11 @@ end
function Base.show(io::IO, titp::TemporalInterpolation)
sd = titp.ode_sol.prob.p.spatial_discretization
tspan = titp.ode_sol.prob.tspan
N_i = length(sd.nodeset_inner)
N_b = length(sd.nodeset_boundary)
k = interpolation_kernel(sd.basis)
return print(io,
"Temporal interpolation with $(length(sd.nodeset_inner)) inner nodes, $(length(sd.nodeset_boundary)) boundary nodes, kernel $(sd.kernel), and time span $tspan")
"Temporal interpolation with $N_i inner nodes, $N_b boundary nodes, kernel $k, and time span $tspan")
end

function (titp::TemporalInterpolation)(t)
Expand Down
4 changes: 2 additions & 2 deletions test/test_unit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ end
centers = NodeSet([0.0 0.0
1.0 0.0
0.0 1.0])
itp = @test_nowarn interpolate(nodes, centers, ff, kernel)
itp = @test_nowarn interpolate(centers, nodes, ff, kernel)
expected_coefficients = [
0.0,
0.0,
Expand All @@ -728,7 +728,7 @@ end
@test isapprox(coeffs[i], expected_coefficients[i], atol = 1e-15)
end
@test order(itp) == order(kernel)
@test length(kernel_coefficients(itp)) == length(itp.centers)
@test length(kernel_coefficients(itp)) == length(KernelInterpolation.centers(itp))
@test length(polynomial_coefficients(itp)) == order(itp) + 1
@test length(polynomial_basis(itp)) ==
binomial(order(itp) - 1 + dim(nodes), dim(nodes))
Expand Down

0 comments on commit 52158ff

Please sign in to comment.