Skip to content

Commit

Permalink
raw TIME_PATH test
Browse files Browse the repository at this point in the history
  • Loading branch information
gtheler committed Sep 4, 2024
1 parent db41f5a commit b704384
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ TESTS = \
tests/function_vectors.sh \
tests/hello_mpi.sh \
tests/integral.sh \
tests/lag.sh \
tests/laplace2d.sh \
tests/lebesgue.sh \
tests/los-alamos.sh \
Expand Down
5 changes: 4 additions & 1 deletion tests/lag.fee
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ r = heaviside(t-a)-heaviside(t-b)
# of characteristic time tau
y = lag(r, tau)

PRINT t r y
# PRINT t r y
IF done
PRINT %.2f y
ENDIF

# exercise: investigate how the result of the lag
# depends on the time step
25 changes: 25 additions & 0 deletions tests/lag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh
for i in . tests; do
if [ -e ${i}/functions.sh ]; then
. ${i}/functions.sh
fi
done
if [ -z "${functions_found}" ]; then
echo "could not find functions.sh"
exit 1;
fi

answer lag.fee "0.16"
exitifwrong $?

answer lag_compact.fee "0.16"
exitifwrong $?

# check TIME_PATH
echo -n "time_path_raw.fee ... "

if [ "x$(${feenox} ${dir}/time_path_sundials.fee | wc -l)" != "x5" ]; then
echo "failed"
return 1
fi
echo "ok"
6 changes: 5 additions & 1 deletion tests/lag_compact.fee
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@
# lines as follows (although the SPOT rule is broken)
end_time = 5
dt = 1/20
PRINT t heaviside(t-1)-heaviside(t-3) lag(heaviside(t-1)-heaviside(t-3),1.234)
# PRNT t heaviside(t-1)-heaviside(t-3) lag(heaviside(t-1)-heaviside(t-3),1.234)
y = lag(heaviside(t-1)-heaviside(t-3),1.234)
IF done
PRINT %.2f y
ENDIF

0 comments on commit b704384

Please sign in to comment.