aboutsummaryrefslogtreecommitdiff
path: root/Examples
diff options
context:
space:
mode:
authorIan Hinder <ian.hinder@aei.mpg.de>2012-02-14 11:32:59 +0100
committerIan Hinder <ian.hinder@aei.mpg.de>2012-02-14 11:32:59 +0100
commit0d99b18cc556b7c4478b2676e312d1c484e1e244 (patch)
tree75d45f40cd19ec472dfaa463f649cd7690ed0b5a /Examples
parent624c137e1b52787f2be592921460776f790020a4 (diff)
SimpleWaveCaKernel.m: Update to use MoL
We use exact boundary conditions, and a plane Gaussian in the x direction as initial data.
Diffstat (limited to 'Examples')
-rw-r--r--Examples/SimpleWaveCaKernel.m50
1 files changed, 27 insertions, 23 deletions
diff --git a/Examples/SimpleWaveCaKernel.m b/Examples/SimpleWaveCaKernel.m
index 3560710..f4991ea 100644
--- a/Examples/SimpleWaveCaKernel.m
+++ b/Examples/SimpleWaveCaKernel.m
@@ -1,6 +1,6 @@
<< "KrancThorn.m";
-groups = {{"phi_g", {phi}}, {"pi_g", {pi}}};
+groups = {{"phi_g", {phi}}, {"pi_g", {pi}}, {"xCopy_g", {xCopy}}};
derivatives =
{
@@ -10,34 +10,25 @@ derivatives =
PD = PDstandard2nd;
-initialSineCalc =
-{
- Name -> "initial_sine",
- Schedule -> {"AT INITIAL"},
- Equations ->
- {
- phi -> Sin[2 Pi (x - t)],
- pi -> -2 Pi Cos[2 Pi (x - t)]
- }
-};
-
f[x_] := Exp[-(x/0.1)^2];
initialGaussianCalc =
{
Name -> "initial_gaussian",
Schedule -> {"AT INITIAL"},
+ ExecuteOn -> Host,
Equations ->
{
phi -> f[t+x],
- pi -> D[f[t+x],t]
+ pi -> D[f[t+x],t],
+ xCopy -> x
}
};
evolveCalc =
{
Name -> "calc_rhs",
- Schedule -> {"at EVOL"},
+ Schedule -> {"in MoL_CalcRHS"},
Where -> Interior,
Equations ->
{
@@ -46,23 +37,36 @@ evolveCalc =
}
};
+boundCalc =
+{
+ Name -> "calc_bound_rhs",
+ Schedule -> {"in MoL_RHSBoundaries"},
+ Where -> Boundary,
+ Equations ->
+ {
+ dot[phi] -> D[f[t+xCopy],t],
+ dot[pi] -> D[f[t+xCopy],t,t]
+ }
+};
+
-integrateCalc =
+copyCalc =
{
- Name -> "rk1",
- Schedule -> {"at EVOL after calc_rhs"},
- Where -> Interior,
+ Name -> "copy_to_device",
+ Schedule -> {"at INITIAL after initial_gaussian"},
+ Where -> Everywhere,
+ ExecuteOn -> Device,
Equations ->
{
- phi -> phi + dt dot[phi],
- pi -> pi + dt dot[pi]
+ phi -> phi,
+ pi -> pi
}
};
CreateKrancThornTT[groups, ".",
"SimpleWaveCaKernel",
- Calculations -> {initialGaussianCalc, evolveCalc, integrateCalc},
+ Calculations -> {initialGaussianCalc, evolveCalc, copyCalc, boundCalc},
PartialDerivatives -> derivatives,
UseCaKernel -> True,
- EvolutionTimelevels -> 1,
- DeclaredGroups -> {"phi_g","pi_g"}];
+ EvolutionTimelevels -> 2,
+ DeclaredGroups -> {"phi_g","pi_g","xCopy_g"}];