diff options
author | Ian Hinder <ian.hinder@aei.mpg.de> | 2013-09-06 19:59:30 +0200 |
---|---|---|
committer | Ian Hinder <ian.hinder@aei.mpg.de> | 2013-09-06 19:59:30 +0200 |
commit | b701a31d2064d3cebe9e2618849e1a872c8c4f78 (patch) | |
tree | f9b07fc89fa874fcf6aa29dbccb1805d6e3077dc | |
parent | 37b5ff1a20526245a0d266c91923c39040b3b3a3 (diff) |
Rename ReplacePowers as ProcessExpression as this is a more accurate name
-rw-r--r-- | Tools/CodeGen/CalculationFunction.m | 2 | ||||
-rw-r--r-- | Tools/CodeGen/CodeGenKranc.m | 6 | ||||
-rw-r--r-- | Tools/CodeGen/Differencing.m | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/Tools/CodeGen/CalculationFunction.m b/Tools/CodeGen/CalculationFunction.m index ce49c5f..d603721 100644 --- a/Tools/CodeGen/CalculationFunction.m +++ b/Tools/CodeGen/CalculationFunction.m @@ -108,7 +108,7 @@ printEq[eq_] := split[ x_ + y___] := { x, " + ..."}; split[-x_ + y___] := {-x, " + ..."}; split[ x_ ] := { x, ""}; - rhsSplit = split[Expand@ReplacePowers[rhs,False]]; + rhsSplit = split[Expand@ProcessExpression[rhs,False]]; rhsString = ToString@CForm[rhsSplit[[1]]] <> rhsSplit[[2]]; InfoMessage[InfoFull, " " <> ToString@lhs <> " -> " <> rhsString]]; diff --git a/Tools/CodeGen/CodeGenKranc.m b/Tools/CodeGen/CodeGenKranc.m index 7903f3d..7a9eaad 100644 --- a/Tools/CodeGen/CodeGenKranc.m +++ b/Tools/CodeGen/CodeGenKranc.m @@ -36,7 +36,7 @@ ArrayName::usage = "ArrayName[variable] returns the name needed to access variab "assuming it is an array variable when inside a grid function."; InitialiseFDVariables::usage = ""; GenericGridLoop::usage = ""; -ReplacePowers::usage = ""; +ProcessExpression::usage = ""; CalculationMacros; AssignVariableFromExpression; GenerateCodeFromExpression; @@ -204,7 +204,7 @@ DefFn[ (* Take an expression x and replace occurrences of Powers with the C macros SQR, CUB, QAD *) DefFn[ - ReplacePowers[expr_, vectorise:Boolean, noSimplify:Boolean : False] := + ProcessExpression[expr_, vectorise:Boolean, noSimplify:Boolean : False] := Module[ {rhs}, rhs = expr /. Power[xx_, -1] -> INV[xx]; @@ -366,7 +366,7 @@ AssignVariableFromExpression[dest_, expr_, declare_, vectorise_, noSimplify:Bool GenerateCodeFromExpression[expr_, vectorise_, noSimplify:Boolean : False] := Module[{cleanExpr, code}, - cleanExpr = ReplacePowers[expr, vectorise, noSimplify]; + cleanExpr = ProcessExpression[expr, vectorise, noSimplify]; code = ToString[cleanExpr, CForm, PageWidth -> Infinity]; code = StringReplace[code, "normal1" -> "normal[0]"]; code = StringReplace[code, "normal2" -> "normal[1]"]; diff --git a/Tools/CodeGen/Differencing.m b/Tools/CodeGen/Differencing.m index 7ba1f5c..2071fe7 100644 --- a/Tools/CodeGen/Differencing.m +++ b/Tools/CodeGen/Differencing.m @@ -434,7 +434,7 @@ DefFn[ Print["Sequenced: ", Apply[SequenceForm,Simplify[1/(ss /. spacings2)],{0,Infinity}]];*) liName = "p" <> signModifier <> quotient <> ToString[Apply[SequenceForm,Simplify[1/(ss /. spacings2)],{0,Infinity}]]; - pDefs = {{liName -> CFormHideStrings[ReplacePowers[num / den ss /. spacings2, vectorise]]}}; + pDefs = {{liName -> CFormHideStrings[ProcessExpression[num / den ss /. spacings2, vectorise]]}}; rhs = rhs /. pat -> Times[liName, rest], (* Print["!!!!!!!!DOES NOT MATCH!!!!!!!!!"];*) @@ -453,7 +453,7 @@ DefFn[ Print[FullForm[rhs]]; Print[""];*) - rhs = CFormHideStrings[ReplacePowers[rhs /. spacings, vectorise]]; + rhs = CFormHideStrings[ProcessExpression[rhs /. spacings, vectorise]]; (* Print["rhs=",FullForm[rhs]]; *) (* Call another FD operator if we can swap or exchange array indices; |