Skip to content

Commit

Permalink
Change global variable names to include a $ sign in front.
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenrbrandt committed May 22, 2017
1 parent e7c4cfa commit a237ce5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Tools/CodeGen/CodeGenCalculation.m
Expand Up @@ -578,8 +578,8 @@ General Utility Functions (could be moved outside this package)
normal3, tangentA1, tangentA2, tangentA3, tangentB1, tangentB2, tangentB3},
If[useJacobian, JacobianSymbols[], {}]];

inherited = Intersection[allSymbols,Map[ToExpression,Global`InheritedVars]];
inheritedParams = Intersection[allSymbols,Map[(# /. Rule[from_,_]->from)&,Global`InheritedParams]];
inherited = Intersection[allSymbols,Map[ToExpression,Global`$InheritedVars]];
inheritedParams = Intersection[allSymbols,Map[(# /. Rule[from_,_]->from)&,Global`$InheritedParams]];
knownSymbols = Union[knownSymbols,inherited,inheritedParams];
gfs = Union[gfs,inherited];

Expand Down
6 changes: 3 additions & 3 deletions Tools/CodeGen/KrancTensor.m
Expand Up @@ -332,7 +332,7 @@ Scan all the interface files and find the thorn(s) providing this implementation
expr /. key[match___] :> (retval = AppendTo[retval,OneArg[match]]);
Return[retval]];

MakeParRule[thorn_,var_] := ToExpression[StringReplace[var,"_"->"UND"]] -> Global`QualifiedName[thorn<>"::"<>var];
MakeParRule[thorn_,var_] := ToExpression[StringReplace[var,"_"->"UND"]] -> Global`$QualifiedName[thorn<>"::"<>var];
MakeParMap[{thorn_,{vars___}}] := Map[MakeParRule[thorn,#]&,{vars}];

DefFn[CreateKrancThornTT2[thornName_String, opts:OptionsPattern[]] :=
Expand All @@ -342,10 +342,10 @@ Scan all the interface files and find the thorn(s) providing this implementation

inheritedGroups = Join@@Map[InheritedGroups, OptionValue[InheritedImplementations]];
vars = Umap[Map[Arg2,inheritedGroups]];
Global`InheritedVars = vars;
Global`$InheritedVars = vars;
params2 = Table[{i,Flatten[PExtract[paramTreeOfThorn[thornOfImplementation[i]],"realpar","realguts","name"]]},{i,OptionValue[InheritedImplementations]}];
params = Flatten[Map[MakeParMap,params2]];
Global`InheritedParams = params;
Global`$InheritedParams = params;

pderivs =
Join[OptionValue[PartialDerivatives],
Expand Down
2 changes: 1 addition & 1 deletion Tools/CodeGen/KrancThorn.m
Expand Up @@ -213,7 +213,7 @@ Thorn generation (main entry point for non-tensorial thorns)
parList = {};
(* Use Mathematica search and replace to identify all parameters
from inherited thorns used in expressions. *)
(c /. Global`InheritedParams) /. Global`QualifiedName[name_] :> (parList=AppendTo[parList,name];name);
(c /. Global`$InheritedParams) /. Global`$QualifiedName[name_] :> (parList=AppendTo[parList,name];name);
(* Avoid duplicate declarations *)
parList = Union[parList];
pd = SetObjectField[pd,"InheritedReals",parList];
Expand Down

0 comments on commit a237ce5

Please sign in to comment.