aboutsummaryrefslogtreecommitdiff
path: root/Examples/EulerSR.m
diff options
context:
space:
mode:
authorIan Hinder <ian.hinder@aei.mpg.de>2011-12-15 17:29:28 +0100
committerIan Hinder <ian.hinder@aei.mpg.de>2011-12-15 17:29:28 +0100
commit270cbb4cb02d939508d041033d3db15e41255206 (patch)
treecd3389c8f5817e25dcb160a9fe175fc35b75841a /Examples/EulerSR.m
parent2ccf8615b79fa4f8992ba056978339dba547166d (diff)
EulerSR.m: Restore fixed-iteration-count primitive calculation
The implementation based on IfThen has several problems, and for some reason was only being run once.
Diffstat (limited to 'Examples/EulerSR.m')
-rw-r--r--Examples/EulerSR.m10
1 files changed, 8 insertions, 2 deletions
diff --git a/Examples/EulerSR.m b/Examples/EulerSR.m
index e477de3..e32cd3e 100644
--- a/Examples/EulerSR.m
+++ b/Examples/EulerSR.m
@@ -113,8 +113,13 @@ eulerCons =
f -> 10,
- Sequence@@Map[#[[1]] -> IfThen[f > 10.^-12, #[[2]], #[[1]]] &,
+ (* This should be some sort of while loop so you run until f <
+ 1e-12. A naive implementation in terms of IfThen has subtle
+ problems. Ideally, Kranc would support the iterative solution
+ of equations directly. Instead, we always run 5 iterations and
+ hope that this is enough. *)
+ Sequence@@Join@@Table[
{Z -> tau + Den + pBar,
Ssq -> S[li] S[lj] Euc[ui,uj],
vsq -> Ssq/Z^2,
@@ -126,7 +131,8 @@ eulerCons =
f -> pEOS - pBar,
cs -> Sqrt[gamma (gamma-1) epsi/h],
df -> vsq cs^2 - 1,
- pBar -> pBar - f/df}],
+ pBar -> pBar - f/df},
+ {i, 1, 5}],
(* end of loop *)