# -*- coding: utf-8 -*-
# authors: Theodor Droschl, Lukas Maier
# affiliation: Graz University of Technology, Institute of Process and Particle Engineering
# license: GNU Lesser General Public License v3.0

# Justfile for LIGGGHTS 2D Particle-Surface Simulation

# Default target
default: run

# Single simulation runs
run:
    @echo "Running LIGGGHTS simulation with dynamic templates..."
    @cd scripts/simulation && ./run_dipod_simulation_dynamic.sh
    @grep -A 5 "Finished calculating properties of template" scripts/simulation/log.liggghts | tail -6 > post/dipod_properties_mc.txt
    @python3 scripts/analysis/extract_properties.py

# Clean targets
clean:
    @echo "Cleaning output files..."
    @rm -rf post/
    @rm -f *.png
    @rm -f log.liggghts
    @rm -f restart_*.data
    @rm -f dipod_template*.txt
    @rm -f dipod_distribution.liggghts
    @rm -f dipod_templates.liggghts
    @echo "Clean completed."

# Show help
help:
    @echo "LIGGGHTS 2D Particle-Surface Simulation"
    @echo "======================================="
    @echo ""
    @echo "Simulation targets:"
    @echo "  run              - Run single LIGGGHTS simulation with dynamic templates"
    @echo ""
    @echo "Cleaning targets:"
    @echo "  clean            - Remove basic output files"
    @echo ""
    @echo "Utility targets:"
    @echo "  help             - Show this help message"
    @echo ""
    @echo "Requirements:"
    @echo "  - LIGGGHTS installed and in PATH"
    @echo "  - Python 3 with numpy (for validation scripts)"
    @echo ""
    @echo "Example usage:"
    @echo "  just run                 # Single simulation with dynamic templates"
    @echo "  just clean               # Clean output files"
