diff options
author | shusa <shusa> | 2005-07-21 08:16:18 +0000 |
---|---|---|
committer | shusa <shusa> | 2005-07-21 08:16:18 +0000 |
commit | 8e3ae211ccd9851b22fa3a58f82cebb7a0614786 (patch) | |
tree | 14ef7a582d13e0d2f15dcee700499b40e66dca43 | |
parent | 98a8e7e63f1765690fb83805f17f9eea29eb7ffa (diff) |
add option to schedule setter thorns at either INITIAL or POSTINITIAL to
allow for cleaner scheduling; schedule Translator now at INITIAL!
-rw-r--r-- | Tools/CodeGen/KrancThorns.m | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/Tools/CodeGen/KrancThorns.m b/Tools/CodeGen/KrancThorns.m index 2df2ed3..3a36d31 100644 --- a/Tools/CodeGen/KrancThorns.m +++ b/Tools/CodeGen/KrancThorns.m @@ -757,7 +757,7 @@ Module[{after, allowedSetTimes, baseImplementation, baseParamsTrueQ, before, cal file, GFs, globalStorageGroups, implementation, implementations, intParameters, namedCalc, precompheaderName, realParameters, RHSs, setgroups, setTime, ThornList, ext, include, genericFDImplementation, baseImp, numeq, grepSYNC, scheduledStartup, - sheduledINITIAL, scheduledPOSTSTEP}, + sheduledINITIAL, scheduledPOSTSTEP, INIT}, Print["\n*** CreateSetterThorn ***"]; @@ -794,14 +794,16 @@ If[debug, Print["Debugging switched off"] ]; - allowedSetTimes = {"initial_only", "poststep_only", "initial_and_poststep"}; + allowedSetTimes = {"initial_only", "postinitial_only", "poststep_only", "initial_and_poststep", "postinitial_and_poststep"}; If[!MemberQ[allowedSetTimes, setTime], Module[{}, Print["Unknown value for option SetTime: ", SetTime]; - Throw["Allowed values for option SetTime are: \"initial_only\", \"poststep_only\" and \"initial_and_poststep\""]]]; - + Print["Allowed values for option SetTime are: ", allowedSetTimes]; + Throw["Exit in CreateSetterThorn"]]]; +If[setTime == "initial_only" || setTime == "initial_and_poststep", INIT = "INITIAL" ]; +If[setTime == "postinitial_only" || setTime == "postinitial_and_poststep", INIT = "POSTINITIAL" ]; baseParamsTrueQ = Length@realBaseParameters + Length@intBaseParameters > 0; @@ -865,7 +867,7 @@ Map[AppendTo[newparams, #]&, Flatten[{Map[completeRealParamStruct, realParameters], Map[completeIntParamStruct, intParameters]}, 1]]; -If[(setTime == "initial_and_poststep"), +If[(setTime == "initial_and_poststep") || (setTime == "postinitial_and_poststep"), AppendTo[newparams, {Name -> "set_initial_data", Type -> "BOOLEAN", Default -> "\"true\"", Description -> "whether to set initial data", Visibility -> "private"}]; @@ -873,7 +875,6 @@ If[(setTime == "initial_and_poststep"), AppendTo[newparams, {Name -> "set_poststep", Type -> "BOOLEAN", Default -> "\"true\"", Description -> "whether to set data after intermediate MoL steps", Visibility -> "private"}]]; - genericFDImplementation = {Name -> "GenericFD", UsedParameters -> {{Name -> "stencil_width", Type -> "CCTK_INT"}, @@ -930,10 +931,10 @@ scheduledStartup = {Name -> thornName <> "_Startup", scheduledINITIAL = {Name -> calcrhsName, - SchedulePoint -> "AT POSTINITIAL" <> before <> after, + SchedulePoint -> "AT " <> INIT <> before <> after, SynchronizedGroups -> grepSYNC, Language -> CodeGen`SOURCELANGUAGE, - Conditional -> If[setTime == "initial_and_poststep", + Conditional -> If[setTime == "initial_and_poststep" || setTime == "postinitial_and_poststep", {Textual -> "set_initial_data"}, {} ], @@ -943,13 +944,13 @@ scheduledPOSTSTEP = {Name -> calcrhsName, SchedulePoint -> "in MoL_PostStep" <> before <> after, SynchronizedGroups -> grepSYNC, Language -> CodeGen`SOURCELANGUAGE, - Conditional -> If[setTime == "initial_and_poststep", + Conditional -> If[setTime == "initial_and_poststep" || setTime == "postinitial_and_poststep", {Textual -> "set_poststep"}, {} ], Comment -> "set values"}; -If[(setTime == "initial_only"), +If[(setTime == "initial_only") || (setTime == "postinitial_only") , scheduledFunctions = {scheduledINITIAL}; ]; @@ -957,7 +958,7 @@ If[(setTime == "poststep_only"), scheduledFunctions = {scheduledPOSTSTEP}; ]; -If[(setTime == "initial_and_poststep"), +If[(setTime == "initial_and_poststep") || (setTime == "postinitial_and_poststep"), scheduledFunctions = {scheduledINITIAL, scheduledPOSTSTEP}; ]; @@ -984,7 +985,7 @@ thornspec = {Name -> thornName, {Filename -> StartupName <> ".c", Contents -> startup}, {Filename -> calcrhsName <> ext, Contents -> setrhs}, {Filename -> precompheaderName, Contents -> precompheader}, - {Filename -> "Differencing.h", Contents -> diffHeader} + {Filename -> "Differencing.h", Contents -> diffHeader} } }; CreateThorn[thornspec]; @@ -1726,7 +1727,7 @@ after = If[mapContains[translatorInCalculation, After], scheduledADMToEvolve = {Name -> lookup[namedTranslatorInCalculation, Name], - SchedulePoint -> "at POSTINITIAL as ADMToEvolve" <> before <> after, + SchedulePoint -> "at INITIAL as ADMToEvolve" <> before <> after, Comment -> "ADMBase -> Evolution vars translation", StorageGroups -> storageGroups, Language -> CodeGen`SOURCELANGUAGE, |