diff options
author | Ian Hinder <ian.hinder@aei.mpg.de> | 2012-02-07 01:19:12 -0500 |
---|---|---|
committer | Ian Hinder <ian.hinder@aei.mpg.de> | 2012-02-07 01:19:12 -0500 |
commit | f152ddc546fa788ff53465ae6bf037cddcd65cfd (patch) | |
tree | a77199ef255e969024b2f265d731591e9269e815 | |
parent | 2898d3ef389ea8df8f762cc5f14e7567e4d175d5 (diff) |
KrancScript.m: Add some debug code
-rw-r--r-- | Tools/CodeGen/KrancScript.m | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Tools/CodeGen/KrancScript.m b/Tools/CodeGen/KrancScript.m index 282628e..b7c5170 100644 --- a/Tools/CodeGen/KrancScript.m +++ b/Tools/CodeGen/KrancScript.m @@ -48,6 +48,7 @@ process[h_[args___]] := Module[ {}, Print["No handler for ", h@@Map[ToString[Head[#]]&,{args}]]; + (* Print["Full expression is: ", HoldForm[h[args]]]; *) ThrowError["Failed to parse script"]]; process[thorn:"thorn"[content___]] := @@ -55,6 +56,9 @@ process[thorn:"thorn"[content___]] := {calcs = {}, name, variables = {}, temporaries = {}, tensors, kernels, nonScalars, tensorRule, withInds, options = {}}, + (* Print["thorn = ", thorn]; *) + (* KrancTensor`printStruct[thorn]; *) + Do[Switch[el, "calculation"[___], AppendTo[calcs,process[el]], "name"[_], name = el[[1]], @@ -116,7 +120,12 @@ Do[ process["tensor"["name"[k_],inds_]] := tensor[ToExpression[If[Names[k] === {}, "Global`"<>k, k]],Sequence@@process[inds]]; +fprint[x_] := (Print[x//InputForm]; x); + + + process["dtensor"["dname"[dname_],inds_,tensor_]] := ToExpression[dname][process[tensor],Sequence@@process[inds]]; + process["dtensor"["dname"["D"], "indices"["lower_index"["index_symbol"["t"]]],tensor_]] := dot[process[tensor]]; |