コード例 #1
0
def do_restart(gl, gver='d'):
    comname = os.path.splitext(gl.name)[0] + '.com'
    gc = GC(comname)
    for atom,xyz in zip(gc.atoms_list, gl.final_geometry):
        atom.SetVector(xyz.GetVector())
    newcomname = misc.increment_filename(comname)
    # reduce scan steps accordingly
    steps_done = len(gl.bytedict['orientation:'])-1
    print steps_done
    if steps_done:  
        print steps_done
        for modred in gc.modreds:
            if modred.action == 'S':# this FAILs for multi- scans
                modred.scan_num_pts -= steps_done
    gc.write_to_file(newcomname)
    queue = guess_queue(newcomname) 
    gsub(newcomname, queue, gver)
コード例 #2
0
ファイル: gau_log2com.py プロジェクト: sperezl/oniomMacGyver
def get_args():
    "Parse arguments of gau_log2com.py"
    parser = argparse.ArgumentParser(
        description="""
            Reads a structure from a Gaussian Log file and other parameters from a  
            Gaussian Com file and creates a new Gaussian Com.""",
        formatter_class=argparse.RawTextHelpFormatter)

    parser.add_argument('log', help='gaussian log filename')

    parser.add_argument('-s', '--scan_step',
                        help='scan step (default = last = 0)',
                        default=0,
                        type=int)
    parser.add_argument('-o', '--opt_step',
                        help='opt step  (default = last = 0)',
                        default=0,
                        type=int)
    parser.add_argument('--new_com',
                        help='new com name (default = increment template com)',
                        default='')
    parser.add_argument('--template_com',
                        help='(default = same name as .log)',
                        default='')

    args = parser.parse_args()
    if args.template_com == '':
        args.template_com = os.path.splitext(args.log)[0] + '.com'
    if args.new_com == '':
        args.new_com = increment_filename(args.template_com)
    if os.path.exists(args.new_com):
        sys.stderr.write(
            '{0} already exists. Aborting.\n'.format(args.new_com))
        sys.exit(2)
    args.scan_step -= 1
    args.opt_step -= 1

    return args