@@ -152,7 +152,7 @@ def calculate_fractal_dim_for_pos(
152152 return x , count_boxes , popt , pcov
153153
154154
155- def fractal_dim_main ():
155+ def fractal_dim_comparison ():
156156 # Initialize Graph
157157 fig , ax = plt .subplots (figsize = (8 , 8 ))
158158
@@ -161,19 +161,14 @@ def fractal_dim_main():
161161 ymin = np .inf
162162 ymax = - np .inf
163163
164- options = crb .Options (
165- show_progressbar = True , storage_location = "out/fractal_dim_multi"
166- )
167- options .time .t_max = 2000
168- options .domain .domain_size = 2000
169- options .time .dt = 0.3
164+ options = produce_options ()
170165 diffusion_constants = [80 , 5 , 0.5 ]
171166
172167 results = []
173168 for diffusion_constant in diffusion_constants :
174169 options .domain .diffusion_constant = diffusion_constant
175170
176- cells , out_path = load_or_compute (options )
171+ cells , out_path = load_or_compute_last_iter (options )
177172 last_pos = np .array ([c [0 ].mechanics .pos for c in cells .values ()])
178173
179174 x , y , popt , _ = calculate_fractal_dim_for_pos (last_pos , options , out_path )
@@ -245,4 +240,9 @@ def fractal_dim_main():
245240 ax .grid (True , which = "minor" , linestyle = "-" , linewidth = 0.25 , alpha = 0.15 )
246241 ax .set_axisbelow (True )
247242 fig .tight_layout ()
248- fig .savefig (options .storage_location / "fractal-dimension.pdf" )
243+ fig .savefig (options .storage_location / "fractal-dim-box-size-scaling.pdf" )
244+ plt .close (fig )
245+
246+
247+ def fractal_dim_main ():
248+ fractal_dim_comparison ()
0 commit comments