From 0b7362438a29ffdc8f434e37bdf6812d59b2df7b Mon Sep 17 00:00:00 2001 From: Yen-Ting Wang Date: Tue, 19 Sep 2023 14:03:14 -0400 Subject: [PATCH] Give type to avoid error when summing over empty list --- src/Simulation.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Simulation.jl b/src/Simulation.jl index 025819e2..e9c4c6e0 100644 --- a/src/Simulation.jl +++ b/src/Simulation.jl @@ -319,7 +319,7 @@ end function rops(ssys::SystemSimulation, name, t) domains = getfield.(ssys.sims, :domain) ind = findfirst(isequal(name), ssys.names) - Nrxns = sum([length(sim.domain.phase.reactions) for sim in ssys.sims]) + sum([length(inter.reactions) for inter in ssys.interfaces if hasproperty(inter, :reactions)]) + Nrxns = sum([length(sim.domain.phase.reactions) for sim in ssys.sims]) + sum(Vector{Int}([length(inter.reactions) for inter in ssys.interfaces if hasproperty(inter, :reactions)])) Nspcs = sum([length(getphasespecies(sim.domain.phase)) for sim in ssys.sims]) cstot = zeros(Nspcs) vns = Array{Any,1}(undef, length(domains))