From 883fc32fe2c5f619a03d663322a45132d2f3cfa9 Mon Sep 17 00:00:00 2001 From: Ian Hinder Date: Fri, 13 Sep 2013 19:03:29 +0200 Subject: KrancThorn.m: Move ODE code processing into a separate function --- Tools/CodeGen/KrancThorn.m | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Tools/CodeGen/KrancThorn.m b/Tools/CodeGen/KrancThorn.m index 4fde955..97cfc1f 100644 --- a/Tools/CodeGen/KrancThorn.m +++ b/Tools/CodeGen/KrancThorn.m @@ -55,6 +55,16 @@ DefFn[ Append[#, GridType -> "array"], #] &, groups]]; +Options[ODEProcessCode] = ThornOptions; + +DefFn[ + ODEProcessCode[cIn_Code, opts:OptionsPattern[]] := + Module[ + {c = cIn}, + c = SetObjectField[c, "Groups", processODEGroups[GetObjectField[c, "ODEGroups"], + GetObjectField[c, "Groups"]]]; + c]]; + DefFn[ coordinatesProcessCode[cIn_Code, opts___] := Module[ @@ -224,8 +234,7 @@ CreateKrancThorn[groupsOrig_, parentDirectory_, thornName_, opts:OptionsPattern[ ODEs ------------------------------------------------------------------------ *) - c = SetObjectField[c, "Groups", processODEGroups[GetObjectField[c, "ODEGroups"], - GetObjectField[c, "Groups"]]]; + c = ODEProcessCode[c, opts]; c = SetObjectField[ c, "DeclaredGroups", -- cgit v1.2.3