Exemple #1
0
#!/usr/bin/python

import sys
import numpy as np
import pyMolecular.atomicUtils as au

# === read input

fname = sys.argv[1]
celname = sys.argv[2]
nabc = np.array((int(sys.argv[3]), int(sys.argv[4]), int(sys.argv[5])))

# === main

lvec = np.genfromtxt(celname)
xyzs, Zs, enames = au.loadAtoms(fname)

enames_ = []
Zs_ = []
xyzs_ = []
for ia in range(nabc[0]):
    for ib in range(nabc[1]):
        for ic in range(nabc[2]):
            xyzs_.append(xyzs + (lvec[0] * ia + lvec[1] * ib +
                                 lvec[0] * ic)[np.newaxis, :])
            enames_ += enames
            Zs_.append(Zs)
Zs_ = np.concatenate(Zs_)
xyzs_ = np.concatenate(xyzs_)

au.saveXyz(fname + '_%ix%ix%i.xyz' % (nabc[0], nabc[1], nabc[2]), enames_,
Exemple #2
0
                                  dtype=[('symbol', '|S4'), ('i1', np.int32),
                                         ('i2', np.int32), ('i3', np.int32),
                                         ('i4', np.int32), ('R', np.float64),
                                         ('eps', np.float64),
                                         ('alpha', np.int32)],
                                  usecols=(0, 1, 2, 3, 4, 5, 6))
    print "atomTypes_dat ", atomTypes_dat

    #for a in atomTypes_dat:
    #    print a
    #    print a[0]
    #    print a[1]
    atomTypes_dct = {a[0]: (a[5], a[6]) for a in atomTypes_dat}
    print "atomTypes_dct ", atomTypes_dct

    water = au.loadAtoms("inputs/water_T5_ax.xyz")
    #print Campher
    campher = au.loadAtoms("inputs/Campher.xyz")
    #print Campher
    surf = au.loadAtoms("inputs/Cu111_6x6_2L.xyz")
    #print Surf

    #print water
    #exit()

    cell = [[15.31593, 0.0, 0.0], [0.0, 13.26399, 0.0], [0.0, 0.0, 20.0]]
    '''
    #rots  = sphereTangentSpace(n=100)
    rots  = randomRotations(n=10000)
    rots = pruneRots(rots, dcut=0.3, ipiv=2)
    #rots = getSimilarRotations( rots, rots[0], dcut=0.1, ipiv=2)
import os
import numpy as np
import pyMolecular.RigidMol as rmol
import pyMolecular.atomicUtils as au

#import pyMolecular.RigidMol

os.chdir(
    "/u/25/prokoph1/unix/git/SimpleSimulationEngine/cpp/Build/apps/MolecularEditor2"
)

#Cu          = np.genfromtxt  ( "inputs/Campher.xyz",      dtype= None, skip_header=2 )
#atoms       = np.genfromtxt  ( "inputs/Cu111_6x6_2L.xyz", dtype= None, skip_header=2 )
#print "atoms", atoms

Campher = au.loadAtoms("inputs/Campher.xyz")
#print Campher
Surf = au.loadAtoms("inputs/Cu111_6x6_2L.xyz")
#print Surf

nAtomCampher = len(Campher[0])
es = Campher[0] + Surf[0]
xyzs = np.hstack([np.array(Campher[1:4]),
                  np.array(Surf[1:4])]).transpose().copy()
'''
print "============================="
print "xyzs.shape", xyzs.shape
print "xyzs", xyzs
print es
au.saveXYZ( es, xyzs, "test_Cu+Campher.xyz" )
'''