Skip to content

Commit

Permalink
Remove the hopper and improve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
blaisb committed Dec 13, 2024
1 parent f6e2202 commit 4bf27b3
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 2,341 deletions.
27 changes: 23 additions & 4 deletions contrib/validation/validate_lethe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,17 @@
# - Reference results must be available in the specified directory.
#
# Notes:
# - This program but be launched from the main folder of lethe
# - The program needs to be launched from the main folder of lethe
#
# -----------------------------------------------------------------------------


# Function to display the help message
show_help() {
echo "Usage: $0 [options]"
echo
echo "Options:"
echo " -h, --help Display this help message"
echo " -o, --output Specify the output directory for validation results"
echo " -v, --verbose Enable verbose mode for detailed output"
echo
echo "Description:"
echo "This script automates the validation of the Computational Fluid Dynamics (CFD)"
Expand Down Expand Up @@ -106,7 +104,8 @@ while [[ $# -gt 0 ]]; do
output_path="$2"
shift 2 # Skip the flag and its argument
else
error_exit "Missing argument for -o|--output."
echo "Error: Missing argument for -o|--output."
exit 1
fi
;;
*)
Expand All @@ -128,6 +127,26 @@ lethe_path=$(pwd)
echo "The current path is: $lethe_path"
echo "Please ensure that the current path is the root folder of lethe"

# Check if magick is available. Otherwise reports will not be generated.
# If magick is not available, the script will exit with an error status.
# Check if the application exists
if ! command -v "magick" &> /dev/null; then
echo "Error: magick is not installed or not in the PATH." >&2
exit 1
fi

# Check if git is available. Otherwise it is not possible to have a git hash
if ! command -v "git" &> /dev/null; then
error exit echo "Error: git is not installed or not in the PATH." >&2
exit 1
fi

# Check if python3 is available. Otherwise it is not possible to post-process the simulations
if ! command -v "python3" &> /dev/null; then
error exit echo "Error: python3 is not installed or not in the PATH." >&2
exit 1
fi

# Output file
hash_file="$output_path/current_git_hash.txt"

Expand Down
6 changes: 3 additions & 3 deletions contrib/validation/validation_cases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

examples/incompressible-flow/2d-lid-driven-cavity 1
examples/incompressible-flow/2d-taylor-couette 1
examples/incompressible-flow/3d-taylor-green-vortex 16
examples/multiphysics/rising-bubble 16
examples/dem/3d-rectangular-hopper 16
#examples/incompressible-flow/3d-taylor-green-vortex 16
#examples/multiphysics/rising-bubble 16
#examples/dem/3d-rectangular-hopper 16


8 changes: 4 additions & 4 deletions examples/dem/3d-rectangular-hopper/hopper_post_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
'''Simulation properties'''

#Take case path as argument and store it
parser = argparse.ArgumentParser(description='Arguments for the validation of the 2d lid-driven cavity')
parser.add_argument("-v", "--validate", action="store_true", help="Launches the script in validation mode. This will log the content of the graph and prevent the display of figures", default=False)
parser.add_argument("-f", "--folder", type=str, help="Folder path", required=True)
parser.add_argument("--prm", type=str, help="Prm file name", required=True)
parser = argparse.ArgumentParser(description='Arguments for the post-processing of the rectangular hopper DEM case')
parser.add_argument("--validate", action="store_true", help="Launches the script in validation mode. This will log the content of the graph and prevent the display of figures", default=False)
parser.add_argument("-f", "--folder", type=str, help="Root folder of the simulation. This folder is the folder which contains the .prm file.", required=True)
parser.add_argument("--prm", type=str, help="Name of the prm file (including the extension .prm) but without the path to the prm file", required=True)
args, leftovers=parser.parse_known_args()


Expand Down
Loading

0 comments on commit 4bf27b3

Please sign in to comment.