From 18951cd3b318e6fe063ceb9db0dc9587a750e8fd Mon Sep 17 00:00:00 2001 From: Ian Hinder Date: Thu, 5 Sep 2013 20:31:21 +0200 Subject: Kranc.mt: Add some variables useful in several tests --- Tests/Kranc.mt | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'Tests/Kranc.mt') diff --git a/Tests/Kranc.mt b/Tests/Kranc.mt index dc324c1..ffba131 100644 --- a/Tests/Kranc.mt +++ b/Tests/Kranc.mt @@ -1,6 +1,36 @@ (* Mathematica Test File *) +$derivatives = { + PDstandard2nd[i_] -> StandardCenteredDifferenceOperator[1,1,i], + PDstandard2nd[i_, i_] -> StandardCenteredDifferenceOperator[2,1,i]}; + +PD = PDstandard2nd; + +$groups = {{"evolved_group", {phi, pi}}}; + +$initialSineCalc = { + Name -> "initial_sine", + Schedule -> {"AT initial"}, + Equations -> + { + phi -> Sin[2 Pi (x - t)], + pi -> -2 Pi Cos[2 Pi (x - t)] + }}; + +$evolveCalc = { + Name -> "calc_rhs", + Schedule -> {"IN MoL_CalcRHS"}, + Where -> Interior, + Equations -> + { + dot[phi] -> pi, + dot[pi] -> Euc[ui,uj] PD[phi,li,lj] + }}; + + + + (****************************************************************) (* CreateThorn *) (****************************************************************) @@ -21,12 +51,14 @@ Test[ statements if they don't contain grid functions, as this doesn't work with vectorisation. *) +(* The PD symbol is treated in a nonoptimal way by Kranc, and this + causes problems for the tests. This should be cleaned up. *) + Test[ Module[ {derivatives = { PDstandard2nd[i_] -> StandardCenteredDifferenceOperator[1,1,i], PDstandard2nd[i_, i_] -> StandardCenteredDifferenceOperator[2,1,i]}, - PD = PDstandard2nd, groups = {{"evolved_group", {phi, pi}}}, initialSineCalc = { Name -> "initial_sine", @@ -45,6 +77,8 @@ Test[ dot[phi] -> IfThen[alpha>0, pi, 2 pi], dot[pi] -> IfThen[alpha>0, Euc[ui,uj] PD[phi,li,lj], 2 Euc[ui,uj] PD[phi,li,lj]] }}}, + + (* PD = PDstandard2nd *) CreateKrancThornTT[ groups, "TestThorns", -- cgit v1.2.3