Пример #1
0
def icosahedron_grid(element, lattice_constant, size):

    atoms = Icosahedron(symbol=element,
                        noshells=size,
                        latticeconstant=lattice_constant)

    atoms.set_pbc(True)

    atoms.center(vacuum=5.)

    return atoms
Пример #2
0
    atoms = ase.Atoms('NH2CH3')

    # Define connectivity.
    atoms_bonds = [ [0,1], [0,2], [0,3], [3,4], [3,5], [3,6] ]
    # Displace atoms so that they aren't on top of each other.
    atoms.rattle(0.001)

    # Construct VSEPR calculator.
    calculator = VSEPR(atoms, atoms_bonds)
    atoms.set_calculator(calculator)
    atoms.center()

    # Run optimization.
    opt = FIRE(atoms)
    opt.run()

    return atoms


ligand = make_methylamine()
nanoparticle = Icosahedron(symbol='Au', noshells=4)
nanoparticle.center(20)

atoms = add_ligands(nanoparticle,
                    ligand,
                    corner_sites=True,
                    edge_sites=[.5],
                    facet_111_sites=[])

write('POSCAR_Ih', atoms)
Пример #3
0
from ase.io import write
from ase.cluster.icosahedron import Icosahedron
import matplotlib.cm as cmx
import os

system = Icosahedron('Ag', 3)
for j in range(3):
    d = max(system.positions[:, j]) - min(system.positions[:, j])
    system.cell[j, j] = d + 15.

system.center()

center = (system.cell[0, 0] / 2., system.cell[1, 1] / 2.,
          system.cell[2, 2] / 2.)
width = max(system.positions[:, 0]) - min(system.positions[:, 0])
height = max(system.positions[:, 1]) - min(system.positions[:, 1])
xmin = min(system.positions[:, 0])
xmax = max(system.positions[:, 0])

colors = []
map = cmx.rainbow
for i, at in enumerate(system):
    code = int((at.position[0] - xmin) / width * 255)
    color_ = map(code)
    color = (color_[0], color_[1], color_[2], 0.5)
    colors.append(color)

pad = 3
xmin = center[0] - width / 2. - pad
ymin = center[1] - height / 2. - pad
xmax = center[0] + width / 2. + pad