Example #1
0
        if ReportTest.GetNumberOfErrors() > 10:
            print "*** Too many errors - giving up! ***"
            break


print_version(1)

element = "Cu"
latconst = ase.data.reference_states[ase.data.atomic_numbers[element]]['a']

atoms = FaceCenteredCubic(directions=[[1, 0, 0], [0, 1, 1], [0, 0, 1]],
                          size=(9, 7, 5),
                          symbol=element,
                          debug=0,
                          pbc=(0, 0, 0))
print "Symmetry:", atoms.get_pbc()
atoms.set_calculator(EMT())
epot = atoms.get_potential_energy()

nblist1 = NeighborList(latconst * 0.5 * (1 / sqrt(2) + 1), atoms, 0.0)
nblist2 = NeighborCellLocator(latconst * 0.5 * (1 / sqrt(2) + 1), Atoms(atoms),
                              0.0)
TestLists(nblist1, nblist2, "nearest-neigbor lists (free)")

atoms = Atoms(atoms, pbc=(1, 1, 1))
print "Symmetry:", atoms.get_pbc()

nblist1 = NeighborList(latconst * 0.5 * (1 / sqrt(2) + 1), atoms, 0.0)
nblist2 = NeighborCellLocator(latconst * 0.5 * (1 / sqrt(2) + 1), Atoms(atoms),
                              0.0)
TestLists(nblist1, nblist2, "nearest-neigbor lists (periodic)", 6)