aboutsummaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorIan Hinder <ian.hinder@aei.mpg.de>2012-01-26 23:45:03 -0600
committerIan Hinder <ian.hinder@aei.mpg.de>2012-01-27 00:03:02 -0600
commit2a7a5a4dbbdbb02611ec644546c8bbe551fe4186 (patch)
tree30a5dc09927a51eac0eb6923ea1c81abffdbab93 /Tools
parentfb66658a68c868725ac5ef97283a529d8115c24b (diff)
CalculationFunction.m: Eliminate t magic
We don't need to replace t -> cctk_time any more, because we define t as a constant.
Diffstat (limited to 'Tools')
-rw-r--r--Tools/CodeGen/CalculationFunction.m8
1 files changed, 2 insertions, 6 deletions
diff --git a/Tools/CodeGen/CalculationFunction.m b/Tools/CodeGen/CalculationFunction.m
index 32b9428..26190be 100644
--- a/Tools/CodeGen/CalculationFunction.m
+++ b/Tools/CodeGen/CalculationFunction.m
@@ -252,9 +252,8 @@ simpCollect[collectList_, eqrhs_, localvar_, debug_] :=
(* Return a CodeGen block which assigns dest by evaluating expr *)
assignVariableFromExpression[dest_, expr_, declare_, vectorise_, noSimplify:Boolean : False] :=
Module[{tSym, type, cleanExpr, code},
- tSym = Unique[];
type = If[StringMatchQ[ToString[dest], "dir*"], "ptrdiff_t", DataType[]];
- cleanExpr = ReplacePowers[expr, vectorise, noSimplify] /. Kranc`t -> tSym;
+ cleanExpr = ReplacePowers[expr, vectorise, noSimplify];
If[SOURCELANGUAGE == "C",
code = If[declare, type <> " ", ""] <> ToString[dest] <> " = " <>
@@ -275,7 +274,6 @@ assignVariableFromExpression[dest_, expr_, declare_, vectorise_, noSimplify:Bool
code = StringReplace[code, "normal2" -> "normal[1]"];
code = StringReplace[code, "normal3" -> "normal[2]"];
code = StringReplace[code, "BesselJ"-> "gsl_sf_bessel_Jn"];
- code = StringReplace[code, ToString@tSym -> "cctk_time"];
code = StringReplace[code, "\"" -> ""];
{code}];
@@ -283,8 +281,7 @@ assignVariableFromExpression[dest_, expr_, declare_, vectorise_, noSimplify:Bool
(* This and assignVariableFromExpression should be combined *)
generateCodeFromExpression[expr_, vectorise_, noSimplify:Boolean : False] :=
Module[{tSym, type, cleanExpr, code},
- tSym = Unique[];
- cleanExpr = ReplacePowers[expr, vectorise, noSimplify] /. Kranc`t -> tSym;
+ cleanExpr = ReplacePowers[expr, vectorise, noSimplify];
If[SOURCELANGUAGE == "C",
code =
@@ -303,7 +300,6 @@ generateCodeFromExpression[expr_, vectorise_, noSimplify:Boolean : False] :=
code = StringReplace[code, "normal2" -> "normal[1]"];
code = StringReplace[code, "normal3" -> "normal[2]"];
code = StringReplace[code, "BesselJ"-> "gsl_sf_bessel_Jn"];
- code = StringReplace[code, ToString@tSym -> "cctk_time"];
code = StringReplace[code, "\"" -> ""];
{code}];