(* ::Package:: *)

(************************************************************************)
(* Purpose: The following rules are used to convert the specified DDE   *)
(*    to the representations corresponding to the various faces of the  *) 
(*    cube, i.e. Left, Right, Top, Ground and Back                      *)
(*                                                                      *)
(* Code is in File:   lpRules.m                                         *)
(*                                                                      *)
(* Last Modified:                                                       *)
(************************************************************************)
numVariables = 3;

latFrnt2GrndRules = 
  {x[0,0,0] -> x[0,0,0], y[0,0,0] -> y[0,0,0], z[0,0,0] -> z[0,0,0], 
   x[1,0,0] -> x[1,0,0], y[1,0,0] -> y[1,0,0], z[1,0,0] -> z[1,0,0], 
   x[0,1,0] -> x[0,0,1], y[0,1,0] -> y[0,0,1], z[0,1,0] -> z[0,0,1], 
   x[1,1,0] -> x[1,0,1], y[1,1,0] -> y[1,0,1], z[1,1,0] -> z[1,0,1], 
   p -> p, q -> k};

latFrnt2LeftRules = 
  {x[0,0,0] -> x[0,0,0], y[0,0,0] -> y[0,0,0], z[0,0,0] -> z[0,0,0], 
   x[1,0,0] -> x[0,0,1], y[1,0,0] -> y[0,0,1], z[1,0,0] -> z[0,0,1], 
   x[0,1,0] -> x[0,1,0], y[0,1,0] -> y[0,1,0], z[0,1,0] -> z[0,1,0], 
   x[1,1,0] -> x[0,1,1], y[1,1,0] -> y[0,1,1], z[1,1,0] -> z[0,1,1], 
   p -> k, q -> q};

latGrnd2TopRules = 
  {x[0,0,0] -> x[0,1,0], y[0,0,0] -> y[0,1,0], z[0,0,0] -> z[0,1,0], 
   x[1,0,0] -> x[1,1,0], y[1,0,0] -> y[1,1,0], z[1,0,0] -> z[1,1,0], 
   x[0,0,1] -> x[0,1,1], y[0,0,1] -> y[0,1,1], z[0,0,1] -> z[0,1,1], 
   x[1,0,1] -> x[1,1,1], y[1,0,1] -> y[1,1,1], z[1,0,1] -> z[1,1,1], 
   p -> p, k -> k};

latLeft2RghtRules = 
  {x[0,0,0] -> x[1,0,0], y[0,0,0] -> y[1,0,0], z[0,0,0] -> z[1,0,0], 
   x[0,1,0] -> x[1,1,0], y[0,1,0] -> y[1,1,0], z[0,1,0] -> z[1,1,0], 
   x[0,0,1] -> x[1,0,1], y[0,0,1] -> y[1,0,1], z[0,0,1] -> z[1,0,1], 
   x[0,1,1] -> x[1,1,1], y[0,1,1] -> y[1,1,1], z[0,1,1] -> z[1,1,1], 
   q -> q, k -> k};

latFrnt2BackRules = 
  {x[0,0,0] -> x[0,0,1], y[0,0,0] -> y[0,0,1], z[0,0,0] -> z[0,0,1], 
   x[1,0,0] -> x[1,0,1], y[1,0,0] -> y[1,0,1], z[1,0,0] -> z[1,0,1], 
   x[0,1,0] -> x[0,1,1], y[0,1,0] -> y[0,1,1], z[0,1,0] -> z[0,1,1], 
   x[1,1,0] -> x[1,1,1], y[1,1,0] -> y[1,1,1], z[1,1,0] -> z[1,1,1], 
   q -> q, p -> p};

(* Same as above rules but more clear from a documentation standpoint *)
lat1ShiftRules = 
  {x[0,0,0] -> x[1,0,0], y[0,0,0] -> y[1,0,0], z[0,0,0] -> z[1,0,0], 
   x[0,1,0] -> x[1,1,0], y[0,1,0] -> y[1,1,0], z[0,1,0] -> z[1,1,0], 
   x[0,0,1] -> x[1,0,1], y[0,0,1] -> y[1,0,1], z[0,0,1] -> z[1,0,1], 
   x[0,1,1] -> x[1,1,1], y[0,1,1] -> y[1,1,1], z[0,1,1] -> z[1,1,1],
   s[1] -> s1[1], t[1] -> t1[1], s[2] -> s1[2], t[2]->t1[2], s[3]->s1[3], t[3]->t1[3]};
lat2ShiftRules = 
  {x[0,0,0] -> x[0,1,0], y[0,0,0] -> y[0,1,0], z[0,0,0] -> z[0,1,0], 
   x[1,0,0] -> x[1,1,0], y[1,0,0] -> y[1,1,0], z[1,0,0] -> z[1,1,0], 
   x[0,0,1] -> x[0,1,1], y[0,0,1] -> y[0,1,1], z[0,0,1] -> z[0,1,1], 
   x[1,0,1] -> x[1,1,1], y[1,0,1] -> y[1,1,1], z[1,0,1] -> z[1,1,1],
   s[1] -> s2[1], t[1] -> t2[1], s[2] -> s2[2], t[2]->t2[2], s[3]->s2[3], t[3]->t2[3]};
lat3ShiftRules = 
  {x[0,0,0] -> x[0,0,1], y[0,0,0] -> y[0,0,1], z[0,0,0] -> z[0,0,1],
   x[1,0,0] -> x[1,0,1], y[1,0,0] -> y[1,0,1], z[1,0,0] -> z[1,0,1], 
   x[0,1,0] -> x[0,1,1], y[0,1,0] -> y[0,1,1], z[0,1,0] -> z[0,1,1], 
   x[1,1,0] -> x[1,1,1], y[1,1,0] -> y[1,1,1], z[1,1,0] -> z[1,1,1]};

allowedVars = {x[0,0,0],y[0,0,0],z[0,0,0],
               x[1,0,0],y[1,0,0],z[1,0,0],
               x[0,1,0],y[0,1,0],z[0,1,0],
               x[0,0,1],y[0,0,1],z[0,0,1],
               x[1,1,0],y[1,1,0],z[1,1,0],
               x[1,0,1],y[1,0,1],z[1,0,1],
               x[0,1,1],y[0,1,1],z[0,1,1],
               x[1,1,1],y[1,1,1],z[1,1,1]};


