aboutsummaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorIan Hinder <ian.hinder@aei.mpg.de>2010-10-01 14:39:22 +0200
committerIan Hinder <ian.hinder@aei.mpg.de>2010-10-01 14:39:22 +0200
commit0e5608fe175896710a602aa1944fc4b96e3408dd (patch)
tree5f2e1be6788f91410b165c023d7885b533a8282a /Tools
parent3b13a227e7558009e00e9c90b4e22d4e879788d6 (diff)
ConservationCalculation.m: Create calculation to compute the conserved L and R variables after reconstruction of the primitives
Diffstat (limited to 'Tools')
-rw-r--r--Tools/CodeGen/ConservationCalculation.m13
1 files changed, 12 insertions, 1 deletions
diff --git a/Tools/CodeGen/ConservationCalculation.m b/Tools/CodeGen/ConservationCalculation.m
index 17d5873..f939940 100644
--- a/Tools/CodeGen/ConservationCalculation.m
+++ b/Tools/CodeGen/ConservationCalculation.m
@@ -172,6 +172,17 @@ conservedCalc[calc_] :=
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. *)
@@ -183,7 +194,7 @@ ProcessConservationCalculation[calc_, thornName_] :=
Table[
{conservedCalc[calc],
reconstructCalc[calc, i],
-(* conservedFluxCalc[i], *)
+ conservedIntercellCalc[calc, i],
fluxCalc[calc, i],
rhs[calc, i],
primitivesCalc[calc, thornName]}, {i, 1, 1}], 1]