def testGetChemicalFormula(self):
     at1 = Atom('C', [0.333333333333333, 0.666666666666667, 0])
     at2 = Atom('C', [0.666666666666667, 0.333333333333333, 0])
     #at3 = Atom('H', [0, 0, 0])
     
     stru = Structure( [ at1, at2], lattice=Lattice(3.8, 3.8, 5.6, 90, 90, 120) )
     print 'formula: ',  stru.getChemicalFormula()
     return
Exemplo n.º 2
0
    def testGetChemicalFormula(self):
        at1 = Atom('C', [0.333333333333333, 0.666666666666667, 0])
        at2 = Atom('C', [0.666666666666667, 0.333333333333333, 0])
        #at3 = Atom('H', [0, 0, 0])

        stru = Structure([at1, at2],
                         lattice=Lattice(3.8, 3.8, 5.6, 90, 90, 120))
        print 'formula: ', stru.getChemicalFormula()
        return
 def testChemicalFormulaPositionsSymbols(self):
     at1 = Atom('C', [0.333333333333333, 0.666666666666667, 0])
     at2 = Atom('C', [0.666666666666667, 0.333333333333333, 0])
     #at3 = Atom('H', [0, 0, 0])
     
     stru = Structure( [ at1, at2], lattice=Lattice(3.8, 3.8, 5.6, 90, 90, 120) )
     assert stru.getChemicalFormula()=='C_2'
     #self.assertListAlmostEqual(stru.xyz, [[0.33333333333333298, 0.66666666666666696, 0.0], [0.66666666666666696, 0.33333333333333298, 0.0]])
     #self.assertListAlmostEqual(stru.xyz_cartn,[[1.0969655114602876, 1.9000000000000017, 0.0], [2.1939310229205784, -2.0020877317117325e-15, 0.0]])
     #self.assertListAlmostEqual(stru.symbols, ['C', 'C'])
     #print "here's the lattice", stru.lattice.base
     return