[ase-users] nanoparticle out of multi element compounds

Christopher Wright cjwright4242 at gmail.com
Tue Aug 25 13:33:37 CEST 2015


You could take the unit cell of the material you want to make into a
nanoparticle, repeat it a bunch of times and then delete the atoms you
don’t need.
For a spherical particle this might look like

import ase.io as aseioimport numpy as np
def build_sphere_np(file_name, radius):
    """
    Build a spherical nanoparticle
    :param file_name: ASE loadable atomic positions
    :param radius: Radius of particle in Angstroms
    :return:
    """
    atoms = aseio.read(file_name)
    cell_dist = atoms.get_cell()
    multiple = np.ceil(2 * radius / cell_dist.diagonal()).astype(int)
    atoms = atoms.repeat(multiple)
    com = atoms.get_center_of_mass()
    atoms.translate(-com)
    del atoms[[atom.index for atom in atoms
               if np.sqrt(np.dot(atom.position, atom.position)) >=
               np.sqrt(radius ** 2)]]
    atoms.center()
    atoms.set_pbc((False, False, False))
    return atoms

​

On Mon, Aug 24, 2015 at 5:51 PM, <zarrini at staff.uni-marburg.de> wrote:

>
> Dear ASE users,
>
> The ASE "nanoparticle module" is just able to generate nanoparticle out of
> a bulk single element compounds like FCC \ce{Ni}, ..., however, I would be
> so appreciated if anybody pointed out how to generate nanoparticle (POSCAR)
> out of a bulk of multi element compounds, like "\ce{A3B}" for instance.
>
> Cheers,
>
> Zarrini
>
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20150825/060d15e9/attachment.html>


More information about the ase-users mailing list