aboutsummaryrefslogtreecommitdiff
path: root/Examples
diff options
context:
space:
mode:
authorIan Hinder <ian.hinder@aei.mpg.de>2012-01-31 14:16:01 -0600
committerIan Hinder <ian.hinder@aei.mpg.de>2012-01-31 14:21:50 -0600
commit40d9f7919784643c3a1e3ccb3f6883b1eb81e121 (patch)
treeceaa4eb01e6e8473f04a9ef482358e64bfc0249e /Examples
parentff5d640e21d122a74ac2d9da49fcc5e5a6b3e034 (diff)
Add SimpleWaveOpenCL.m
Diffstat (limited to 'Examples')
-rw-r--r--Examples/SimpleWaveOpenCL.m41
1 files changed, 41 insertions, 0 deletions
diff --git a/Examples/SimpleWaveOpenCL.m b/Examples/SimpleWaveOpenCL.m
new file mode 100644
index 0000000..cb013c7
--- /dev/null
+++ b/Examples/SimpleWaveOpenCL.m
@@ -0,0 +1,41 @@
+<< "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"},
+ Where -> Interior,
+ Equations ->
+ {
+ dot[phi] -> pi,
+ dot[pi] -> Euc[ui,uj] PD[phi,li,lj]
+ }
+};
+
+CreateKrancThornTT[groups, ".",
+ "SimpleWaveOpenCL",
+ Calculations -> {initialSineCalc, evolveCalc},
+ PartialDerivatives -> derivatives,
+ DeclaredGroups -> {"evolved_group"},
+ UseOpenCL -> True];