-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from johodges/dev
Fix verification cases to updated framework
- Loading branch information
Showing
17 changed files
with
947 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "verification/tests/firemodels_cad"] | ||
path = verification/tests/firemodels_cad | ||
url = https://github.com/firemodels/cad |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Configure locations | ||
LOG_FILE="$(pwd)/logs/log.txt" | ||
QGISFIGURES_DIR="$(pwd)/../../qgis2fds.figures" | ||
DIFF_DIR="$(pwd)/diff/" | ||
|
||
# Check if figure repo exists | ||
if ! test -d $QGISFIGURES_DIR; then | ||
echo "***Error $QGISFIGURES_DIR directory not found" | ||
exit 1 | ||
fi | ||
|
||
# Delete previous log file if it exists | ||
if test -e $LOG_FILE; then | ||
rm $LOG_FILE | ||
fi | ||
|
||
# Make output directories if they do not exist | ||
if ! test -d $DIFF_DIR; then | ||
mkdir $DIFF_DIR | ||
fi | ||
|
||
cd tests/golden_gate/scripts | ||
bash test_geom.sh | ||
bash test_geom_min.sh | ||
bash test_obst.sh | ||
bash test_obst_min.sh | ||
cd ../../.. | ||
cd tests/cern_meyrin/scripts | ||
bash test_geom.sh | ||
bash test_obst.sh | ||
cd ../../.. | ||
cd tests/fds_case_studies/scripts | ||
bash test_chimney_tops_2.sh | ||
#find . -name "*.png" -o -name "*.fds" -o -name "*.bingeom" | tar -cf ../output.tar.gz -T - | ||
|
||
cd ../../../logs | ||
cat log.txt | ||
if grep "err" log.txt; then | ||
echo "Errors present in log file" | ||
exit 1 | ||
fi | ||
|
||
if grep "Err" log.txt; then | ||
echo "Errors present in log file" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Get case name | ||
ABSOLUTE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/$(basename "${BASH_SOURCE[0]}")" | ||
IFS='/' | ||
read -a strarr <<< $ABSOLUTE_PATH | ||
CASEDIRNAME=${strarr[-3]} | ||
IFS="" | ||
|
||
# Get CHID | ||
cd ../QGIS | ||
CHID=$(basename "$0" ".sh") | ||
|
||
# Configure parameters | ||
BASE_DIR="$(pwd)/../../../../../qgis2fds.figures/tests/$CASEDIRNAME/FDS/" | ||
NEW_DIR="$(pwd)/../FDS/" | ||
DIFF_DIR="$(pwd)/../../../diff/" | ||
LOG_FILE="$(pwd)/../../../logs/log.txt" | ||
TOLERANCE=0.025 | ||
|
||
# Make output directories if they do not exist | ||
if ! test -d $DIFF_DIR; then | ||
mkdir $DIFF_DIR | ||
fi | ||
|
||
# Clean | ||
rm -f $NEW_DIR/$CHID* # does not rm .gitignore | ||
|
||
# Run QGIS | ||
|
||
qgis_process run 'NIST FDS:Export FDS case' \ | ||
--project_path="$CASEDIRNAME.qgs" \ | ||
--distance_units=meters \ | ||
--area_units=m2 \ | ||
--ellipsoid=EPSG:7019 \ | ||
--chid="$CHID" \ | ||
--fds_path='../FDS' \ | ||
--extent_layer='layers/Extent.gpkg' \ | ||
--pixel_size=1 \ | ||
--dem_layer='layers/dem_layer.tif' \ | ||
--tex_pixel_size=0.5 \ | ||
--nmesh=4 \ | ||
--cell_size=0.5 \ | ||
--t_begin=0 \ | ||
--t_end=0 \ | ||
--text_filepath='' \ | ||
--export_obst=false | ||
|
||
# Run FDS | ||
|
||
cd ../FDS | ||
|
||
cat << EOF > "$CHID.ini" | ||
VIEWPOINT5 | ||
0 -4 3 | ||
0.500000 -1.533945 0.092708 1.000000 2 | ||
0.000000 0.000000 90.000000 0 | ||
0.500000 0.452000 0.092708 | ||
-33.000000 32.000000 | ||
1.000000 0.000000 0.000000 0.000000 | ||
0.000000 1.000000 0.000000 0.000000 | ||
0.000000 0.000000 1.000000 0.000000 | ||
0.000000 0.000000 0.000000 1.000000 | ||
0 0 0 0 0 0 0 | ||
-62.159824 -56.685352 429.114441 63.090176 56.540646 463.304108 | ||
iso | ||
EOF | ||
|
||
cat << EOF > "$CHID.ssf" | ||
SETVIEWPOINT | ||
ZMAX | ||
RENDERDOUBLEONCE | ||
SETVIEWPOINT | ||
ZMIN | ||
RENDERDOUBLEONCE | ||
SETVIEWPOINT | ||
YMAX | ||
RENDERDOUBLEONCE | ||
SETVIEWPOINT | ||
YMIN | ||
RENDERDOUBLEONCE | ||
SETVIEWPOINT | ||
XMAX | ||
RENDERDOUBLEONCE | ||
SETVIEWPOINT | ||
XMIN | ||
RENDERDOUBLEONCE | ||
SETVIEWPOINT | ||
iso | ||
RENDERDOUBLEONCE | ||
EOF | ||
|
||
fds "$CHID.fds" | ||
smokeview -runscript "$CHID" | ||
|
||
# Compare images with baseline FIXME | ||
bash ../../../scripts/compare_images.sh $BASE_DIR $NEW_DIR $DIFF_DIR $CHID 0.025 2>&1 | tee -a $LOG_FILE | ||
|
Oops, something went wrong.