aboutsummaryrefslogtreecommitdiff
path: root/Tools/CodeGen
diff options
context:
space:
mode:
authorIan Hinder <ian.hinder@aei.mpg.de>2012-01-25 15:37:20 -0600
committerIan Hinder <ian.hinder@aei.mpg.de>2012-01-25 15:37:20 -0600
commit5f26f5f5486ae1e0ca5b089708b429843b80282b (patch)
tree7f0aa00fcaf7eb983207592fa3714d559dafaa90 /Tools/CodeGen
parentd65aa221e3c7afff66cc5b3db176ac63f0f55f77 (diff)
Factor out looping function and make it a member function of a calculation
Diffstat (limited to 'Tools/CodeGen')
-rw-r--r--Tools/CodeGen/CalculationFunction.m2
-rw-r--r--Tools/CodeGen/Kranc.m2
-rw-r--r--Tools/CodeGen/Thorn.m2
3 files changed, 3 insertions, 3 deletions
diff --git a/Tools/CodeGen/CalculationFunction.m b/Tools/CodeGen/CalculationFunction.m
index d0b4fee..364c4ab 100644
--- a/Tools/CodeGen/CalculationFunction.m
+++ b/Tools/CodeGen/CalculationFunction.m
@@ -759,7 +759,7 @@ DefFn[
CommentedBlock["Copy local copies back to grid functions",
Map[AssignVariableInLoop[ArrayName[#], localName[#]] &, arraysInLHS]],
- GenericGridLoop[functionName,
+ lookup[cleancalc,LoopFunction][
{
(* DeclareDerivatives[defsWithoutShorts, eqsOrdered], *)
diff --git a/Tools/CodeGen/Kranc.m b/Tools/CodeGen/Kranc.m
index 5da3285..345bc3d 100644
--- a/Tools/CodeGen/Kranc.m
+++ b/Tools/CodeGen/Kranc.m
@@ -40,7 +40,7 @@ LoopPreIncludes, GroupImplementations, PartialDerivatives, NoSimplify,
Boundary, Interior, InteriorNoSync, Where, AddToStencilWidth,
Everywhere, normal1, normal2, normal3, INV, SQR, CUB, QAD, dot, pow,
exp, dt, dx, dy, dz, idx, idy, idz, t, MinMod, VanLeer, BodyFunction,
-CallerFunction}
+CallerFunction, LoopFunction}
{ConditionalOnKeyword, ConditionalOnKeywords, CollectList, Interior,
InteriorNoSync, Boundary, BoundaryWithGhosts, Where, PreDefinitions,
diff --git a/Tools/CodeGen/Thorn.m b/Tools/CodeGen/Thorn.m
index b2bb447..f41c6ad 100644
--- a/Tools/CodeGen/Thorn.m
+++ b/Tools/CodeGen/Thorn.m
@@ -540,7 +540,7 @@ CreateSetterSource[calcs_, debug_, include_,
calc = Join[calc, {BodyFunction -> bodyFunction,
CallerFunction -> True,
- LoopFunction -> (codeBlock[kernel<>"_Computations", #] &)}];
+ LoopFunction -> (GenericGridLoop[lookup[calc,Name],#,opts] &)}];
CreateCalculationFunction[calc, opts]}];