Skip to content

Commit

Permalink
ConservationCalculation.m: Create calculation to compute the conserve…
Browse files Browse the repository at this point in the history
…d L and R variables after reconstruction of the primitives
  • Loading branch information
ianhinder committed Oct 1, 2010
1 parent 3b13a22 commit 0e5608f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Tools/CodeGen/ConservationCalculation.m
Expand Up @@ -172,6 +172,17 @@
Equations -> lookup[calc, ConservedEquations]
};

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

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

(* Given a ConservationCalculation structure, return a list of
calculations which should be scheduled to solve that conservation
law. *)
Expand All @@ -183,7 +194,7 @@
Table[
{conservedCalc[calc],
reconstructCalc[calc, i],
(* conservedFluxCalc[i], *)
conservedIntercellCalc[calc, i],
fluxCalc[calc, i],
rhs[calc, i],
primitivesCalc[calc, thornName]}, {i, 1, 1}], 1]
Expand Down

0 comments on commit 0e5608f

Please sign in to comment.