aboutsummaryrefslogtreecommitdiff
path: root/Examples
diff options
context:
space:
mode:
authorIan Hinder <ian.hinder@aei.mpg.de>2012-01-27 15:29:15 -0600
committerIan Hinder <ian.hinder@aei.mpg.de>2012-01-27 15:29:15 -0600
commita0a05deb807f386f0a81db0f2c9256bfbfd16947 (patch)
treeb9bc08a6dcee465344d75ae377fbf95331a302f1 /Examples
parentfad7a92c64fd6f401d5f325deeb37952f48358c4 (diff)
AdvectCaKernel.m: Add new example for the advection equation with CaKernel
Diffstat (limited to 'Examples')
-rw-r--r--Examples/AdvectCaKernel.m53
1 files changed, 53 insertions, 0 deletions
diff --git a/Examples/AdvectCaKernel.m b/Examples/AdvectCaKernel.m
new file mode 100644
index 0000000..45a277b
--- /dev/null
+++ b/Examples/AdvectCaKernel.m
@@ -0,0 +1,53 @@
+<< "KrancThorn.m";
+
+groups = {{"phi_g", {phi}}};
+
+derivatives =
+{
+ PDstandard[1] -> DPlus[1]
+};
+
+PD = PDstandard;
+
+f[x_] := Exp[-(x/0.1)^2];
+
+initialGaussianCalc =
+{
+ Name -> "initial_gaussian",
+ Schedule -> {"AT INITIAL"},
+ Equations ->
+ {
+ phi -> f[t+x]
+ }
+};
+
+evolveCalc =
+{
+ Name -> "calc_rhs",
+ Schedule -> {"at EVOL"},
+ Where -> Interior,
+ Equations ->
+ {
+ dot[phi] -> PD[phi,1]
+ }
+};
+
+
+integrateCalc =
+{
+ Name -> "rk1",
+ Schedule -> {"at EVOL after calc_rhs"},
+ Where -> Interior,
+ Equations ->
+ {
+ phi -> phi + dt dot[phi]
+ }
+};
+
+CreateKrancThornTT[groups, ".",
+ "AdvectCaKernel",
+ Calculations -> {initialGaussianCalc(* , evolveCalc, integrateCalc *)},
+ PartialDerivatives -> derivatives,
+ UseCaKernel -> True,
+ EvolutionTimelevels -> 1,
+ DeclaredGroups -> {"phi_g"}];