Skip to content

Commit

Permalink
Kranc.mt: Add some variables useful in several tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhinder committed Sep 5, 2013
1 parent 95d4c66 commit 18951cd
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion 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 *)
(****************************************************************)
Expand All @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit 18951cd

Please sign in to comment.