Skip to content

Commit

Permalink
ScriptOutput.m: Add schedule string
Browse files Browse the repository at this point in the history
We probably want to be able to express all that is needed without resorting to a Cactus schedule string.
  • Loading branch information
ianhinder committed Apr 27, 2012
1 parent 013239a commit 3c5fd86
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Tools/CodeGen/ScriptOutput.m
Expand Up @@ -110,15 +110,18 @@
writeCalculation[calc_List] :=
Module[
{opts,except},
except = {Equations, Name, Shorthands};
except = {Equations, Name, Shorthands, Schedule};
opts = Select[calc,(!MemberQ[except,#[[1]]]) &];
beginEndBlock["calculation", lookup[calc, Name],
beginEndBlock["calculation", FlattenBlock@{lookup[calc, Name], " ", writeSchedule[calc]},
{"\n",
Riffle[Map["# " <> ToString[#,InputForm] &, opts],"\n\n"],
"\n\n",
writeExpression[lookup[calc, Equations]]},
Indent -> True]]];

writeSchedule[calc_] :=
If[lookup[calc,Schedule,Automatic] =!= Automatic, FlattenBlock@Riffle[{"scheduled \"", #, "\""}&/@ lookup[calc,Schedule,Automatic]," "],""];

DefFn[
writeDerivatives[pdefs_] :=
beginEndBlock["derivatives", "",
Expand Down

0 comments on commit 3c5fd86

Please sign in to comment.