All: clean mesh prepare run postprocess

clean:
	rm -rf proc* log 1 output constant/polyMesh constant/*/polyMesh log1 time v log2 voltage_profile.eps postProcessing potential_time.eps
	rm -fr system/blockMeshDict system/createPatchDict system/decomposeParDict system/snappyHexMeshDict system/topoSetDict
	rm -fr system/*/topoSetDict

mesh:
	./mesh.sh

prepare:
	mpirun -np 2 ecfFoam -setConcentration 0.236 -parallel > log1
	mpirun -np 2 ecfFoam -init -parallel > log2
	cat log2 | grep "Voltage"

run:
	mpirun -np 2 ecfFoam -parallel > log

postprocess:
	reconstructPar -time 1
	postProcess -func sampleDict
	gnuplot voltage_profile.gnu
	gnuplot potential_time.gnu
