コード例 #1
0
ファイル: e_2_geo.py プロジェクト: tarbaig/simpy
def convertors(b):
    #toGeo(b, b.name+'.geo')
    toGeo(b, 'geo')
    toXyz(b, b.name+'.xyz')
    toGjf(b, b.name+'.gjf')
    toPdb(b, b.name+'.pdb')
    toReaxLammps(b)
コード例 #2
0
def main():
    """get qm info
    """
    if len(sys.argv) < 2:
        print("g03.py logfile")
    else:
        for i in sys.argv[1:]:
            geo = i.split(".")[0]
            # get configuration
            a = G03LogConf(i)
            # get charge and energy (HF and Zero)
            b = G03tools(i)
            # parse the configuration to standard format
            c = a.parser()
            hf, zpe = b.getEnergy()
            o = open("qm_ener.dat", "w")
            o.write("%-15s HF %.8f\n" % (geo, hf))
            o.write("%-15s ZPE %.8f\n" % (geo, zpe))
            o.close()
            charges = b.getMullikenCharge()
            o = open("qm_mulliken_charge.dat", "w")
            for j in charges:
                o.write("%-15s%6s%6s%12s  # %s\n" %
                        (geo, "1", j[0], j[2], j[1]))
            o.close()
            charges = b.getESPCharge()
            o = open("qm_esp_charge.dat", "w")
            for j in charges:
                o.write("%-15s%6s%6s%12s  # %s\n" %
                        (geo, "1", j[0], j[2], j[1]))
            o.close()
            # freq calculation if quit normally
            if a.stat == 1:
                method = " ".join([j.strip() for j in c.methods])
                tokens = method.strip().split()
                for n in range(len(tokens)):
                    if "opt" in tokens[n]:
                        tokens[n] = "freq"
                    elif "geo" in tokens[n]:
                        tokens[n] = ''
                c.methods = [" ".join(tokens)]
                c.options = ["%mem=800MB"]
                toGjf(c, "freq.gjf")
            else:
                runfile = os.path.join(os.getcwd(), i)
                print("Warning: unfinished calculation!: %s" % runfile)
                method = " ".join([j.strip() for j in c.methods])
                tokens = method.strip().split()
                for n in range(len(tokens)):
                    if "geo" in tokens[n]:
                        tokens[n] = ''
                c.methods = [" ".join(tokens)]
                toGjf(c, "conti.gjf")
コード例 #3
0
ファイル: getEner.py プロジェクト: carlos-salgado/simpy
def main():
    """get qm info
    """
    if len(sys.argv) < 2:
        print "g03.py logfile"
    else:
        for i in sys.argv[1:]:
            geo = i.split(".")[0]
            # get configuration
            a = G03LogConf(i)
            # get charge and energy (HF and Zero)
            b = G03tools(i)
            # parse the configuration to standard format
            c = a.parser()
            hf, zpe = b.getEnergy()
            o = open("qm_ener.dat", "w")
            o.write("%-15s HF %.8f\n"%(geo, hf))
            o.write("%-15s ZPE %.8f\n"%(geo, zpe))
            o.close()
            charges = b.getCharge()
            o = open("qm_charge.dat", "w")
            for j in charges:
                o.write("%-15s%6s%6s%12s  # %s\n"%( geo, "1", j[0], j[2], j[1]))
            o.close()
            # freq calculation if quit normally
            if a.stat == 1:
                method = " ".join([j.strip() for j in c.methods])
                tokens = method.strip().split()
                for n in range(len(tokens)):
                    if "opt" in tokens[n]:
                        tokens[n] = "freq"
                    elif "geo" in tokens[n]:
                        tokens[n] = ''
                c.methods = [" ".join(tokens)]
                c.options = ["%mem=800MB"]
                toGjf(c, "freq.gjf")
            else:
                runfile = os.path.join(os.getcwd(), i)
                print "Warning: unfinished calculation!: %s"%runfile
                method = " ".join([j.strip() for j in c.methods])
                tokens = method.strip().split()
                for n in range(len(tokens)):
                    if "geo" in tokens[n]:
                        tokens[n] = ''
                c.methods = [" ".join(tokens)]
                toGjf(c, "conti.gjf")
コード例 #4
0
""" read the geo file and output to data (LAMMPS), geo and xyz file.
"""
import sys, os
from mytype import System, Molecule, Atom
from g03 import G03Gjf
from output_conf import toXyz, toGeo, toGjf

usage = """gau2xyz g03logfiles"""
if len(sys.argv) < 2:
    print usage
else:
    for i in sys.argv[1:]:
        outfile = i.split(".")[0]
        if os.path.exists(i):
            a = G03Gjf(i)
            b = a.parser()
            b.geotag = "BIOGRF 200"
            toXyz(b, outfile + ".xyz")
            toGeo(b, outfile + ".geo")
            toGjf(b, outfile + ".gjf.bak")
        else:
            print "missing file %s" % i
コード例 #5
0
ファイル: e_2_g03inp.py プロジェクト: carlos-salgado/simpy
""" read the geo file and output to data (LAMMPS), geo and xyz file.
"""
import sys, os
from mytype import System, Molecule, Atom
from g03 import G03Gjf
from output_conf import toXyz, toGeo, toGjf

usage = """gau2xyz g03logfiles"""
if len(sys.argv) < 2:
    print usage
else:
    for i in sys.argv[1:]:
        outfile = i.split(".")[0]
        if os.path.exists(i):
            a = G03Gjf(i)
            b = a.parser()
            b.geotag = "BIOGRF 200"
            toXyz(b, outfile+".xyz")
            toGeo(b, outfile+".geo")
            toGjf(b, outfile+".gjf.bak")
        else:
            print "missing file %s"%i