JULIA=julia --procs 1 --optimize=3 --math-mode=fast --color=yes
PREFIX=jamming-ocean-atmosphere
SCRIPT=jamming-ocean-atmosphere.jl

.PHONY: all
all: $(PREFIX)_no_side_friction.pdf \
	$(PREFIX)_test.pdf

$(PREFIX)_test.pdf: $(SCRIPT)
	$(JULIA) $< --width=5e3  \
		--E=2e7 \
		--nu=0.285 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.4 --mu_d=0.4 \
		--tensile_strength=0500e3 \
		--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=1e4 \
		--atmosphere_vel_fac=30 \
		--total_hours=12. \
		--nruns=1 \
		"$@"

$(PREFIX)_no_side_friction.pdf: $(SCRIPT)
	$(JULIA) $< --width=5e3  \
		--E=2e7 \
		--nu=0.285 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.4 --mu_d=0.4 \
		--tensile_strength=0500e3 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.4 --mu_d=0.4 \
		--mu_s_wall=0.0 --mu_d_wall=0.0 \
		--r_min=6.0e2 --r_max=1.35e3 \
		--rotating=true \
		--ocean_vel_fac=1e4 \
		--atmosphere_vel_fac=30 \
		--total_hours=12. \
		--nruns=1 \
		"$@"

$(PREFIX)_no_friction.pdf: $(SCRIPT)
	$(JULIA) $< --width=5e3  \
		--E=2e7 \
		--nu=0.285 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.4 --mu_d=0.4 \
		--tensile_strength=0500e3 \
		--gamma_n=0. --gamma_t=0. \
		--mu_s=0.0 --mu_d=0.0 \
		--mu_s_wall=0.0 --mu_d_wall=0.0 \
		--r_min=6.0e2 --r_max=1.35e3 \
		--rotating=true \
		--ocean_vel_fac=1e4 \
		--atmosphere_vel_fac=30 \
		--total_hours=12. \
		--nruns=1 \
		"$@"

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