ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/samples/Madelung/quadrupoles/buildQuadrupolarArray
(Generate patch)

Comparing trunk/samples/Madelung/quadrupoles/buildQuadrupolarArray (file contents):
Revision 1920 by gezelter, Tue Jul 30 16:57:49 2013 UTC vs.
Revision 1921 by gezelter, Thu Aug 1 18:23:07 2013 UTC

# Line 68 | Line 68 | def createLattice(latticeType, latticeNumber, latticeC
68  
69      # create the 24 basic arrays using Eq. 12 in Luttinger & Tisza:
70      for i in range(8):
71 +        # The X and Y arrays are cubic rotations of the Z array, so we
72 +        # need to re-order them to match the numbering scheme in
73 +        # Luttinger & Tisza:
74 +        if (i > 0 and i < 4):
75 +            iX = 1 + (i + 1) % 3
76 +            iY = 1 + (i ) % 3
77 +        elif (i > 3 and i < 7):
78 +            iX = 4 + (i - 2) % 3
79 +            iY = 4 + (i ) % 3
80 +        else:
81 +            iX = i
82 +            iY = i
83          which = 0
84          for l1 in range(2):
85              for l2 in range(2):
86                  for l3 in range(2):
87                      lvals = numpy.array([l1,l2,l3])
88                      value = math.pow(-1, numpy.dot(cell[i], lvals))
89 <                    X[i][which] = value * e1
90 <                    Y[i][which] = value * e2
91 <                    Z[i][which] = value * e3
89 >                    X[iX][which] = value * e1
90 >                    Y[iY][which] = value * e2
91 >                    Z[i][which]  = value * e3                    
92                      which = which+1
81
93      
94      lp_array = numpy.zeros(0).reshape((0,3))
95      for i in range(8):        

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines