コード例 #1
0
def test3():
    a = 5.0
    angle = 90
    basis = ['C', 'C']
    coords = [[0, 0, 0], [1 / 2, 1 / 2, 1 / 2]]
    latt1 = Crystal3DLattice.cubic(a)
    latt2 = \
        Crystal3DLattice(a=a, b=a, c=a, alpha=angle, beta=angle, gamma=angle)
    assert_equal(latt1, latt2)
    cell1 = UnitCell(lattice=latt1, basis=basis[:], coords=coords[:])
    cell2 = UnitCell(lattice=latt2, basis=basis[:], coords=coords[:])
    assert_equal(cell1, cell2)
    latt3 = Crystal3DLattice.cubic(10.0)
    assert_not_equal(latt1, latt3)
コード例 #2
0
def test4():
    lattice = Crystal3DLattice.cubic(a=5.0)
    basis = BasisAtoms(atoms=['C', 'C'])
    print(basis)
    print(basis.lattice)
    assert_true(basis.lattice is None)
    basis.lattice = lattice
    assert_true(isinstance(basis.lattice, Crystal3DLattice))
コード例 #3
0
def test16():
    a = np.sqrt(3) * aCC
    assert_true(Crystal3DLattice.cubic(a) < Crystal3DLattice.cubic(2 * a))
コード例 #4
0
def test12():
    a = np.sqrt(3) * aCC
    cubic_latt = Crystal3DLattice(a=a, b=a, c=a, alpha=90, beta=90, gamma=90)
    assert_equal(cubic_latt, Crystal3DLattice.cubic(a))