Exemple #1
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("fname",
                        default="ffield",
                        nargs="?",
                        help="force field file name")
    parser.add_argument("-D", action="store_true", help="Debug the code")
    parser.add_argument("-trans",
                        action="store_true",
                        help="transform ffield to more readable format")
    parser.add_argument("-params",
                        action="store_true",
                        help="generate params for training")
    parser.add_argument("-complete",
                        action="store_true",
                        help="complete the off table")
    parser.add_argument(
        "-type",
        nargs=1,
        type=int,
        help="Force field type: 0 for vdw; 1 for lg_inner wall")
    parser.add_argument("-checkout",
                        nargs='+',
                        help="check out the force field")
    parser.add_argument("-check",
                        action="store_true",
                        help="check the force field")
    args = parser.parse_args()
    #print b.getBondDist(3,2)

    fname = args.fname

    assert os.path.exists(fname)

    if args.D:
        DEBUG = 1

    if args.type:
        ntype = args.type[0]
    else:
        ntype = 0
        print "Note: Using default force field type"

    ff = Ffield(fname, ntype)
    if args.trans:
        ff.toEquation()
    if args.params:
        ff.toParams()
    if args.complete:
        ff.completeOff()
        toFfield(ff)
    if args.checkout:
        atoms = args.checkout
        ff2 = ff.checkout(atoms)
        toFfield(ff2)
    if args.check:
        ff.checkRedudant()
Exemple #2
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("fname", default="ffield", nargs="?", help="force field file name")
    parser.add_argument("-D", action="store_true", help="Debug the code")
    parser.add_argument("-trans", action="store_true", help="transform ffield to more readable format")
    parser.add_argument("-params", action="store_true", help="generate params for training")
    parser.add_argument("-complete", action="store_true", help="complete the off table")
    parser.add_argument("-type", nargs=1, type=int, help="Force field type: 0 for vdw; 1 for lg_inner wall")
    parser.add_argument("-checkout", nargs='+', help="check out the force field")
    parser.add_argument("-check", action="store_true", help="check the force field")
    args = parser.parse_args()
    #print b.getBondDist(3,2)
    
    fname = args.fname

    assert os.path.exists(fname)

    if args.D:
        DEBUG = 1

    if args.type:
        ntype = args.type[0]
    else:
        ntype = 0
        print "Note: Using default force field type"

    ff = Ffield(fname, ntype)
    if args.trans:
        ff.toEquation()
    if args.params:
        ff.toParams()
    if args.complete:
        ff.completeOff()
        toFfield(ff)
    if args.checkout:
        atoms = args.checkout
        ff2 = ff.checkout(atoms)
        toFfield(ff2)
    if args.check:
        ff.checkRedudant()
Exemple #3
0
def test():
    fname = "ffield"
    ntype = 0
    ff = Ffield(fname, ntype)
    ff2 = ff.checkout()
    toFfield(ff2)
Exemple #4
0
n = int(input("parameter to change: "))

temp = float(t[nt][n]) #r0 in eq (2)

scale = float(input("scale factor: "))

flag = input("Continue:yes(1);no(0): ")
if int(flag):
    # Increase
    if not os.path.exists("in"):
        os.mkdir("in")
    os.chdir("in")
    increase = 1.0 + scale
    t[nt][n] = "%.4f"%(temp*increase)
    toFfield(ff, "ffield")
    os.system("bash ./run.sh")
    os.chdir("..")
    # Original
    if not os.path.exists("or"):
        os.mkdir("or")
    os.chdir("or")
    origin = 1.0
    t[nt][n] = "%.4f"%(temp*origin)
    toFfield(ff, "ffield")
    os.system("bash ./run.sh")
    os.chdir("..")
    # Decrease
    if not os.path.exists("de"):
        os.mkdir("de")
    os.chdir("de")
Exemple #5
0
n = int(raw_input("parameter to change: "))

temp = float(t[nt][n]) #r0 in eq (2)

scale = float(raw_input("scale factor: "))

flag = raw_input("Continue:yes(1);no(0): ")
if int(flag):
    # Increase
    if not os.path.exists("in"):
        os.mkdir("in")
    os.chdir("in")
    increase = 1.0 + scale
    t[nt][n] = "%.4f"%(temp*increase)
    toFfield(ff, "ffield")
    os.system("bash ./run.sh")
    os.chdir("..")
    # Original
    if not os.path.exists("or"):
        os.mkdir("or")
    os.chdir("or")
    origin = 1.0
    t[nt][n] = "%.4f"%(temp*origin)
    toFfield(ff, "ffield")
    os.system("bash ./run.sh")
    os.chdir("..")
    # Decrease
    if not os.path.exists("de"):
        os.mkdir("de")
    os.chdir("de")
Exemple #6
0
def test1():
    fname = "ffield"
    ntype = 0
    ff = Ffield(fname, ntype)
    ff2 = ff.checkout()
    toFfield(ff2)
Exemple #7
0
import os
from ffield import Ffield
from output_ff import toFfield

ff = Ffield("ffield")
toFfield(ff, "ffield.new")