diff options
author | Ian Hinder <ian.hinder@aei.mpg.de> | 2013-09-13 15:43:23 +0200 |
---|---|---|
committer | Ian Hinder <ian.hinder@aei.mpg.de> | 2013-09-13 15:43:23 +0200 |
commit | 110424e82ef48f68c1c6cd35fca215ccfd37bb55 (patch) | |
tree | ebf39d09b39b25a0439f2e4fcb4e5e44c7a97510 /Tools/CodeGen/KrancThorn.m | |
parent | a8e14b3165e9aec46cb28a4e737987b95f3285e1 (diff) |
Move MoL code processing from KrancThorn.m to MoL.m
Diffstat (limited to 'Tools/CodeGen/KrancThorn.m')
-rw-r--r-- | Tools/CodeGen/KrancThorn.m | 54 |
1 files changed, 1 insertions, 53 deletions
diff --git a/Tools/CodeGen/KrancThorn.m b/Tools/CodeGen/KrancThorn.m index 963fdc7..8231a3a 100644 --- a/Tools/CodeGen/KrancThorn.m +++ b/Tools/CodeGen/KrancThorn.m @@ -235,59 +235,7 @@ CreateKrancThorn[groupsOrig_, parentDirectory_, thornName_, opts:OptionsPattern[ MoL ------------------------------------------------------------------------ *) - Module[ - {evolvedGroups, nonevolvedGroups, evolvedODEGroups, - nonevolvedODEGroups, rhsGroupDefinitions, - rhsODEGroupDefinitions, rhsGroups, rhsODEGroups, - - groups, declaredGroups, calcs, odeGroups}, - - groups = GetObjectField[c, "Groups"]; - declaredGroups = GetObjectField[c, "DeclaredGroups"]; - calcs = GetObjectField[c, "Calculations"]; - odeGroups = GetObjectField[c, "ODEGroups"]; - - groups = MoLProcessGroups[declaredGroups, - calcs, groups, GetObjectField[c,"EvolutionTimelevels"]]; - - (* Get the different types of group *) - evolvedGroups = MoLEvolvedGroups[declaredGroups, calcs, groups]; - nonevolvedGroups = MoLNonevolvedGroups[declaredGroups, calcs, groups]; - - evolvedODEGroups = MoLEvolvedGroups[odeGroups, calcs, groups]; - nonevolvedODEGroups = MoLNonevolvedGroups[odeGroups, calcs, groups]; - - (* Replace the dots in the calculation *) - calcs = MoLReplaceDots[calcs]; - - rhsGroupDefinitions = MoLRHSGroupDefinitions[groups, evolvedGroups]; - rhsODEGroupDefinitions = MoLRHSODEGroupDefinitions[groups, evolvedODEGroups]; - - (* Add the RHS groups *) - groups = Join[groups, rhsGroupDefinitions, rhsODEGroupDefinitions]; - - rhsGroups = Map[groupName, rhsGroupDefinitions]; - rhsODEGroups = Map[groupName, rhsODEGroupDefinitions]; - - (* This possibly shouldn't be in MoL but under ODEs instead *) - calcs = Map[Append[#, ODEGroups -> Join[odeGroups, rhsODEGroups]] &, calcs]; - - declaredGroups = Join[declaredGroups, rhsGroups, odeGroups, rhsODEGroups]; - - InfoMessage[Terse, "Creating MoL registration file"]; - (* TODO: only do this for thorns with evolved variables *) - - c = SetObjectField[c, "Groups", groups]; - c = SetObjectField[c, "DeclaredGroups", declaredGroups]; - c = SetObjectField[c, "Calculations", calcs]; - c = AppendObjectField[ - c, "Sources", - {Filename -> "RegisterMoL.cc", - Contents -> CreateKrancMoLRegister[ - evolvedGroups, nonevolvedGroups, evolvedODEGroups, - nonevolvedODEGroups, - Sequence@@(GetObjectField[c,#]& /@ - {"Groups", "Implementation", "Name"})]}]]; + c = MoLProcessCode[c, opts]; (* ------------------------------------------------------------------------ Add options to calculations |