diff options
author | Ian Hinder <ian.hinder@aei.mpg.de> | 2010-10-01 09:54:43 +0200 |
---|---|---|
committer | Ian Hinder <ian.hinder@aei.mpg.de> | 2010-10-01 10:05:15 +0200 |
commit | 723ef25cd4cbb1a500a1951b5f6fb05ceca6fd94 (patch) | |
tree | 3456fb605616e71aec2e074035dc7c97e78cba35 /Tools/CodeGen | |
parent | 6fca009a454885b4151baaf985966840f1573a97 (diff) |
Thorn.m: Default to symmetries of a scalar if reflection symmetries have not been provided (and print a warning)
This is a temporary hack that needs to be fixed later.
Diffstat (limited to 'Tools/CodeGen')
-rw-r--r-- | Tools/CodeGen/Thorn.m | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Tools/CodeGen/Thorn.m b/Tools/CodeGen/Thorn.m index 30b4654..06b3e8d 100644 --- a/Tools/CodeGen/Thorn.m +++ b/Tools/CodeGen/Thorn.m @@ -548,8 +548,16 @@ SymmetriesBlock[spec_] := ]; (* syms is a list of rules mapping gridfunctions to their symmetry structures *) -calcSymmetry[gf_, syms_] := - gf /. syms; +calcSymmetry[gf_, syms_] := + Module[{}, + If[mapContains[syms, gf], + Return[lookup[syms,gf]], + (* FIXME: We are defaulting to scalar symmetries if no information is + available. This shouldn't happen, but I am bypassing this check + temporarily. *) + Print["WARNING: defaulting to symmetries of a scalar for "<>ToString[gf]]; + Return[{1,1,1}]]]; + (* This function guesses the symmetries based on component names as we have not been given them *) |