<commit_before>BIN=../../../bin
SCRIPTS=../../../scripts
RE=4700
JOB=high
preprocess: 
	@echo **********Generating a 2D mesh:
	@$(foreach NN,coarse med fine, \
		echo **********Installing directory for $(NN) simulation.; \
		install -d $(RE)-$(JOB)-$(NN); \
		cd $(RE)-$(JOB)-$(NN); \
		ln -s ../backward_facing_step_2d-$(RE)-$(JOB)-$(NN).flml .; \
		echo **********Generating mesh for $(NN) simulation.; \
		gmsh -2 -optimize -o step2d-$(NN).msh ../src/step2d-$(NN).geo; \
		$(SCRIPTS)/gmsh2triangle -2 step2d-$(NN).msh ; \
		cd ..; \
	)

run:
	@echo **********Running the test on different meshes:
	@$(foreach NN,coarse med fine, \
		echo Running $(NN) case; \
		cd $(RE)-$(JOB)-$(NN); \
		echo **********Running simulation for $(NN) mesh.; \
		$(BIN)/fluidity -v2 -l backward_facing_step_2d-$(RE)-$(JOB)-$(NN).flml; \
		cd ..; \
	)

postprocess:
	@echo **********Calling the velocity data extraction and reattachment length calculation python script:
	@$(foreach NN,coarse med fine, \
		cd $(RE)-$(JOB)-$(NN); \
		ln -s ../postprocessor_2d.py .; \
		./postprocessor_2d.py $(RE) $(JOB) $(NN); \
		cd ..; \
	)

post-postprocess:
	./post_postprocessor_2d.py

input: clean preprocess

clean:
	@echo **********Cleaning the output from previous fluidity runs
	@$(foreach NN,coarse med fine, \
	rm -r $(RE)-$(JOB)-$(NN); \
	)<commit_msg>A safer version of the backward-facing step 2D example Makefile.<commit_after>BIN=../../../bin
SCRIPTS=../../../scripts
RE=4700
JOB=high
ROOT=$(PWD)

preprocess: 
	@echo **********Generating a 2D mesh:
	@$(foreach NN,coarse med fine, \
		echo **********Installing directory for $(NN) simulation.; \
		install -d $(RE)-$(JOB)-$(NN); \
		if [ -d "$(RE)-$(JOB)-$(NN)" ]; then \
			cd $(RE)-$(JOB)-$(NN); \
			ln -sf ../backward_facing_step_2d-$(RE)-$(JOB)-$(NN).flml .; \
			echo **********Generating mesh for $(NN) simulation.; \
			gmsh -2 -optimize -o step2d-$(NN).msh ../src/step2d-$(NN).geo; \
			$(SCRIPTS)/gmsh2triangle -2 step2d-$(NN).msh ; \
			cd $(ROOT); \
		fi; \
	)

run:
	@echo **********Running the test on different meshes:
	@$(foreach NN,coarse med fine, \
		if [ -d "$(RE)-$(JOB)-$(NN)" ]; then \
			cd $(RE)-$(JOB)-$(NN); \
			echo **********Running simulation for $(NN) mesh.; \
			$(BIN)/fluidity -v2 -l backward_facing_step_2d-$(RE)-$(JOB)-$(NN).flml; \
			cd $(ROOT); \
		fi; \
	)

postprocess:
	@echo **********Calling the velocity data extraction and reattachment length calculation python script:
	@$(foreach NN,coarse med fine, \
		if [ -d "$(RE)-$(JOB)-$(NN)" ]; then \
			cd $(RE)-$(JOB)-$(NN); \
			ln -s ../postprocessor_2d.py .; \
			./postprocessor_2d.py $(RE) $(JOB) $(NN); \
			cd $(ROOT); \
		fi; \
	)

input: clean preprocess

clean:
	@echo **********Cleaning the output from previous fluidity runs
	@$(foreach NN,coarse med fine, \
		if [ -d "$(RE)-$(JOB)-$(NN)" ]; then \
			echo **********Cleaning folder $(RE)-$(JOB)-$(NN); \
			rm -r $(RE)-$(JOB)-$(NN); fi; \
	)
{'fraction_non_alphanumeric': 0.2634628493524199, 'fraction_numerical': 0.011588275391956374, 'mean_word_length': 3.139633286318759, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3300615', 'n_tokens_mistral': 1234, 'n_tokens_neox': 1140, 'n_words': 273}