Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit 3974bc9

Browse files
fix tests
1 parent db342f4 commit 3974bc9

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

src/problem_solution_types.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ end
2323
@inline Base.getindex(sol::ApproxFunSolution, I::AbstractArray{Int}) = Fun.(sol.space,sol.sol[I])
2424

2525
@inline Base.length(sol::ApproxFunSolution) = length(sol.sol)
26+
@inline function Base.endof(sol::ApproxFunSolution)
27+
endof(sol.sol)
28+
end
2629
@inline Base.size(sol::ApproxFunSolution) = size(sol.sol)
2730
@inline Base.eachindex(sol::ApproxFunSolution) = Base.OneTo(length(sol.u))
2831

test/indirect_approxfun.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,17 @@ prob = ApproxFunProblem(ode_prob)
1313
sol(0.5)
1414
sol(0.5,0.2)
1515

16-
#plot(sol(0.0),label="t=0")
17-
#plot!(sol(0.5),label="t=0.5")
18-
#plot!(sol(1.0),label="t=1.0")
19-
2016
@time sol=solve(prob,CVODE_BDF())
2117

2218
sol[1]
23-
sol[2,1]
19+
sol[5](0.2)
2420

2521
function bc(t,u)
26-
B=dirichlet(S)
22+
B=Dirichlet()
2723
C=eye(S)[3:end,:]
28-
tmp = [B;C]\[0.;0.;u]
24+
tmp = [Evaluation(0);
25+
Evaluation(2π);
26+
C]\[0.;0.;u]
2927
end
3028

3129
u0=Fun->cos(cos(θ)) - cos(cos(0)),S)
@@ -39,9 +37,11 @@ condition(t,u,integrator) = true
3937
function affect!(integrator)
4038
S=Fourier()
4139
u = Fun(S,integrator.u)
42-
B=dirichlet(S)
40+
B=Dirichlet()
4341
C=eye(S)[3:end,:]
44-
tmp = [B;C]\[0.;0.;u]
42+
tmp = [Evaluation(0);
43+
Evaluation(2π);
44+
C]\[0.;0.;u]
4545
integrator.u=pad!(tmp.coefficients,length(integrator.u))
4646
end
4747
boundary_projection = DiscreteCallback(condition,affect!)

0 commit comments

Comments
 (0)