From a55421dbf3fea6a4ded89c266c61e3cf41b2f0ce Mon Sep 17 00:00:00 2001 From: Ian Hinder Date: Thu, 13 Oct 2011 02:29:27 +0200 Subject: [PATCH] Differencing.m: Fix logic in ComponentDerivativeOperatorMacroDefinition The variable assignment in this function got messed up at some point, so that differencing operators which didn't fit the pattern for precomputation would not be generated correctly. --- Tools/CodeGen/Differencing.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Tools/CodeGen/Differencing.m b/Tools/CodeGen/Differencing.m index 514e26fb..dbcbb614 100644 --- a/Tools/CodeGen/Differencing.m +++ b/Tools/CodeGen/Differencing.m @@ -381,15 +381,16 @@ A GridFunctionDerivative (GFD) is an expression of the form Print["Sequenced: ", Apply[SequenceForm,Simplify[1/(ss /. spacings2)],{0,Infinity}]];*) liName = "p" <> signModifier <> quotient <> ToString[Apply[SequenceForm,Simplify[1/(ss /. spacings2)],{0,Infinity}]]; -(* Print["liName == ", liName];*) + pDefs = {{liName -> CFormHideStrings[ReplacePowers[num / den ss /. spacings2, vectorise]]}}; rhs = rhs /. pat -> Times[liName, rest], (* Print["!!!!!!!!DOES NOT MATCH!!!!!!!!!"];*) - rhs = rhs]; + rhs = rhs; + pDefs = {}; + liName = rhs]; (* Print["rhs3 == ", FullForm[rhs]];*) - pDefs = {{liName -> CFormHideStrings[ReplacePowers[num / den ss /. spacings2, vectorise]]}}; (* rhs = Factor[rhs];*) rhs = rhs //. (x_ a_ + x_ b_) -> x (a+b);