JULIA=julia --procs 1 --optimize=3 --math-mode=fast --color=yes

.PHONY: all
all: \
	strait_mu0.0.run \
	strait_mu0.2.run \
	strait_mu0.4.run \
	strait_mu0.6.run \
	strait_mu0.8.run \
	strait_mu1.0.run \
	strait_bigR_mu0.0.run \
	strait_bigR_mu0.2.run \
	strait_bigR_mu0.4.run \
	strait_bigR_mu0.6.run \
	strait_bigR_mu0.8.run \
	strait_bigR_mu1.0.run \
	strait_intR_mu0.0.run \
	strait_intR_mu0.2.run \
	strait_intR_mu0.4.run \
	strait_intR_mu0.6.run \
	strait_intR_mu0.8.run \
	strait_intR_mu1.0.run


.PHONY: cohesion-ensembles
cohesion-ensembles: \
	strait_mu0.0_ensemble_sigma_t0000kPa.pdf \
	strait_mu0.0_ensemble_sigma_t0001kPa.pdf \
	strait_mu0.0_ensemble_sigma_t0010kPa.pdf \
	strait_mu0.0_ensemble_sigma_t0100kPa.pdf \
	strait_mu0.0_ensemble_sigma_t1000kPa.pdf

.PHONY: one
one: strait_mu0.4.run

.PHONY: one-ensemble
one-ensemble: strait_intR_mu0.4_ensemble.pdf

.PHONY: all-ensembles
all-ensembles: \
	strait_intR_mu0.0_ensemble.pdf \
	strait_intR_mu0.2_ensemble.pdf \
	strait_intR_mu0.4_ensemble.pdf

.PHONY: gsd-mean-ensembles
gsd-mean-ensembles: \
	strait_Rsmallest_ensemble.pdf \
	strait_Rsmaller_ensemble.pdf \
	strait_Rsmall_ensemble.pdf \
	strait_Rint_ensemble.pdf \
	strait_Rlarge_ensemble.pdf \
	strait_Rlarger_ensemble.pdf \
	strait_Rlargest_ensemble.pdf

strait_Rsmallest_ensemble.pdf: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.4 --mu_d=0.4 \
		--r_min=6.0e2 --r_max=1.35e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		--nruns=16 \
		"$@"

strait_Rsmaller_ensemble.pdf: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.4 --mu_d=0.4 \
		--r_min=6.5e2 --r_max=1.40e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		--nruns=16 \
		"$@"

strait_Rsmall_ensemble.pdf: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.4 --mu_d=0.4 \
		--r_min=7.0e2 --r_max=1.45e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		--nruns=16 \
		"$@"

strait_Rint_ensemble.pdf: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.4 --mu_d=0.4 \
		--r_min=7.5e2 --r_max=1.50e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		--nruns=16 \
		"$@"

strait_Rlarge_ensemble.pdf: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.4 --mu_d=0.4 \
		--r_min=8.0e2 --r_max=1.55e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		--nruns=16 \
		"$@"

strait_Rlarger_ensemble.pdf: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.4 --mu_d=0.4 \
		--r_min=8.5e2 --r_max=1.60e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		--nruns=16 \
		"$@"

strait_Rlargest_ensemble.pdf: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.4 --mu_d=0.4 \
		--r_min=9.0e2 --r_max=1.65e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		--nruns=16 \
		"$@"

strait_intR_mu0.0_ensemble.pdf: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.0 --mu_d=0.0 \
		--r_min=7.5e2 --r_max=1.5e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		--nruns=8 \
		"$@"

strait_intR_mu0.2_ensemble.pdf: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.2 --mu_d=0.2 \
		--r_min=7.5e2 --r_max=1.5e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		--nruns=8 \
		"$@"

strait_intR_mu0.4_ensemble.pdf: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.4 --mu_d=0.4 \
		--r_min=7.5e2 --r_max=1.5e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		--nruns=8 \
		"$@"

strait_intR_mu0.6_ensemble.pdf: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.6 --mu_d=0.6 \
		--r_min=7.5e2 --r_max=1.5e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		--nruns=8 \
		"$@"

strait_mu0.0.run: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.0 --mu_d=0.0 \
		--r_min=5e2 --r_max=1e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		"$@"
	touch $@

strait_mu0.2.run: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.2 --mu_d=0.2 \
		--r_min=5e2 --r_max=1e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		"$@"
	touch $@

strait_mu0.4.run: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.4 --mu_d=0.4 \
		--r_min=5e2 --r_max=1e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		"$@"
	touch $@

strait_mu0.6.run: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.6 --mu_d=0.6 \
		--r_min=5e2 --r_max=1e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		"$@"
	touch $@

strait_mu0.8.run: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.8 --mu_d=0.8 \
		--r_min=5e2 --r_max=1e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		"$@"
	touch $@

strait_mu1.0.run: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=1.0 --mu_d=1.0 \
		--r_min=5e2 --r_max=1e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		"$@"
	touch $@

strait_mu1.5.run: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=1.5 --mu_d=1.5 \
		--r_min=5e2 --r_max=1e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		"$@"
	touch $@

strait_mu2.0.run: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=2.0 --mu_d=2.0 \
		--r_min=5e2 --r_max=1e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		"$@"
	touch $@

strait_bigR_mu0.0.run: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.0 --mu_d=0.0 \
		--r_min=1e3 --r_max=2e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		"$@"
	touch $@

strait_bigR_mu0.2.run: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.2 --mu_d=0.2 \
		--r_min=1e3 --r_max=2e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		"$@"
	touch $@

strait_bigR_mu0.4.run: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.4 --mu_d=0.4 \
		--r_min=1e3 --r_max=2e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		"$@"
	touch $@

strait_bigR_mu0.6.run: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.6 --mu_d=0.6 \
		--r_min=1e3 --r_max=2e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		"$@"
	touch $@

strait_bigR_mu0.8.run: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.8 --mu_d=0.8 \
		--r_min=1e3 --r_max=2e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		"$@"
	touch $@

strait_bigR_mu1.0.run: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=1.0 --mu_d=1.0 \
		--r_min=1e3 --r_max=2e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		"$@"
	touch $@

strait_intR_mu0.0.run: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.0 --mu_d=0.0 \
		--r_min=7.5e2 --r_max=1.5e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		"$@"
	touch $@

strait_intR_mu0.2.run: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.2 --mu_d=0.2 \
		--r_min=7.5e2 --r_max=1.5e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		"$@"
	touch $@

strait_intR_mu0.4.run: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.4 --mu_d=0.4 \
		--r_min=7.5e2 --r_max=1.5e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		"$@"
	touch $@

strait_intR_mu0.6.run: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.6 --mu_d=0.6 \
		--r_min=7.5e2 --r_max=1.5e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		"$@"
	touch $@

strait_intR_mu0.8.run: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.8 --mu_d=0.8 \
		--r_min=7.5e2 --r_max=1.5e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		"$@"
	touch $@

strait_intR_mu1.0.run: jamming.jl
	$(JULIA) $< --width=5e3  \
		--k_n=1e7 --k_t=1e7 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=1.0 --mu_d=1.0 \
		--r_min=7.5e2 --r_max=1.5e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		"$@"
	touch $@


strait_mu0.0_ensemble_sigma_t0000kPa.pdf: jamming.jl
	$(JULIA) $< --width=5e3  \
		--E=2e7 \
		--nu=0.285 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.0 --mu_d=0.0 \
		--r_min=5e2 --r_max=1e3 \
		--tensile_strength=0. \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		--nruns=8 \
		"$@"

strait_mu0.0_ensemble_sigma_t0001kPa.pdf: jamming.jl
	$(JULIA) $< --width=5e3  \
		--E=2e7 \
		--nu=0.285 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.0 --mu_d=0.0 \
		--r_min=5e2 --r_max=1e3 \
		--tensile_strength=10e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		--nruns=8 \
		"$@"

strait_mu0.0_ensemble_sigma_t0010kPa.pdf: jamming.jl
	$(JULIA) $< --width=5e3  \
		--E=2e7 \
		--nu=0.285 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.0 --mu_d=0.0 \
		--r_min=5e2 --r_max=1e3 \
		--tensile_strength=10e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		--nruns=8 \
		"$@"

strait_mu0.0_ensemble_sigma_t0100kPa.pdf: jamming.jl
	$(JULIA) $< --width=5e3  \
		--E=2e7 \
		--nu=0.285 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.0 --mu_d=0.0 \
		--r_min=5e2 --r_max=1e3 \
		--tensile_strength=100e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		--nruns=8 \
		"$@"

strait_mu0.0_ensemble_sigma_t1000kPa.pdf: jamming.jl
	$(JULIA) $< --width=5e3  \
		--E=2e7 \
		--nu=0.285 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.0 --mu_d=0.0 \
		--r_min=5e2 --r_max=1e3 \
		--tensile_strength=1000e3 \
		--rotating=true \
		--ocean_vel_fac=4e4 \
		--total_hours=12. \
		--nruns=8 \
		"$@"


.PHONY: clean
clean:
	$(RM) strait_*.run
	for f in strait_*.vts; do $(RM) $$f; done
	for f in strait_*.vtp; do $(RM) $$f; done
	for f in strait_*.vtu; do $(RM) $$f; done
	$(RM) strait_*.pdf
	$(RM) strait_*.txt
