Skip to content

Commit 50c20be

Browse files
committed
init
1 parent fcff2e8 commit 50c20be

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/spatial_reaction_systems/lattice_jump_systems.jl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ function JumpProcesses.JumpProblem(lrs::LatticeReactionSystem, dprob, aggregator
3636
# Currently, JumpProcesses requires uniform vertex parameters (hence `p=first.(dprob.p[1])`).
3737
hopping_constants = make_hopping_constants(dprob, lrs)
3838
non_spat_dprob = DiscreteProblem(reshape(dprob.u0, lrs.num_species, lrs.num_verts), dprob.tspan, first.(dprob.p[1]))
39-
majumps = make_majumps(non_spat_dprob, lrs.rs)
39+
sma_jumps = make_spatial_majumps(non_spat_dprob, dprob, lrs)
4040

41-
return JumpProblem(non_spat_dprob, aggregator, majumps;
41+
return JumpProblem(non_spat_dprob, aggregator, sma_jumps;
4242
hopping_constants, spatial_system = lrs.lattice, name, kwargs...)
4343
end
4444

@@ -66,6 +66,12 @@ function make_hopping_constants(dprob::DiscreteProblem, lrs::LatticeReactionSyst
6666
return hopping_constants
6767
end
6868

69+
# Creates the (spatial) mass action jumps from a (spatial) DiscreteProblem its non-spatial version, and a LatticeReactionSystem.
70+
function make_spatial_majumps(non_spat_dprob, dprob, rs::LatticeReactionSystem)
71+
ma_jumps = make_majumps(non_spat_dprob, lrs.rs)
72+
73+
end
74+
6975
# Creates the (non-spatial) mass action jumps from a (non-spatial) DiscreteProblem (and its Reaction System of origin).
7076
function make_majumps(non_spat_dprob, rs::ReactionSystem)
7177
# Computes various required inputs for assembling the mass action jumps.
@@ -74,8 +80,8 @@ function make_majumps(non_spat_dprob, rs::ReactionSystem)
7480
eqs = equations(js)
7581
invttype = non_spat_dprob.tspan[1] === nothing ? Float64 : typeof(1 / non_spat_dprob.tspan[2])
7682

77-
# Assembles the mass action jumps.
83+
# Assembles the non-spatial mass action jumps.
7884
p = (non_spat_dprob.p isa DiffEqBase.NullParameters || non_spat_dprob.p === nothing) ? Num[] : non_spat_dprob.p
7985
majpmapper = ModelingToolkit.JumpSysMajParamMapper(js, p; jseqs = eqs, rateconsttype = invttype)
8086
return ModelingToolkit.assemble_maj(eqs.x[1], statetoid, majpmapper)
81-
end
87+
end

0 commit comments

Comments
 (0)