@@ -36,9 +36,9 @@ function JumpProcesses.JumpProblem(lrs::LatticeReactionSystem, dprob, aggregator
36
36
# Currently, JumpProcesses requires uniform vertex parameters (hence `p=first.(dprob.p[1])`).
37
37
hopping_constants = make_hopping_constants (dprob, lrs)
38
38
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)
40
40
41
- return JumpProblem (non_spat_dprob, aggregator, majumps ;
41
+ return JumpProblem (non_spat_dprob, aggregator, sma_jumps ;
42
42
hopping_constants, spatial_system = lrs. lattice, name, kwargs... )
43
43
end
44
44
@@ -66,6 +66,12 @@ function make_hopping_constants(dprob::DiscreteProblem, lrs::LatticeReactionSyst
66
66
return hopping_constants
67
67
end
68
68
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
+
69
75
# Creates the (non-spatial) mass action jumps from a (non-spatial) DiscreteProblem (and its Reaction System of origin).
70
76
function make_majumps (non_spat_dprob, rs:: ReactionSystem )
71
77
# Computes various required inputs for assembling the mass action jumps.
@@ -74,8 +80,8 @@ function make_majumps(non_spat_dprob, rs::ReactionSystem)
74
80
eqs = equations (js)
75
81
invttype = non_spat_dprob. tspan[1 ] === nothing ? Float64 : typeof (1 / non_spat_dprob. tspan[2 ])
76
82
77
- # Assembles the mass action jumps.
83
+ # Assembles the non-spatial mass action jumps.
78
84
p = (non_spat_dprob. p isa DiffEqBase. NullParameters || non_spat_dprob. p === nothing ) ? Num[] : non_spat_dprob. p
79
85
majpmapper = ModelingToolkit. JumpSysMajParamMapper (js, p; jseqs = eqs, rateconsttype = invttype)
80
86
return ModelingToolkit. assemble_maj (eqs. x[1 ], statetoid, majpmapper)
81
- end
87
+ end
0 commit comments