""" Set up structures """

import numpy as np
from ase import Atoms
from ase.io import write

# Primitive cell
primitive = Atoms('NiAl', positions=[(0, 0, 0), (1/2, 1/2, 1/2)])
primitive.set_cell([2.86, 2.86, 2.86], scale_atoms=True)
primitive.pbc = True

# Ordered supercell
supercell = primitive.repeat((24, 24, 24))
write('model-ordered.xyz', supercell)

# Disordered supercell
natoms = len(supercell)
supercell.symbols = natoms * ['Al']
nNi = int(natoms / 2)
selection = np.random.choice(range(natoms), size=nNi, replace=False)
supercell.symbols[selection] = 'Ni'
write('model-disordered.xyz', supercell)
