diff options
author | Ian Hinder <ian.hinder@aei.mpg.de> | 2010-09-23 17:28:46 +0200 |
---|---|---|
committer | Ian Hinder <ian.hinder@aei.mpg.de> | 2010-09-23 17:28:46 +0200 |
commit | 7d98be4ac485a53a03e9a2170f551e5905610fe4 (patch) | |
tree | 8a4eb7199fa089b534451a1d0ca757651e54a8e4 /Examples/SimpleWave.m | |
parent | b6ba7a8f6df740f658a05e25bec698d3fcee21c1 (diff) |
Examples: Add SimpleWave example
Diffstat (limited to 'Examples/SimpleWave.m')
-rw-r--r-- | Examples/SimpleWave.m | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Examples/SimpleWave.m b/Examples/SimpleWave.m new file mode 100644 index 0000000..1fbee69 --- /dev/null +++ b/Examples/SimpleWave.m @@ -0,0 +1,39 @@ +<< "KrancThorn.m"; + +groups = {{"evolved_group", {phi, pi}}}; + +derivatives = +{ + PDstandard2nd[i_] -> StandardCenteredDifferenceOperator[1,1,i], + PDstandard2nd[i_, i_] -> StandardCenteredDifferenceOperator[2,1,i] +}; + +PD = PDstandard2nd; + +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"}, + Equations -> + { + dot[phi] -> pi, + dot[pi] -> Euc[ui,uj] PD[phi,li,lj] + } +}; + +CreateKrancThornTT[groups, ".", + "SimpleWave", + Calculations -> {initialSineCalc, evolveCalc}, + PartialDerivatives -> derivatives, + DeclaredGroups -> {"evolved_group"}]; |