Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Oct 9, 2023
1 parent a4694e8 commit 5edb3fa
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 263 deletions.
253 changes: 0 additions & 253 deletions src/nlprob.jl

This file was deleted.

4 changes: 2 additions & 2 deletions src/solve/mirk.jl
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@ function generate_nlprob(cache::MIRKCache{iip}, y, loss_bc, loss_collocation, lo

if !iip && cache.prob.f.bcresid_prototype === nothing
y_ = recursive_unflatten!(cache.y, y)
resid_ = cache.bc((y_[1], y_[end]), cache.p)
resid = ArrayPartition(ArrayPartition(resid_), similar(y, cache.M * (N - 1)))
resid_ = ArrayPartition(cache.bc[1](y_[1], cache.p), cache.bc[2](y_[end], cache.p))
resid = ArrayPartition(resid_, similar(y, cache.M * (N - 1)))
else
resid = ArrayPartition(cache.prob.f.bcresid_prototype,
similar(y, cache.M * (N - 1)))
Expand Down
4 changes: 2 additions & 2 deletions src/solve/multiple_shooting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ end

function multiple_shooting_initialize(prob, alg::MultipleShooting, has_initial_guess,
nshoots; odesolve_kwargs = (;), verbose = true, kwargs...)
@unpack f, bc, u0, tspan, p = prob
@unpack f, u0, tspan, p = prob
@unpack ode_alg = alg

nodes = range(tspan[1], tspan[2]; length = nshoots + 1)
Expand Down Expand Up @@ -210,7 +210,7 @@ end

@views @inline function multiple_shooting_initialize(u_at_nodes_prev, prob, alg,
prev_nodes, nshoots, old_nshoots, has_initial_guess; odesolve_kwargs = (;), kwargs...)
@unpack f, bc, u0, tspan, p = prob
@unpack f, u0, tspan, p = prob
nodes = range(tspan[1], tspan[2]; length = nshoots + 1)
N = has_initial_guess ? length(first(u0)) : length(u0)

Expand Down
2 changes: 0 additions & 2 deletions test/mirk/mirk_convergence_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ testTol = 0.2
affineTol = 1e-2
dts = 1 .// 2 .^ (3:-1:1)

@info "Collocation method (MIRK)"

@testset "Affineness" begin
@testset "Problem: $i" for i in (1, 2, 5, 6)
prob = probArr[i]
Expand Down
2 changes: 0 additions & 2 deletions test/shooting/orbital.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Lambert's Problem
using BoundaryValueDiffEq, OrdinaryDiffEq, LinearAlgebra, Test

@info "Testing Lambert's Problem"

y0 = [
-4.7763169762853989E+06,
-3.8386398704441520E+05,
Expand Down
4 changes: 2 additions & 2 deletions test/shooting/shooting_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ using BoundaryValueDiffEq, LinearAlgebra, OrdinaryDiffEq, Test
end

# Inplace
bc2_a!(resid, ua, p) = (resid[1] = ua[1])
bc2_b!(resid, ub, p) = (resid[1] = ub[1] - 1)
bc2a!(resid, ua, p) = (resid[1] = ua[1])
bc2b!(resid, ub, p) = (resid[1] = ub[1] - 1)

bvp3 = TwoPointBVProblem(f1!, (bc2a!, bc2b!), u0, tspan;
bcresid_prototype = (Array{Float64}(undef, 1), Array{Float64}(undef, 1)))
Expand Down

0 comments on commit 5edb3fa

Please sign in to comment.