Skip to content

Commit

Permalink
Add _taylorinteg test
Browse files Browse the repository at this point in the history
  • Loading branch information
PerezHz committed Apr 19, 2024
1 parent eae1221 commit 4999b8b
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/taylorize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1297,6 +1297,35 @@ import Logging: Warn
@test sol.t == solp.t
@test iszero( norm(sol.x-solp.x, Inf) )
@test iszero( norm(sol.p-solp.p, Inf) )

@testset "Test _taylorinteg function barrier" begin
_t0 = t0
_tmax = tf
_q0 = q0TN
_params = nothing
_maxsteps = 3000
_T = eltype(_t0)
_U = eltype(_q0)
# Initialize the vector of Taylor1 expansions
_dof = length(_q0)
_t = _t0 + Taylor1( _T, _order )
_x = Array{Taylor1{_U}}(undef, _dof)
_dx = Array{Taylor1{_U}}(undef, _dof)
@inbounds for i in eachindex(_q0)
_x[i] = Taylor1( _q0[i], _order )
_dx[i] = Taylor1( zero(_q0[i]), _order )
end
# Determine if specialized jetcoeffs! method exists
__parse_eqs, __rv = TaylorIntegration._determine_parsing!(true, kepler1!, _t, _x, _dx, _params);
# Re-initialize the Taylor1 expansions
_t = _t0 + Taylor1( _T, _order )
_x .= Taylor1.( _q0, _order )
_dx .= Taylor1.( zero.(_q0), _order)
solTN = @inferred TaylorIntegration._taylorinteg!(Val(true), kepler1!, _t, _x, _dx, _q0, _t0, _tmax, _abstol, __rv, _params; parse_eqs=__parse_eqs, maxsteps=_maxsteps)
solTN2 = @inferred TaylorIntegration._taylorinteg!(Val(false), kepler1!, _t, _x, _dx, _q0, _t0, _tmax, _abstol, __rv, _params; parse_eqs=__parse_eqs, maxsteps=_maxsteps)
@test solTN isa TaylorSolution{typeof(_t0), eltype(_q0), ndims(solTN.x), typeof(solTN.t), typeof(solTN.x), typeof(solTN.p), Nothing, Nothing, Nothing}
@test solTN2 isa TaylorSolution{typeof(_t0), eltype(_q0), ndims(solTN.x), typeof(solTN.t), typeof(solTN.x), Nothing, Nothing, Nothing, Nothing}
end
end


Expand Down

0 comments on commit 4999b8b

Please sign in to comment.