def test_UnitCell2(): uc = UnitCell(2,HEXAGONAL,np.array([2.0])) print uc.shape.__dict__ print uc.shape.h print uc.shape.g uc = UnitCell(2,OBLIQUE,cell_param=np.array([3.0,4.0,np.pi/4.0])) print uc.shape.__dict__ print uc.shape.h print uc.shape.g uc = UnitCell(2) print uc.shape.__dict__ print uc.shape.h print uc.shape.g
def test_UnitCell1(): uc = UnitCell(1,LAMELLAR,np.array([2.0])) print uc.shape.__dict__ print uc.shape.h print uc.shape.g uc = UnitCell(1,cell_param=np.array([3.0])) print uc.shape.__dict__ print uc.shape.h print uc.shape.g uc = UnitCell(1) print uc.shape.__dict__ print uc.shape.h print uc.shape.g
def test_Basis3(): b = "Bravais" # N1,N2,N3 = 16,16,32 # uc = UnitCell(3,HEXAGONAL,np.array([1.0,2.0])) # g1 = Group(3,b,uc.shape,"P6mm") # gd1 = Grid(np.array([N1,N2,N3]),g1) # bs = Basis(g1,gd1) # render_structure_3d(bs,gd1,N1,N2,N3,1.0, # save_img=False,show_img=False,save_data=False) N1, N2, N3 = 32, 32, 32 uc = UnitCell(3) g2 = Group(3, b, uc.shape, "Ia-3d") gd2 = Grid(np.array([N1, N2, N3]), g2) bs2 = Basis(g2, gd2) render_structure_3d(bs2, gd2, N1, N2, N3, 1.0, save_img=False, show_img=False, save_data=False)
def test_Basis1(): b = "Bravais" uc = UnitCell(1,LAMELLAR,np.array([4.0])) N1 = 128 g1 = Group(1,b,uc.shape,"P1") gd1 = Grid(np.array([N1]),g1) bs = Basis(g1,gd1) print bs.__dict__ for s in bs.stars: print s.__dict__ c = 1.0 # c = np.zeros(bs.N) # c[0] = 1.0 * N1 # c[1] = 6.0 # c[2] = 4.0 # c[3] = 0.5 # c[4] = 3.0 render_structure_1d(bs,gd1,N1,c) g2 = Group(1,b,uc.shape,"P-1") gd2 = Grid(np.array([N1]),g2) bs2 = Basis(g2,gd2) print bs2.__dict__ for s in bs2.stars: print s.__dict__ c = 1.0 # c = np.zeros(bs2.N) # c[0] = 1.0 * N1 # c[1] = 6.0 # c[2] = 1.0 # c[3] = 3.0 # c[4] = 0.2 render_structure_1d(bs2,gd2,N1,c)
def test_Star3(): b = "Bravais" uc = UnitCell(3, HEXAGONAL, np.array([2.0, 5.0])) g1 = Group(3, b, uc.shape, "P6mm") gd1 = Grid(np.array([4, 4, 4]), g1) print gd1.Gsq s1 = Star(g1, gd1, gd1.Gsq[56]) print s1.__dict__
def test_Star2(): b = "Bravais" uc = UnitCell(2, HEXAGONAL, np.array([2.0])) g1 = Group(2, b, uc.shape, "P6mm") gd1 = Grid(np.array([128, 128]), g1) print gd1.Gsq s1 = Star(g1, gd1, gd1.Gsq[7]) print s1.__dict__
def test_UnitCell3(): uc = UnitCell(3,HEXAGONAL,np.array([2.0,5.0])) print uc.shape.__dict__ print uc.shape.h print uc.shape.g uc = UnitCell(3,TRICLINIC, cell_param=np.array( [3.0,4.0,5.0,np.pi/3.0,np.pi/4.0,np.pi/5.0] )) print uc.shape.__dict__ print uc.shape.h print uc.shape.g uc = UnitCell(3) print uc.shape.__dict__ print uc.shape.h print uc.shape.g
def test_Star1(): b = "Bravais" uc = UnitCell(1, LAMELLAR, np.array([2.0])) g1 = Group(1, b, uc.shape, "P1") gd1 = Grid(np.array([9]), g1) print gd1.Gsq s1 = Star(g1, gd1, gd1.Gsq[5]) print s1.__dict__, "\n" g2 = Group(1, b, uc.shape, "P-1") gd2 = Grid(np.array([9]), g2) print gd2.Gsq s2 = Star(g1, gd1, gd1.Gsq[5]) print s2.__dict__, "\n"
def test_Basis1(): b = "Bravais" uc = UnitCell(1, LAMELLAR, np.array([4.0])) N1 = 128 for i in np.arange(100): g1 = Group(1, b, uc.shape, "P1") gd1 = Grid(np.array([N1]), g1) bs = Basis(g1, gd1) render_structure_1d(bs, gd1, N1, 1.0, save_img=False, show_img=False, save_data=False)
def test_Basis2(): b = "Bravais" N1, N2 = 64, 64 for i in np.arange(1): uc = UnitCell(2, HEXAGONAL, np.array([2.0])) g1 = Group(2, b, uc.shape, "P6mm") gd1 = Grid(np.array([N1, N2]), g1) bs = Basis(g1, gd1) render_structure_2d(bs, gd1, N1, N2, 1.0, save_img=False, show_img=True, save_data=False)
def test_Basis3(): b = "Bravais" N1,N2,N3 = 32,32,32 uc = UnitCell(3,HEXAGONAL,np.array([4.0,4.0])) g = Group(3,b,uc.shape,"P6mm") gd = Grid(np.array([N1,N2,N3]),g) bs = Basis(g,gd) print bs.__dict__ for s in bs.stars: print s.__dict__ # c = 1.0 c = np.zeros(bs.N) c[0] = N1 * N2 * N3; c[1] = 10.0 c[2] = 50.0 c[3] = 1.0 # c[4] = 5.0 render_structure_3d(bs,gd,N1,N2,N3,c)
def test_Basis2(): b = "Bravais" N1,N2 = 128,128 uc = UnitCell(2,RECTANGULAR,np.array([1.0,1.2])) #print uc.__dict__ g1 = Group(2,b,uc.shape,"P2mm") #print g1.__dict__ gd1 = Grid(np.array([N1,N2]),g1) #gd1.lowBZ = -8 #gd1.highBZ = 8 bs = Basis(g1,gd1) #for s in bs.stars: #print s.__dict__ c = np.zeros(bs.N) c[0] = 1.0*N1*N2 c[1] = 18.0 c[2] = 5.0 #c[3] = 3.0 #c[4] = 1.0 render_structure_2d(bs,gd1,N1,N2,c)