aboutsummaryrefslogtreecommitdiff
path: root/Tools/CodeGen
diff options
context:
space:
mode:
authorIan Hinder <ian@vaio.(none)>2008-02-01 22:28:27 -0500
committerIan Hinder <ian@vaio.(none)>2008-02-02 01:39:21 -0500
commitb5f00494d146ae6c440d177efb9da9c81fb1d711 (patch)
treef3cb2f010909cf6ce0d88e2c078a9532c443615c /Tools/CodeGen
parente649528f458db0d309abb76af96688cabc1f391a (diff)
Erik's moving of variable declarations inside the equation loop
Diffstat (limited to 'Tools/CodeGen')
-rw-r--r--Tools/CodeGen/CalculationFunction.m22
1 files changed, 15 insertions, 7 deletions
diff --git a/Tools/CodeGen/CalculationFunction.m b/Tools/CodeGen/CalculationFunction.m
index d57327c..f523daf 100644
--- a/Tools/CodeGen/CalculationFunction.m
+++ b/Tools/CodeGen/CalculationFunction.m
@@ -495,9 +495,9 @@ CreateCalculationFunction[calc_, debug_] :=
"DECLARE_CCTK_PARAMETERS\n\n",
DeclareGridLoopVariables[],
DeclareFDVariables[],
- declareVariablesForCalculation[cleancalc],
- declarePrecomputedDerivatives[dsUsed],
- DeclareDerivatives[pddefs, eqs],
+ (* declareVariablesForCalculation[cleancalc], *)
+ (* declarePrecomputedDerivatives[dsUsed], *)
+ (* DeclareDerivatives[pddefs, eqs], *)
declareSubblockGFs[subblockGFs, 0],
declarePreDefinitions[pDefs],
@@ -533,7 +533,7 @@ CreateCalculationFunction[calc_, debug_] :=
(* Have removed ability to include external header files here.
Can be put back when we need it. *)
- eqLoop = Map[equationLoop[#, gfs, shorts, subblockGFs, {}, groups, syncGroups, pddefs, where, addToStencilWidth] &, eqs]},
+ eqLoop = Map[equationLoop[#, cleancalc, dsUsed, gfs, shorts, subblockGFs, {}, groups, syncGroups, pddefs, where, addToStencilWidth] &, eqs]},
(* search for SYNCs *)
If[numeq <= 1,
@@ -642,10 +642,13 @@ pdCanonicalOrdering[name_[inds___] -> x_] :=
name[f_,3,2] -> name[f,2,3]}],
{}]];
-equationLoop[eqs_, gfs_, shorts_, subblockGFs_, incs_, groups_, syncGroups_,
+equationLoop[eqs_,
+ cleancalc_, dsUsed_,
+ gfs_, shorts_, subblockGFs_, incs_, groups_, syncGroups_,
pddefs_, where_, addToStencilWidth_] :=
Module[{rhss, lhss, gfsInRHS, gfsInLHS, localGFs, localMap, eqs2,
- derivSwitch, actualSyncGroups, code, syncCode, loopFunction},
+ derivSwitch, actualSyncGroups, code, functionName,
+ syncCode, loopFunction},
rhss = Map[#[[2]] &, eqs];
lhss = Map[#[[1]] &, eqs];
@@ -677,9 +680,14 @@ equationLoop[eqs_, gfs_, shorts_, subblockGFs_, incs_, groups_, syncGroups_,
checkEquationAssignmentOrder[eqs2, shorts];
code = {(*InitialiseGridLoopVariables[derivSwitch, addToStencilWidth], *)
+ functionName = ToString@lookup[cleancalc, Name];
GenericGridLoop[
- {CommentedBlock["Assign local copies of grid functions",
+ {declareVariablesForCalculation[cleancalc],
+ declarePrecomputedDerivatives[dsUsed],
+ DeclareDerivatives[pddefs, eqs],
+
+ CommentedBlock["Assign local copies of grid functions",
Map[AssignVariable[localName[#], GridName[#]] &,
gfsInRHS]],