def makeCrystalLattice(self): """ Create a crystal lattice in c from the fcc structure """ c = crystal() a = self.a n = self.n # first the cube for i in range(0, n): for j in range(0, n): for k in range(0, n): c.addToLattice(latticePoint(self.cube[i][j][k], i * a, j * a, k * a)) # the X normal face atoms for i in range(0, n): for j in range(0, n - 1): for k in range(0, n - 1): c.addToLattice(latticePoint(self.fcx[i][j][k], i * a, j * a + a / 2, k * a + a / 2)) # the Y normal face atoms for i in range(0, n - 1): for j in range(0, n): for k in range(0, n - 1): c.addToLattice(latticePoint(self.fcy[i][j][k], i * a + a / 2, j * a, k * a + a / 2)) # the Z normal face atoms for i in range(0, n - 1): for j in range(0, n - 1): for k in range(0, n): c.addToLattice(latticePoint(self.fcz[i][j][k], i * a + a / 2, j * a + a / 2, k * a)) return c
def addOxygen(self,c): a =self.a aBy4 = a/4 n = self.n for i in range(0,2*(n-1)): for j in range(0,2*(n-1)): for k in range(0,2*(n-1)): c.addToLattice(latticePoint(8, aBy4 + i * a / 2,aBy4 + j * a / 2, aBy4+ k* a/2)) return c