aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Hinder <ian.hinder@aei.mpg.de>2013-09-13 19:05:30 +0200
committerIan Hinder <ian.hinder@aei.mpg.de>2013-09-13 19:05:30 +0200
commit20e7a8feb560e494efe6b00db07af8b350fc9783 (patch)
tree8c678856a3f2e42ae347a8e084af751ea7235e57
parent883fc32fe2c5f619a03d663322a45132d2f3cfa9 (diff)
KrancThorn.m: Move DeclaredGroups code processing to its own functionHEADmaster
-rw-r--r--Tools/CodeGen/KrancThorn.m21
1 files changed, 16 insertions, 5 deletions
diff --git a/Tools/CodeGen/KrancThorn.m b/Tools/CodeGen/KrancThorn.m
index 97cfc1f..3dd8482 100644
--- a/Tools/CodeGen/KrancThorn.m
+++ b/Tools/CodeGen/KrancThorn.m
@@ -107,6 +107,17 @@ DefFn[
GetObjectField[c, "Calculations"]]];
c]];
+DefFn[
+ declaredGroupsProcessCode[cIn_Code, opts___] :=
+ Module[
+ {c = cIn},
+ c = SetObjectField[
+ c, "DeclaredGroups",
+ DeleteDuplicates[Join[GetObjectField[c, "DeclaredGroups"],
+ Flatten[Map[Map[groupName,lookup[#,LocalGroups,{}]] &,
+ GetObjectField[c, "Calculations"]],1]]]];
+ c]];
+
(* --------------------------------------------------------------------------
Thorn generation (main entry point for non-tensorial thorns)
-------------------------------------------------------------------------- *)
@@ -236,11 +247,11 @@ CreateKrancThorn[groupsOrig_, parentDirectory_, thornName_, opts:OptionsPattern[
c = ODEProcessCode[c, opts];
- c = SetObjectField[
- c, "DeclaredGroups",
- DeleteDuplicates[Join[GetObjectField[c, "DeclaredGroups"],
- Flatten[Map[Map[groupName,lookup[#,LocalGroups,{}]] &,
- GetObjectField[c, "Calculations"]],1]]]];
+ (* ------------------------------------------------------------------------
+ Declared groups
+ ------------------------------------------------------------------------ *)
+
+ c = declaredGroupsProcessCode[c, opts];
(* ------------------------------------------------------------------------
MoL