Skip to content

Commit

Permalink
update 11172014
Browse files Browse the repository at this point in the history
  • Loading branch information
ensemble-learning committed Nov 17, 2014
1 parent db7c798 commit 1b88dcb
Show file tree
Hide file tree
Showing 7 changed files with 583 additions and 3 deletions.
417 changes: 417 additions & 0 deletions env/matplotlibrc

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions examples/02_gaussian_split_basis_set/pt10_cl.gjf
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
%nprocshared=12
# opt=modredundant SCF=QC b3lyp/gen PSEUDO=READ

Title Card Required

-1 1
Pt 5.77400000 7.75900000 3.78900000
Pt 7.75900000 5.77400000 3.78900000
Pt 9.74400000 3.78900000 3.78900000
Pt 5.77400000 9.74400000 1.80400000
Pt 7.75900000 7.75900000 1.80400000
Pt 9.74400000 5.77400000 1.80400000
Pt 11.72900000 3.78900000 1.80400000
Pt 7.75900000 9.74400000 -0.18100000
Pt 9.74400000 7.75900000 -0.18100000
Pt 11.72900000 5.77400000 -0.18100000
Pt 9.74400000 9.74400000 -2.16600000
Pt 11.72900000 7.75900000 -2.16600000
Cl 10.43200000 8.77400000 2.26800000

X 1 F
X 2 F
X 3 F
X 4 F
X 5 F
X 6 F
X 7 F
X 8 F
X 9 F
X 10 F
X 11 F
X 12 F
X 13 F

Pt
lanL2DZ
****
Cl
6-311+g(d,p)
****

Pt 0
LANL2DZ





17 changes: 17 additions & 0 deletions examples/03_xyz2cfg/lammps_input
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

units real
atom_style charge
boundary p p p

read_data lammps.data

dump 1 all custom 1 dump.lammpstrj id type x y z vx vy vz
dump_modify 1 sort id
dump 101 all cfg 1 dump.*.cfg mass type xs ys zs vx vy vz fx fy fz
dump_modify 101 element Li Cl S O P

log rerun.log

#--------Simulation--------
rerun movie.xyz dump x y z box no format xyz

67 changes: 67 additions & 0 deletions lib/cfg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
"""cfg file
"""

from mytype import System, Molecule, Atom

class Cfg(filename):
"""cfg file
"""
def __init__(self, filename):
self.name = ""
self.pbc = []
self.a = []
self.b = []
self.c = []
self.read(filename)
self.natoms = 0

def read(self, filename):
""" read data from cfg file
"""
if filename.endswith(".cfg"):
self.name = filename[:-4]
else:
self.name = filename

f = open(filename, "r")
self.natoms = int(f.readline().strip().split("=")[-1])
f.readline() # unit
for i in range(3):
tokens = i.strip().split("=")[-1].split()[0]
self.a.append(float(tokens))
for i in range(3):
tokens = i.strip().split("=")[-1].split()[0]
self.b.append(float(tokens))
for i in range(3):
tokens = i.strip().split("=")[-1].split()[0]
self.c.append(float(tokens))
f.readline() # not sure the meaning of the line
n = int(f.readline().strip().split("=")[-1])
for i in range(n -3):
f.readline()

counter = 0
for i in range(self.natoms):
if counter % 3 == 0:
tokens = []
tokens.append(i.strip().split())
self.coords.append(token)
counter += 1

def parser(self,):
""" parse cfg to system
"""
s = System()
s.pbc = v2lattice(a, b, c)
s.natoms = self.natoms
for i in range(s.natoms):
atom = Atom()
atom.name = self.coords[i][1][0]
x = float(self.coords[i][2][0])
y = float(self.coords[i][2][1])
z = float(self.coords[i][2][2])
atom.x[0] = a[0]*x + b[0]*y + c[0]*z
atom.x[1] = a[1]*x + b[1]*y + c[1]*z
atom.x[2] = a[2]*x + b[2]*y + c[2]*z
s.atoms.append(atom)

24 changes: 24 additions & 0 deletions tools/Lammps/vidcompress
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh
# see http://www.cscs.ch/~mvalle/mencoder/mencoder.html

# touch ~/.mplayer/mencoder #

JPEG_DIR=Jpg
MPG_FILE=AtomEye.mpg

jpgfile=`ls $JPEG_DIR/ | grep --max-count=1 -i .jpg`

geometry=`identify -verbose $JPEG_DIR/$jpgfile | grep Geometry | cut -d: -f2`

height=`echo $geometry | cut -dx -f1`
width=`echo $geometry | cut -dx -f2`

optimal_bitrate=`echo "scale=0; 50 * 25 * $width * $height / 256" | bc -l`

rm -f $MPG_FILE

opt="vbitrate=$optimal_bitrate:mbd=2:keyint=132:vqblur=1.0:cmp=2:subcmp=2:dia=2:last_pred=3"

mencoder -ovc lavc -lavcopts vcodec=msmpeg4v2:vpass=1:$opt -mf type=jpg:fps=8 -nosound -o /dev/null mf://$JPEG_DIR/\*.jpg

mencoder -ovc lavc -lavcopts vcodec=msmpeg4v2:vpass=2:$opt -mf type=jpg:fps=8 -nosound -o $MPG_FILE mf://$JPEG_DIR/\*.jpg
11 changes: 9 additions & 2 deletions tools/hun/plot_fragtable.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,15 @@
if not os.path.exists("frag_details"):
os.mkdir("frag_details")
os.chdir("frag_details")
tmp = np.array([data[0], data[i]])
np.savetxt(head[i] + ".dat", tmp)
if (0):
tmp = np.array([data[0], data[i]])
np.savetxt(head[i] + ".dat", tmp)
if (1):
o = open(head[i] + ".csv", "w")
for j in range(len(data[0])):
if j%1 == 0:
o.write("%.4f, %.4f\n"%(data[0][j], data[i][j]))
o.close()
os.chdir("..")

#plot the temperature
Expand Down
2 changes: 1 addition & 1 deletion tools/vasp/get_potcar.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
POT = {"N":"N", "O":"O", "H":"H", "C":"C", "Li":"Li", "S":"S", "Ti":"Ti", "P":"P",
"Ca":"Ca_pv", "Al":"Al", "Cu":"Cu", "Na":"Na", "Cl":"Cl", "Cr":"Cr", "Ga":"Ga",
"Br":"Br", "D": "H", "Si": "Si", "Ni": "Ni", "Pt":"Pt"}
POT_DATA_BASE = "/project/source/VASP/vasp.5.2/potcar/potpaw_PBE"
POT_DATA_BASE = "/project/source/VASP/vasp.5.3.5/potcar/potpaw_PBE"

o = open("POTCAR", "w")
a = Poscar("POSCAR")
Expand Down

0 comments on commit 1b88dcb

Please sign in to comment.