From d1f9460d9c7b3c7cbdf626e8f2bbbfb8484ff778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Fuhrmann?= Date: Mon, 7 Oct 2024 10:33:07 +0200 Subject: [PATCH] Fix indexing of TransientSolution. * Address deprecation warnings: we now should write tsol.u[end] instead of tsol[end] * At once replace hardcoded relative path "../..." with joinpath(@__DIR__, ...) --- examples/Ex104_PSC_Photogeneration.jl | 11 +++++------ examples/Ex107_MoS2_withIons_BarrierLowering.jl | 6 +++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/examples/Ex104_PSC_Photogeneration.jl b/examples/Ex104_PSC_Photogeneration.jl index 6724c83..d215b20 100644 --- a/examples/Ex104_PSC_Photogeneration.jl +++ b/examples/Ex104_PSC_Photogeneration.jl @@ -19,7 +19,7 @@ function main(;n = 5, Plotter = PyPlot, # you can also use other Plotters, if you add them to the example file plotting = false, verbose = false, test = false, ######################## - parameter_file = "../parameter_files/Params_PSC_TiO2_MAPI_spiro.jl", # choose the parameter file + parameter_file = joinpath(@__DIR__,"..","parameter_files","Params_PSC_TiO2_MAPI_spiro.jl"), # choose the parameter file ######################## userdefinedGeneration = false) # you can choose between predefined and user-defined generation profiles @@ -363,7 +363,6 @@ function main(;n = 5, println("Reverse scan protocol") end ################################################################################ - inivalReverse = sol(tend) solReverse = solve(ctsys, inival = inivalReverse, times=(tend, 2 * tend), control = control) @@ -387,8 +386,8 @@ function main(;n = 5, for istep = 2:number_tsteps Δt = tvalues[istep] - tvalues[istep-1] # Time step size - inival = sol[istep-1] - solution = sol[istep] + inival = sol.u[istep-1] + solution = sol.u[istep] I = integrate(ctsys, tf, solution, inival, Δt) @@ -408,8 +407,8 @@ function main(;n = 5, for istep = 2:number_tstepsReverse Δt = tvaluesReverse[istep] - tvaluesReverse[istep-1] # Time step size - inival = solReverse[istep-1] - solution = solReverse[istep] + inival = solReverse.u[istep-1] + solution = solReverse.u[istep] I = integrate(ctsys, tf, solution, inival, Δt) diff --git a/examples/Ex107_MoS2_withIons_BarrierLowering.jl b/examples/Ex107_MoS2_withIons_BarrierLowering.jl index c71cadf..9c5c183 100644 --- a/examples/Ex107_MoS2_withIons_BarrierLowering.jl +++ b/examples/Ex107_MoS2_withIons_BarrierLowering.jl @@ -291,8 +291,8 @@ function main(;Plotter = PyPlot, plotting = false, verbose = false, test = false push!(IV, 0.0) for istep = 2:number_tsteps Δt = tvalues[istep] - tvalues[istep-1] # Time step size - inival = sol[istep-1] - solution = sol[istep] + inival = sol.u[istep-1] + solution = sol.u[istep] I = integrate(ctsys, tf, solution, inival, Δt) @@ -330,4 +330,4 @@ function test() end -end # module \ No newline at end of file +end # module