@@ -31,12 +31,11 @@ struct CosmologyProblem{Tbg <: ODEProblem, Tpt <: Union{ODEProblem, Nothing}, Tb
3131 bgspline:: Tbgspline
3232end
3333
34- struct CosmologySolution{Tbg <: ODESolution , Tpts <: Union{Nothing, EnsembleSolution} , Tks <: Union{Nothing, AbstractVector} , Th <: Number }
34+ struct CosmologySolution{Tbg <: ODESolution , Tpts <: Union{Nothing, EnsembleSolution} , Tks <: Union{Nothing, AbstractVector} }
3535 prob:: CosmologyProblem # problem which is solved
3636 bg:: Tbg # background solution
3737 ks:: Tks # perturbation wavenumbers
3838 pts:: Tpts # perturbation solutions
39- h:: Th # reduced Hubble parameter h = H/(100 km/s/Mpc)
4039end
4140
4241algname (alg) = string (nameof (typeof (alg)))
@@ -293,16 +292,15 @@ function solve(
293292 bgsol = solvebg (prob. bg; verbose, bgopts... , kwargs... )
294293 end
295294
296- h = getsym (bgsol, :h )(bgsol) # TODO : remove symbolic getter
297295 if isnothing (ks) || isempty (ks)
298296 ks = nothing
299297 ptsol = nothing
300298 else
301- ks = k_dimensionless .(ks, h )
299+ ks = k_dimensionless .(ks, Ref (bgsol) )
302300 ptsol = solvept (prob. pt, bgsol, ks, prob. bgspline; thread, verbose, ptopts... , kwargs... )
303301 end
304302
305- return CosmologySolution (prob, bgsol, ks, ptsol, h )
303+ return CosmologySolution (prob, bgsol, ks, ptsol)
306304end
307305function solve (prob:: CosmologyProblem , k:: Number ; kwargs... )
308306 return solve (prob, [k]; kwargs... )
@@ -570,7 +568,7 @@ function getsym(provider::Union{CosmologyProblem, CosmologySolution}, p)
570568end
571569
572570function neighboring_modes_indices (sol:: CosmologySolution , k)
573- k = k_dimensionless .(k, sol. h )
571+ k = k_dimensionless .(k, Ref ( sol. bg) )
574572 if k == sol. ks[begin ] # k == kmin
575573 i1 = i2 = 1
576574 elseif k == sol. ks[end ] # k == kmax
@@ -588,7 +586,7 @@ function (sol::CosmologySolution)(out::AbstractArray, is::AbstractArray, ts::Abs
588586 if isnothing (sol. ks) || isempty (sol. ks)
589587 throw (error (" No perturbations solved for. Pass ks to solve()." ))
590588 end
591- ks = k_dimensionless .(ks, sol. h )
589+ ks = k_dimensionless .(ks, Ref ( sol. bg) )
592590 kmin, kmax = extrema (sol. ks)
593591 minimum (ks) >= kmin || throw (" Requested wavenumber k = $(minimum (ks)) is below the minimum solved wavenumber $kmin " )
594592 maximum (ks) <= kmax || throw (" Requested wavenumber k = $(maximum (ks)) is above the maximum solved wavenumber $kmax " )
0 commit comments