Exemple #1
0
from ase.lattice.cubic import BodyCenteredCubic
from ase import Atom

a = 5.7885/2

cell = [[1,0,0],[0,1,0],[0,0,1]]
atoms = BodyCenteredCubic('Fe', directions=cell)
atoms.set_initial_magnetic_moments([5,5])
atoms.set_cell([a, a, a], scale_atoms=True)

carbon = Atom('C', position=(0,0.5*a,0.75*a), charge=0.4)
atoms = atoms*(2,2,2) + carbon

constraint = FixAtoms(indices=[8,10,12,14,16])

atoms.set_constraint(constraint)

atoms[-1].position = [0, 0.5*a, 0.75*a]
init = atoms.copy()
# view(init)

atoms[-1].position = [0, 0.75*a, 0.5*a]
final = atoms.copy()
# view(final)

def save( filename, arg ):
    f = open(filename, 'a+t')
    f.write('{0} \n'.format(arg))
    f.close()

os.system('mkdir result')
Exemple #2
0
a = 5.7885/2

cell = [[1,0,0],[0,1,0],[0,0,1]]
atoms = BodyCenteredCubic('Fe', directions=cell)
atoms.set_initial_magnetic_moments([5,5])
atoms.set_cell([a,a,a], scale_atoms=True)
#atoms.set_cell([a,a,a])

carbon = Atom('C', position=(0,0.5*a,0.5*a), charge=0.4)

atoms = atoms*(2,2,2) + carbon

constraint = FixAtoms(indices=[8,10])

atoms.set_constraint(constraint)


init = atoms.copy()

final = atoms.copy()
final[-1].position = [0, 0.5*a, (0.5+0.25)*a]

for i in range(0,18):
    os.system('mkdir {:02d}'.format(i))
    os.chdir('{:02d}'.format(i))
    atoms[-1].position = [0,0.5*a,(0.5+(0.25/17.*i))*a]
 #   view(atoms)
    write('POSCAR', atoms)
    os.chdir('..')
Exemple #3
0
from ase.utils.eos import EquationOfState
from ase.lattice.cubic import BodyCenteredCubic
from ase import Atom


a = 2.87

cell = [[1,0,0],[0,1,0],[0,0,1]]
bcc = BodyCenteredCubic('Fe', directions=cell)
bcc.set_initial_magnetic_moments([5,5])

carbon = Atom('C', position=(0,0.5*a,0.5*a), charge=0.4)

bcc = bcc*(2,2,2) + carbon
#atoms = atoms*(2,2,2)
constraint = FixAtoms(indices=[5,7,8,10,12,13,14,15,16])

bcc.set_constraint(constraint)

view(bcc)

def save( filename, arg ):
    f = open(filename, 'a+t')
    f.write('{0} \n'.format(arg))
    f.close()

os.system('mkdir result')

print bcc.get_cell()

Exemple #4
0
from numpy import *
from ase.utils.eos import EquationOfState
from ase.lattice.cubic import BodyCenteredCubic
from ase import Atom

a = 2.87

cell = [[1,0,0],[0,1,0],[0,0,1]]
bcc = BodyCenteredCubic('Fe', directions=cell)
bcc.set_initial_magnetic_moments([5,5])

carbon = Atom('C', position=(0,0.5*a,0.75*a), charge=0.4)

bcc = bcc*(2,2,2) + carbon
#atoms = atoms*(2,2,2)
constraint = FixAtoms(indices=[5,7,8,10,12,13,14,15,16])

bcc.set_constraint(constraint)

view(bcc)

def save( filename, arg ):
    f = open(filename, 'a+t')
    f.write('{0} \n'.format(arg))
    f.close()

os.system('mkdir result')

print bcc.get_cell()