From 3738be6e7380ec56f00048f698850772da5eba50 Mon Sep 17 00:00:00 2001 From: Qianqian Fang Date: Sun, 24 Sep 2023 11:58:28 -0400 Subject: [PATCH] add 2d refractive box test --- test/testmcx.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/testmcx.sh b/test/testmcx.sh index 5885dbde..3a505ddb 100755 --- a/test/testmcx.sh +++ b/test/testmcx.sh @@ -105,6 +105,10 @@ echo "test boundary detector flags ... " temp=`"$MCX" --bench cube60 --bc '______111111' $PARAM -n 1e4 | grep -o -E 'detected.*[0-9.]+ photons' | grep -o -E '[0-9.]+ photon' | grep -o -E '9[7-9][0-9.]+'` if [ -z "$temp" ]; then echo "fail to detect photons in the cube60b benchmark"; fail=$((fail+1)); else echo "ok"; fi +echo "test 2d simulation ... " +temp=`"$MCX" --bench cube60b --json '{"Shapes":[{"Grid":{"Tag":1,"Size":[1,100,100]}},{"Box":{"Tag":2,"O":[0,30,10],"Size":[1,40,40]}}],"Domain":{"Media":[[0,0,1,1],[0.02,0.1,0.9,1.37],[0.02,10,0.9,6.85]]},"Optode":{"Source":{"Pos":[0,50,0],"Dir":[0,0,1]}}}' -d 0 -S 0 $PARAM | grep -o -E 'absorbed:.*6[0-9]\.[0-9]+%'` +if [ -z "$temp" ]; then echo "fail to run 2d simulation"; fail=$((fail+1)); else echo "ok"; fi + echo "test saving photon seeds ... " temp=`"$MCX" --bench cube60 -q 1 -F jnii -S 0 $PARAM | grep -o -E 'after encoding: 13[0-9]\.[0-9]+%'` if [ -z "$temp" ]; then echo "fail to save photon seeds"; fail=$((fail+1)); else echo "ok"; fi