aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Hinder <ian.hinder@aei.mpg.de>2013-09-13 17:08:55 +0200
committerIan Hinder <ian.hinder@aei.mpg.de>2013-09-13 17:08:55 +0200
commit5f2e80404eae61e51a2b30f8a8468238b5ee66aa (patch)
tree4313e1f48423107192b7896ddd3b8b169764a880
parentd609a1670c3eb43e6eeaee58b54a5bdb1d1c5a8b (diff)
KrancThorn.m: Move coordinates code processing to a separate function
-rw-r--r--Tools/CodeGen/KrancThorn.m23
1 files changed, 15 insertions, 8 deletions
diff --git a/Tools/CodeGen/KrancThorn.m b/Tools/CodeGen/KrancThorn.m
index de89f28..bbc71b9 100644
--- a/Tools/CodeGen/KrancThorn.m
+++ b/Tools/CodeGen/KrancThorn.m
@@ -55,6 +55,20 @@ DefFn[
Append[#, GridType -> "array"],
#] &, groups]];
+DefFn[
+ coordinatesProcessCode[cIn_Code, opts___] :=
+ Module[
+ {c = cIn},
+ (* TODO: this should just be an Append. The order of the groups
+ should not matter. We could also check that the input groups
+ do not contain the coordinates. *)
+
+ c = SetObjectField[c, "Groups",
+ Union[GetObjectField[c, "Groups"],
+ {{"grid::coordinates", {Kranc`x,Kranc`y,Kranc`z,Kranc`r}}},
+ SameTest->(ToLowerCase[#1]==ToLowerCase[#2]&)]];
+ c]];
+
(* --------------------------------------------------------------------------
Thorn generation (main entry point for non-tensorial thorns)
-------------------------------------------------------------------------- *)
@@ -133,14 +147,7 @@ CreateKrancThorn[groupsOrig_, parentDirectory_, thornName_, opts:OptionsPattern[
CheckGroups[GetObjectField[c, "Groups"]];
- (* TODO: this should just be an Append. The order of the groups
- should not matter. We could also check that the input groups
- do not contain the coordinates. *)
-
- c = SetObjectField[c, "Groups",
- Union[GetObjectField[c, "Groups"],
- {{"grid::coordinates", {Kranc`x,Kranc`y,Kranc`z,Kranc`r}}},
- SameTest->(ToLowerCase[#1]==ToLowerCase[#2]&)]];
+ c = coordinatesProcessCode[c, opts];
(* ------------------------------------------------------------------------
Separate derivatives