def logo(): if np.random.rand()>0.5: s=[None]*4 s[0]=" _ _ _ _ _ _ _ " s[1]=" / \ / \ / \ / \ / \ / \ / \ " s[2]="( m | a | p | t | o | o | l )" s[3]=" \_/ \_/ \_/ \_/ \_/ \_/ \_/ " else: s=[None]*6 s[0]=" _ _ " s[1]=" _ __ ___ __ _ _ __ | |_ ___ ___ | |" s[2]="| '_ ` _ \ / _` | '_ \| __/ _ \ / _ \| |" s[3]="| | | | | | (_| | |_) | || (_) | (_) | |" s[4]="|_| |_| |_|\__,_| .__/ \__\___/ \___/|_|" s[5]=" |_| " for i in range(len(s)): box_center(ch=s[i])
def main(): parser = OptionParser() parser.set_defaults( Is_run = True, struct_oper= False, struct_ana= False, vasp_inout=False, vasp_auto=False, online_extract=False, cell_filename=None, molecule_filename=None ) parser.add_option("--struct_operation",dest="struct_oper", action="store_true",help='structure operation') parser.add_option("--struct_analysis", dest="struct_ana", action="store_true",help='structure analysis') parser.add_option("--vasp_inout", dest="vasp_inout", action="store_true",help='create vasp input and analysis vasp output') parser.add_option("--vasp_auto", dest="vasp_auto", action="store_true",help='vasp automatic calculation') parser.add_option("-l","--logo", dest="Is_logo", action="store_true",help='show logo of pymat4vasp') parser.add_option("-v", "--version", dest="Is_version", action="store_true") parser.add_option("--clean", dest="Is_clean", action="store_true") parser.add_option("--ck", dest="check_file", action="store_true") parser.add_option("-r", "--run", dest="Is_run", action="store_true") parser.add_option("-i", "--info", dest="Is_info", action="store_true") parser.add_option("-c", "--cell", dest="cell_filename",action="store", type="string",help="Read crystal structure", metavar="FILE") parser.add_option("-m", "--molecule", dest="molecule_filename",action="store", type="string",help="Read molecule structure", metavar="FILE") (options, args) = parser.parse_args() rmvasp=''' rm -f IBZKPT CHG* CONTCAR DOSCAR EIGENVAL OSZICAR OUTCAR PCDAT XDATCAR WAVECAR *err* vasprun.xml *out* *log* PARCHG* PROCAR ACF.dat AECCAR0 AECCAR1 AECCAR2 AVF.dat BCF.dat ELFCAR BAND* REPORT DYNMAT FORCE_CONSTANTS *.conf COMPLETE RELAXED *.eps *.xyz vasp.std* *.json *.png ''' # print options.Is_v,options.Is_clean,options.Is_plot,options.Is_job,options.Is_run ck_cmd="head POSCAR ; grep --color=auto VRHFIN POTCAR ; head KPOINTS" if options.check_file: options.Is_run=False os.system(ck_cmd) if options.Is_version: options.Is_run=False box_center(ch='-',fill='-',sp="+") version() box_center(ch='-',fill='-',sp="+") if options.Is_logo: options.Is_run=False box_center(ch='-',fill='-',sp="+") logo() box_center(ch='') box_center(ch='-',fill='-',sp="+") if options.Is_info: options.Is_run=False info() if options.Is_clean: options.Is_run=False os.system(rmvasp) # if options.Is_plot: # try: # import matplotlib.pyplot as pl # print("matplotlib is ok") # except: # print("Unable to load pyplot! Function PyGec.visual(...) will not work!") if options.Is_run: T1=time() hello() print_menu() byebye() T2=time() print("Total Time: %.3f (s) "%(T2-T1))
def hello(): box_center(ch='-', fill='-', sp="+") logo() box_center(ch='') version() box_center(ch='') box_center(ch='Written by Wang haidi') box_center(ch='URL https://github.com/haidi-ustc') box_center(ch='Bug reports:([email protected])') box_center(ch='-', fill='-', sp="+")
def byebye(): box_center(ch='-', fill='-', sp="+") box_center(ch='*BYEBYE*') box_center(ch="Thanks for using " + NAME) box_center(ch="Have a nice day!!!") box_center(ch="Please cite: Nanoscale 9 (2), 850-855") box_center( ch="https://scholar.google.com/citations?hl=zh-CN&user=9PPScBEAAAAJ") box_center(ch='-', fill='-', sp="+")
def version(): version=" VERSION 0.1.1 (2018.10.29) " box_center(ch=version)