aboutsummaryrefslogtreecommitdiff
path: root/m/WaveToy.m
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2007-11-30 16:00:52 -0600
committerErik Schnetter <schnetter@cct.lsu.edu>2007-11-30 16:00:52 -0600
commit6dd7c9aa7a6bee46307ad81b1227005e6e808e0a (patch)
tree6ea5764cc953da42ecd40ac0c419ffc2548b64d6 /m/WaveToy.m
parentd6f2e631dd77da91ef29f9d1ea88642fa9e81636 (diff)
Add Kranc generated WaveToy
Diffstat (limited to 'm/WaveToy.m')
-rw-r--r--m/WaveToy.m97
1 files changed, 97 insertions, 0 deletions
diff --git a/m/WaveToy.m b/m/WaveToy.m
new file mode 100644
index 0000000..fbaa027
--- /dev/null
+++ b/m/WaveToy.m
@@ -0,0 +1,97 @@
+$Path = Join[$Path, {"~/Calpha/Kranc-devel/Tools/CodeGen",
+ "~/Calpha/Kranc-devel/Tools/MathematicaMisc"}];
+
+Get["KrancThorn`"];
+
+SetEnhancedTimes[False];
+SetSourceLanguage["C"];
+
+(******************************************************************************)
+(* Derivatives *)
+(******************************************************************************)
+
+derivOrder = 4;
+
+derivatives =
+{
+ PDstandardNth[i_] -> StandardCenteredDifferenceOperator[1,derivOrder/2,i],
+ PDstandardNth[i_, i_] -> StandardCenteredDifferenceOperator[2,derivOrder/2,i],
+ PDstandardNth[i_, j_] -> StandardCenteredDifferenceOperator[1,derivOrder/2,i]
+ StandardCenteredDifferenceOperator[1,derivOrder/2,j]
+};
+
+PD = PDstandardNth;
+
+KD = KroneckerDelta;
+
+(******************************************************************************)
+(* Tensors *)
+(******************************************************************************)
+
+(* Register the tensor quantities with the TensorTools package *)
+Map [DefineTensor, {u, rho}];
+
+(******************************************************************************)
+(* Groups *)
+(******************************************************************************)
+
+evolvedGroups =
+ {SetGroupName [CreateGroupFromTensor [u ], "WT_u" ],
+ SetGroupName [CreateGroupFromTensor [rho], "WT_rho"]};
+evaluatedGroups = {};
+
+declaredGroups = Join [evolvedGroups, evaluatedGroups];
+declaredGroupNames = Map [First, declaredGroups];
+
+
+
+groups = Join [declaredGroups];
+
+(******************************************************************************)
+(* Initial data *)
+(******************************************************************************)
+
+initialCalc =
+{
+ Name -> "WT_Gaussian",
+ Schedule -> {"AT initial"},
+ (* Where -> Boundary, *)
+ (* Where -> Interior, *)
+ Equations ->
+ {
+ u -> 0,
+ rho -> 0
+ }
+}
+
+(******************************************************************************)
+(* Evolution equations *)
+(******************************************************************************)
+
+evolCalc =
+{
+ Name -> "WT_RHS",
+ Schedule -> {"IN MoL_CalcRHS", "AT analysis"},
+ Where -> Interior,
+ Equations ->
+ {
+ dot[u] -> rho,
+ dot[rho] -> KD[ua,ub] PD[u,la,lb]
+ }
+}
+
+(******************************************************************************)
+(* Construct the thorns *)
+(******************************************************************************)
+
+calculations =
+{
+ initialCalc,
+ evolCalc
+};
+
+CreateKrancThornTT [groups, ".", "ML_WaveToy",
+ Calculations -> calculations,
+ DeclaredGroups -> declaredGroupNames,
+ PartialDerivatives -> derivatives
+];