Skip to content

Commit 6c28816

Browse files
committed
skip interfaces that don't have the rxnarray attribute
1 parent 74b3d72 commit 6c28816

1 file changed

Lines changed: 20 additions & 18 deletions

File tree

src/EdgeAnalysis.jl

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -292,28 +292,30 @@ function processfluxes(sim::SystemSimulation,
292292
index += size(d.rxnarray)[2]
293293
end
294294
for d in sim.interfaces
295-
for i = 1:size(d.rxnarray)[2]
296-
if any(d.rxnarray[:,i].>length(corespeciesconcentrations))
297-
continue
298-
end
299-
for j = 1:3
300-
if d.rxnarray[j,i] != 0
301-
corespeciesconsumptionrates[d.rxnarray[j,i]] += frts[i+index]
302-
corespeciesproductionrates[d.rxnarray[j,i]] += rrts[i+index]
303-
else
304-
break
295+
if hasproperty(d,:rxnarray)
296+
for i = 1:size(d.rxnarray)[2]
297+
if any(d.rxnarray[:,i].>length(corespeciesconcentrations))
298+
continue
305299
end
306-
end
307-
for j = 4:6
308-
if d.rxnarray[j,i] != 0
309-
corespeciesproductionrates[d.rxnarray[j,i]] += frts[i+index]
310-
corespeciesconsumptionrates[d.rxnarray[j,i]] += rrts[i+index]
311-
else
312-
break
300+
for j = 1:3
301+
if d.rxnarray[j,i] != 0
302+
corespeciesconsumptionrates[d.rxnarray[j,i]] += frts[i+index]
303+
corespeciesproductionrates[d.rxnarray[j,i]] += rrts[i+index]
304+
else
305+
break
306+
end
307+
end
308+
for j = 4:6
309+
if d.rxnarray[j,i] != 0
310+
corespeciesproductionrates[d.rxnarray[j,i]] += frts[i+index]
311+
corespeciesconsumptionrates[d.rxnarray[j,i]] += rrts[i+index]
312+
else
313+
break
314+
end
313315
end
314316
end
317+
index += size(d.rxnarray)[2]
315318
end
316-
index += size(d.rxnarray)[2]
317319
end
318320

319321
return dydt,rts,frts,rrts,cs,corespeciesrates,charrate,edgespeciesrates,edgereactionrates,corespeciesrateratios,edgespeciesrateratios,corereactionrates,corespeciesconcentrations,corespeciesproductionrates,corespeciesconsumptionrates

0 commit comments

Comments
 (0)