Skip to content

Commit

Permalink
ConservationCalculation.m: Handle case where Shorthands is not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhinder committed Dec 15, 2011
1 parent df4426a commit 8960a5d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Tools/CodeGen/ConservationCalculation.m
Expand Up @@ -167,23 +167,23 @@
Name -> lookup[calc, Name] <> "_primitives",
Schedule -> {"in MoL_PostStep after " <> thornName <>"_ApplyBCs"},
Equations -> lookup[calc, PrimitiveEquations],
Shorthands -> lookup[calc, Shorthands]
Shorthands -> lookupDefault[calc, Shorthands, {}]
};

conservedCalc[calc_] :=
{
Name -> lookup[calc, Name] <> "_conserved",
Schedule -> {"at POSTINITIAL"},
Equations -> lookup[calc, ConservedEquations],
Shorthands -> lookup[calc, Shorthands]
Shorthands -> lookupDefault[calc, Shorthands, {}]
};

conservedIntercellCalc[calc_, i_] :=
{
Name -> lookup[calc, Name] <> "_intercell_conserved_" <> ToString[i],
Schedule -> {"in MoL_CalcRHS after " <> lookup[calc, Name] <> "_reconstruct_" <> ToString[i]},

Shorthands -> lookup[calc, Shorthands],
Shorthands -> lookupDefault[calc, Shorthands, {}],
Equations ->
Module[{vars = Join[primitiveVars[calc], consVars[calc]]},
Join[lookup[calc, ConservedEquations] /. (Map[# -> leftSymbol[#] &, vars]),
Expand Down

0 comments on commit 8960a5d

Please sign in to comment.