aboutsummaryrefslogtreecommitdiff
path: root/Examples
diff options
context:
space:
mode:
authorIan Hinder <ian.hinder@aei.mpg.de>2012-01-24 07:56:08 -0600
committerIan Hinder <ian.hinder@aei.mpg.de>2012-01-24 07:56:08 -0600
commiteef44a0f698f51a3664974dca8a81c02175d7313 (patch)
tree599099aae409422c4a12bcb50c94c381be6d0ad2 /Examples
parentec1a81c6d9ee8a9a18049c7a01231ac01ed5c241 (diff)
SimpleWaveCaKernel.m: Add new example script for CaKernel
Diffstat (limited to 'Examples')
-rw-r--r--Examples/SimpleWaveCaKernel.m41
1 files changed, 41 insertions, 0 deletions
diff --git a/Examples/SimpleWaveCaKernel.m b/Examples/SimpleWaveCaKernel.m
new file mode 100644
index 0000000..61e070e
--- /dev/null
+++ b/Examples/SimpleWaveCaKernel.m
@@ -0,0 +1,41 @@
+<< "KrancThorn.m";
+
+groups = {{"phi_g", {phi}}, {"pi_g", {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"},
+ Where -> Interior,
+ Equations ->
+ {
+ dot[phi] -> pi,
+ dot[pi] -> Euc[ui,uj] PD[phi,li,lj]
+ }
+};
+
+CreateKrancThornTT[groups, ".",
+ "SimpleWaveCaKernel",
+ Calculations -> {initialSineCalc},
+ PartialDerivatives -> derivatives,
+ UseCaKernel -> True,
+ DeclaredGroups -> {"phi_g","pi_g"}];