Ejemplo n.º 1
0
import os, sys
import ase.io as fio
import ase.db as db
from gocia.interface import Interface
import gocia.utils.report as rp

# $ python plotCPK.py asym-4l.vasp Ga3N3.vasp
# # Timing: 1.4265 s, ~10% faster than BS
subsName = sys.argv[1]
surfName = sys.argv[2]
baseName = surfName.split('/')[-1].split('.')[0]

surf = Interface(
    tags=baseName,
    subAtoms=fio.read(subsName),
    allAtoms=fio.read(surfName),
)
surf.info['eV'] = 0.1
surf.print()

surf.draw('CPK', title='%s, %.3f eV' % (surf.get_formula(), surf.info['eV']))
surf.draw('BS', title='%s, %.3f eV' % (surf.get_formula(), surf.info['eV']))
Ejemplo n.º 2
0
srtDB = connect(sys.argv[2])

baseName = ''
eneList = []
for r in srtDB.select([('eV2GM', '<', 5.0)]):
    a = r.toatoms()
    eneList.append(r.eV)
    surf = Interface(
        allAtoms=a,
        subAtoms=substrate,
    )
    baseName = surf.tags
    surf.tags += '-%i' % r.id
    surf.draw(
        'BS',
        title='#%i, E=%.3f eV, mag=%.2f'%\
            (r.id, r.eV2GM, r.mag),
    )

# myImgList = [f for f in os.listdir() if baseName in f and 'png' in f]
# rp.gen_pdf_test(
#     projName='Global Optimization of Restructured %s'%baseName,
#     description=\
#         '\\begin{itemize}\n'+\
#         '\\item From direct BLDA sampling with random rattling of 0.1 Angstrom and Hookean pre-optimization.\n'+\
#         '\\item The same-element probability penalty is set to 50\%, and desorbed N$_2$ structures are filtered out.\n'+\
#         '\\item Color code: Ga - light brown; N - blue.\n'+\
#         '\\item For clarity, the constrained atoms are drawn in white, and the buffer atoms are drawn in shallow color.\n'+\
#         '\\end{itemize}',
#     imgList=myImgList,
# )
Ejemplo n.º 3
0
from gocia.interface import Interface
import sys, os
from gocia.ga.crossover import crossover_snsSurf_2d_GC

subs = sys.argv[1]
surf1 = sys.argv[2]
surf2 = sys.argv[3]

#surf0 = Interface(subAtoms=subs, allAtoms=subs)
surf1 = Interface(allAtoms=surf1, subAtoms=subs)
surf2 = Interface(allAtoms=surf2, subAtoms=subs)

surf1.print()
surf1.draw('CPK')
os.system('mv Ga47N51-cpk.png mom.png')

surf2.print()
surf2.draw('CPK')
os.system('mv Ga47N51-cpk.png dad.png')

#print(surf1.get_fixBufPos())
#print(surf1.get_fixBufAtoms())

nova = crossover_snsSurf_2d_GC(surf1, surf2)
nova.print()
nova.write('nova.vasp')
nova.draw('CPK')
os.system('mv Ga47N51-cpk.png kid.png')
tmp = nova.copy()

nova = tmp.copy()