#!/bin/bash

# Define the files and directories to be preserved
preserve=("0" "constant" "system" "Allrun" "Allclean" "blunt_body.msh" "spiked_blunt_body.msh" "postProcessing" "Residuals.png" "Residuals.txt" "Allrun_parallel" "pyfoam")

# Loop through all files and directories in the current directory
for file in *; do
    # Check if the file/directory is not in the list of preserved items
    if ! [[ " ${preserve[@]} " =~ " ${file} " ]]; then
        # Delete the file/directory
        rm -rf "$file"
    fi
done

