Skip to content

Commit 0a2192d

Browse files
committed
reduce test tuntimes
1 parent 445af77 commit 0a2192d

File tree

6 files changed

+133
-180
lines changed

6 files changed

+133
-180
lines changed

test/performance_benchmarks/lattice_reaction_systems_ODE_performance.jl

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ include("../spatial_test_networks.jl")
2020
# Small grid, small, non-stiff, system.
2121
let
2222
lrs = LatticeReactionSystem(SIR_system, SIR_srs_2, small_2d_graph_grid)
23-
u0 = [:S => 990.0, :I => 20.0 * rand_v_vals(lattice(lrs)), :R => 0.0]
23+
u0 = [:S => 990.0, :I => 20.0 * rand_v_vals(lrs), :R => 0.0]
2424
pV = SIR_p
2525
pE = [:dS => 0.01, :dI => 0.01, :dR => 0.01]
2626
oprob = ODEProblem(lrs, u0, (0.0, 500.0), [pV; pE]; jac = false)
@@ -35,7 +35,7 @@ end
3535
# Large grid, small, non-stiff, system.
3636
let
3737
lrs = LatticeReactionSystem(SIR_system, SIR_srs_2, large_2d_grid)
38-
u0 = [:S => 990.0, :I => 20.0 * rand_v_vals(lattice(lrs)), :R => 0.0]
38+
u0 = [:S => 990.0, :I => 20.0 * rand_v_vals(lrs), :R => 0.0]
3939
pV = SIR_p
4040
pE = [:dS => 0.01, :dI => 0.01, :dR => 0.01]
4141
oprob = ODEProblem(lrs, u0, (0.0, 500.0), [pV; pE]; jac = false)
@@ -50,7 +50,7 @@ end
5050
# Small grid, small, stiff, system.
5151
let
5252
lrs = LatticeReactionSystem(brusselator_system, brusselator_srs_1, small_2d_graph_grid)
53-
u0 = [:X => rand_v_vals(lattice(lrs), 10), :Y => rand_v_vals(lattice(lrs), 10)]
53+
u0 = [:X => rand_v_vals(lrs, 10), :Y => rand_v_vals(lrs, 10)]
5454
pV = brusselator_p
5555
pE = [:dX => 0.2]
5656
oprob = ODEProblem(lrs, u0, (0.0, 100.0), [pV; pE])
@@ -65,7 +65,7 @@ end
6565
# Large grid, small, stiff, system.
6666
let
6767
lrs = LatticeReactionSystem(brusselator_system, brusselator_srs_1, large_2d_grid)
68-
u0 = [:X => rand_v_vals(lattice(lrs), 10), :Y => rand_v_vals(lattice(lrs), 10)]
68+
u0 = [:X => rand_v_vals(lrs, 10), :Y => rand_v_vals(lrs, 10)]
6969
pV = brusselator_p
7070
pE = [:dX => 0.2]
7171
oprob = ODEProblem(lrs, u0, (0.0, 100.0), [pV; pE])
@@ -82,10 +82,10 @@ let
8282
lrs = LatticeReactionSystem(CuH_Amination_system, CuH_Amination_srs_2,
8383
small_2d_graph_grid)
8484
u0 = [
85-
:CuoAc => 0.005 .+ rand_v_vals(lattice(lrs), 0.005),
86-
:Ligand => 0.005 .+ rand_v_vals(lattice(lrs), 0.005),
85+
:CuoAc => 0.005 .+ rand_v_vals(lrs, 0.005),
86+
:Ligand => 0.005 .+ rand_v_vals(lrs, 0.005),
8787
:CuoAcLigand => 0.0,
88-
:Silane => 0.5 .+ rand_v_vals(lattice(lrs), 0.5),
88+
:Silane => 0.5 .+ rand_v_vals(lrs, 0.5),
8989
:CuHLigand => 0.0,
9090
:SilaneOAc => 0.0,
9191
:Styrene => 0.16,
@@ -113,10 +113,10 @@ let
113113
lrs = LatticeReactionSystem(CuH_Amination_system, CuH_Amination_srs_2,
114114
large_2d_grid)
115115
u0 = [
116-
:CuoAc => 0.005 .+ rand_v_vals(lattice(lrs), 0.005),
117-
:Ligand => 0.005 .+ rand_v_vals(lattice(lrs), 0.005),
116+
:CuoAc => 0.005 .+ rand_v_vals(lrs, 0.005),
117+
:Ligand => 0.005 .+ rand_v_vals(lrs, 0.005),
118118
:CuoAcLigand => 0.0,
119-
:Silane => 0.5 .+ rand_v_vals(lattice(lrs), 0.5),
119+
:Silane => 0.5 .+ rand_v_vals(lrs, 0.5),
120120
:CuHLigand => 0.0,
121121
:SilaneOAc => 0.0,
122122
:Styrene => 0.16,
@@ -143,14 +143,14 @@ end
143143
let
144144
lrs = LatticeReactionSystem(sigmaB_system, sigmaB_srs_2, small_2d_graph_grid)
145145
u0 = [
146-
:w => 0.5 .+ rand_v_vals(lattice(lrs), 0.5),
147-
:w2 => 0.5 .+ rand_v_vals(lattice(lrs), 0.5),
148-
:w2v => 0.5 .+ rand_v_vals(lattice(lrs), 0.5),
149-
:v => 0.5 .+ rand_v_vals(lattice(lrs), 0.5),
150-
:w2v2 => 0.5 .+ rand_v_vals(lattice(lrs), 0.5),
151-
:vP => 0.5 .+ rand_v_vals(lattice(lrs), 0.5),
152-
:σB => 0.5 .+ rand_v_vals(lattice(lrs), 0.5),
153-
:w2σB => 0.5 .+ rand_v_vals(lattice(lrs), 0.5),
146+
:w => 0.5 .+ rand_v_vals(lrs, 0.5),
147+
:w2 => 0.5 .+ rand_v_vals(lrs, 0.5),
148+
:w2v => 0.5 .+ rand_v_vals(lrs, 0.5),
149+
:v => 0.5 .+ rand_v_vals(lrs, 0.5),
150+
:w2v2 => 0.5 .+ rand_v_vals(lrs, 0.5),
151+
:vP => 0.5 .+ rand_v_vals(lrs, 0.5),
152+
:σB => 0.5 .+ rand_v_vals(lrs, 0.5),
153+
:w2σB => 0.5 .+ rand_v_vals(lrs, 0.5),
154154
:vPp => 0.0,
155155
:phos => 0.4,
156156
]
@@ -169,14 +169,14 @@ end
169169
let
170170
lrs = LatticeReactionSystem(sigmaB_system, sigmaB_srs_2, large_2d_grid)
171171
u0 = [
172-
:w => 0.5 .+ rand_v_vals(lattice(lrs), 0.5),
173-
:w2 => 0.5 .+ rand_v_vals(lattice(lrs), 0.5),
174-
:w2v => 0.5 .+ rand_v_vals(lattice(lrs), 0.5),
175-
:v => 0.5 .+ rand_v_vals(lattice(lrs), 0.5),
176-
:w2v2 => 0.5 .+ rand_v_vals(lattice(lrs), 0.5),
177-
:vP => 0.5 .+ rand_v_vals(lattice(lrs), 0.5),
178-
:σB => 0.5 .+ rand_v_vals(lattice(lrs), 0.5),
179-
:w2σB => 0.5 .+ rand_v_vals(lattice(lrs), 0.5),
172+
:w => 0.5 .+ rand_v_vals(lrs, 0.5),
173+
:w2 => 0.5 .+ rand_v_vals(lrs, 0.5),
174+
:w2v => 0.5 .+ rand_v_vals(lrs, 0.5),
175+
:v => 0.5 .+ rand_v_vals(lrs, 0.5),
176+
:w2v2 => 0.5 .+ rand_v_vals(lrs, 0.5),
177+
:vP => 0.5 .+ rand_v_vals(lrs, 0.5),
178+
:σB => 0.5 .+ rand_v_vals(lrs, 0.5),
179+
:w2σB => 0.5 .+ rand_v_vals(lrs, 0.5),
180180
:vPp => 0.0,
181181
:phos => 0.4,
182182
]

test/spatial_modelling/lattice_reaction_systems.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ let
331331
end
332332
n = 5
333333
tr = @transport_reaction D X
334-
tspan = (0.0, 10000.0)
334+
tspan = (0.0, 1000.0)
335335
u0 = [:X => 1.0]
336336

337337
# Checks the 1d case.

0 commit comments

Comments
 (0)