aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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