从上周三开完组会一直到现在都还没怎么缓过神来,不能再这样下去了😟,得主动出击。早上起来忧心忡忡的,高分子物理没心情上,吃完早饭直接去鼎新馆吧。昨晚大概M$入门了,建模后提交了任务,但是可能INCAR里面参数设置得不够合理,今天下午提交的任务才收敛。尝试想了一些方案但是被师兄否定了,提高电解质中离子电导率的机理也许是清楚的,但是没有一篇明晰的文献手把手教我应该挑选那些元素掺杂来提高离子电导率,也许永远不会吧🥺。Keep on going,再试试吧,多读读文献,也许我现在的困境和英语只有60分的同学所面临的困境相似吧?——都是词汇量不够?
''' 分析AIMD结果,计算MSD 和 conductivity ''' import os from pymatgen.core.trajectory import Trajectory from pymatgen.io.vasp.outputs import Xdatcar from pymatgen.core import Structure from pymatgen.analysis.diffusion.analyzer import DiffusionAnalyzer import numpy as np import pickle import matplotlib.pyplot as plt
[ctan@baifq-hpc141 primitive-slab-opt-1]$ grep ' without' OUTCAR energy without entropy= -13.96941183 energy(sigma->0) = -13.97673168 energy without entropy= -13.96945528 energy(sigma->0) = -13.97676958 energy without entropy= -13.97006413 energy(sigma->0) = -13.97726241 energy without entropy= -13.97020643 energy(sigma->0) = -13.97735554 energy without entropy= -13.97017969 energy(sigma->0) = -13.97735013
slab模型优化后的结构信息
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
CONTCAR\(1\1\1) 1.00000000000000 2.5701000690000000 0.0000000000000000 0.0000000000000000 -1.2850500345000000 2.2257719501000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 21.2954006195000005 Cu/0e71e558f37 4 Selective dynamics Direct 0.0000000000000000 0.0000000000000000 0.0000000000000000 F F F 0.6666700000000034 0.3333299999999966 0.0985399999999998 F F F 0.3333311322281505 0.6666688677718494 0.1972481653092927 T T T -0.0000004145140272 0.0000004145140272 0.2951613337135311 T T T
[ctan@baifq-hpc141 primitive-slab-opt-1]$ grep ' without' .bulk-calc/OUTCAR energy without entropy= -14.90258332 energy(sigma->0) = -14.90537746 energy without entropy= -14.90568039 energy(sigma->0) = -14.90844732 energy without entropy= -14.90859467 energy(sigma->0) = -14.91129762
[ctan@baifq-hpc141 conventional-slab-opt]$ grep ' without' OUTCAR energy without entropy= -55.94972046 energy(sigma->0) = -55.94434499 energy without entropy= -55.94997517 energy(sigma->0) = -55.94458201 energy without entropy= -55.95396000 energy(sigma->0) = -55.94820485 energy without entropy= -55.95519341 energy(sigma->0) = -55.94928561 energy without entropy= -55.95554732 energy(sigma->0) = -55.94959634 energy without entropy= -55.95713778 energy(sigma->0) = -55.95095507 energy without entropy= -55.95788514 energy(sigma->0) = -55.95158140 energy without entropy= -55.95893404 energy(sigma->0) = -55.95242747 energy without entropy= -55.95963672 energy(sigma->0) = -55.95296199 energy without entropy= -55.96031694 energy(sigma->0) = -55.95340564 energy without entropy= -55.96050719 energy(sigma->0) = -55.95349958 energy without entropy= -55.96053048 energy(sigma->0) = -55.95316488 energy without entropy= -55.96067995 energy(sigma->0) = -55.95346716 energy without entropy= -55.96069855 energy(sigma->0) = -55.95356576 energy without entropy= -55.96051601 energy(sigma->0) = -55.95360396 energy without entropy= -55.96050802 energy(sigma->0) = -55.95361124 energy without entropy= -55.96041586 energy(sigma->0) = -55.95360050 energy without entropy= -55.96018279 energy(sigma->0) = -55.95347398
[ctan@baifq-hpc141 conventional-slab-opt]$ grep ' without' .bulk-calc/OUTCAR energy without entropy= -14.90258332 energy(sigma->0) = -14.90537746 energy without entropy= -14.90568039 energy(sigma->0) = -14.90844732 energy without entropy= -14.90859467 energy(sigma->0) = -14.91129762
[ctan@baifq-hpc141 primitive-opt]$ grep ' without' .bulk/OUTCAR energy without entropy= -21.88865316 energy(sigma->0) = -21.88759144 energy without entropy= -21.88930785 energy(sigma->0) = -21.88825056 energy without entropy= -21.89056178 energy(sigma->0) = -21.88952707
弛豫与未弛豫的slab模型的能量信息:
1 2 3 4 5 6 7 8
[ctan@baifq-hpc141 primitive-opt]$ grep ' without' OUTCAR energy without entropy= -25.97155386 energy(sigma->0) = -25.97291371 energy without entropy= -25.97233802 energy(sigma->0) = -25.97366730 energy without entropy= -25.97412653 energy(sigma->0) = -25.97534340 energy without entropy= -25.97511519 energy(sigma->0) = -25.97602399 energy without entropy= -25.97516432 energy(sigma->0) = -25.97619350 energy without entropy= -25.97516747 energy(sigma->0) = -25.97619463 energy without entropy= -25.97517140 energy(sigma->0) = -25.97620156
SYSTEM = p(1x1)Cu(111) 1.0 2.5701000690 0.0000000000 0.0000000000 -1.2850500345 2.2257719501 0.0000000000 0.0000000000 0.0000000000 21.2954006195 Cu 4 Selective Dynamics Direct 0.000000000 0.000000000 0.000000000 F F F 0.666670000 0.333330000 0.098540000 F F F 0.333330000 0.666670000 0.197080000 T T T 0.000000000 0.000000000 0.295620000 T T T
SYSTEM = p(1x1)Cu(111) 1.0 2.5701000690 0.0000000000 0.0000000000 -1.2850500345 2.2257719501 0.0000000000 0.0000000000 0.0000000000 21.2954006195 Cu 4 Selective Dynamics Direct 0.000000000 0.000000000 0.000000000 F F F 0.666670000 0.333330000 0.098540000 F F F 0.333330000 0.666670000 0.197080000 T T T 0.000000000 0.000000000 0.295620000 T T T [ctan@baifq-hpc141 primitive-slab-opt-1]$ cat CONTCAR CONTCAR\(1\1\1) 1.00000000000000 2.5701000690000000 0.0000000000000000 0.0000000000000000 -1.2850500345000000 2.2257719501000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 21.2954006195000005 Cu/0e71e558f37 4 Selective dynamics Direct 0.0000000000000000 0.0000000000000000 0.0000000000000000 F F F 0.6666700000000034 0.3333299999999966 0.0985399999999998 F F F 0.3333311322281505 0.6666688677718494 0.1972481653092927 T T T -0.0000004145140272 0.0000004145140272 0.2951613337135311 T T T
#!/usr/bin/env python # -*- coding: utf-8 -*- #Convert direc coordiation to cartesian Writen By Qiang and Xu Nan """ The right input way to run this script is : python dire2cart.py CONTCAR 3 CONTCAR will be converted from Direct to Cartesian and 3 layers will be fixed. If you do not want to fix layers and keep the same as before, run command: python dire2cat.py CONTCAR """
import sys import os import numpy as np
print'Please read the head part of this script and get more information!' print""" ################################### # # #for VASP 5.2 or higher versions # # # ################################### """
iflen(sys.argv) <= 1: print('\n' + ' Warning! ' * 3 + '\n') print('You did not select the inputfile to be converted. \n By defalut, we are going to convert your CONTCAR.\n') ifnot os.path.isfile("POSCAR") andnot os.path.isfile("CONTCAR"): print("Error:" * 3 + "\n Can not find neither POSCAR nor CONTCAR!!\n") exit() else: if os.path.isfile("CONTCAR"): script = sys.argv[0] file_to_be_converted = "CONTCAR" print"\n Convertion starts........\n" else: script = sys.argv[0] file_to_be_converted = "POSCAR" print"\n There is no CONTCAR in your directory. \n \n POSCAR Convertion starts........\n" iflen(sys.argv) == 2: print("\n%s Convertion starts......" %sys.argv[1]) script, file_to_be_converted = sys.argv[:2] else: print("\n%s Convertion starts......\n" %sys.argv[1]) script, file_to_be_converted, fixedlayer = sys.argv[:3] fixedlayer = int(fixedlayer)
defget_infor(): f = open(file_to_be_converted, 'r') lines = f.readlines() f.close() num_atoms = sum([int(x) for x in lines[6].split()]) if lines[7][0] == 'S'or lines[7][0] == 's': # # With Selected T T T, coordination starts from line 9 start_num = 9 if lines[8][0] == 'D'or lines[8][0] == 'd': is_direct = True else: is_direct = False else: start_num = 8 print'----------------------------------------------------' print'Pay Attetion! There is no TTT in %s ' %(file_to_be_converted) print'----------------------------------------------------' if lines[7][0] == 'D'or lines[7][0] == 'd': is_direct = True else: is_direct = False a = [] b = [] c = [] if is_direct: for i in np.arange(2,5): line = [float(i) for i in lines[i].strip().split()] a.append(line[0]) b.append(line[1]) c.append(line[2]) vector = np.array([a,b,c]) else: vector = np.array([[1, 0 , 0], [0, 1, 0], [0, 0, 1]]) return vector, lines, start_num, num_atoms, is_direct
defdeterminelayers(z_cartesian): threshold = 0.5 seq = sorted(z_cartesian) min = seq[0] layerscount = {} sets = [min] for j inrange(len(seq)): ifabs(seq[j]-min) >= threshold: min = seq[j] sets.append(min)
for i inrange(1,len(sets)+1): layerscount[i] = [] for k inrange(len(z_cartesian)): ifabs(z_cartesian[k]-sets[i-1]) <= threshold: layerscount[i].append(k)
return layerscount
defconvert(): x_cartesian = [] y_cartesian = [] z_cartesian = [] tf = [] for i inrange(start_num, num_atoms + start_num): line_data = [float(ele) for ele in lines[i].split()[0:3]] line_data = np.array([line_data]) x, y, z = [sum(k) for k in line_data * vector ] x_cartesian.append(x) y_cartesian.append(y) z_cartesian.append(z) if start_num == 9 : # if T T T exist, the start_num will be 9 tf.append((lines[i].split()[3:])) else: tf.append(' ') # if there is no T T T, use space instead.
layerscount =determinelayers(z_cartesian) file_out = open(file_to_be_converted+'_C', 'w') for i inrange(0,7): file_out.write(lines[i].rstrip() + '\n') # first 7 lines are kept the same print'\n Find %s layers!' * 3 %(len(layerscount), len(layerscount), len(layerscount)) iflen(sys.argv) >= 3: # This means that the nuber for fixing layers is given by the user. file_out.write('Selective\n') file_out.write('Cartesian' + '\n') for i inrange(1,len(layerscount)+1): if i <= fixedlayer: for j in layerscount[i]: tf[j] = ['F','F','F'] else: for k in layerscount[i]: tf[k] = ['T','T','T'] else: if start_num == 9: # 9 means there are T T T or F F F in the file file_out.write('Selective\n') file_out.write('Cartesian' + '\n') else: file_out.write('Cartesian' + '\n') for i inrange(0,len(x_cartesian)): file_out.write("\t%+-3.10f %+-3.10f %+-3.10f %s\n" %(x_cartesian[i], y_cartesian[i], z_cartesian[i], ' '.join(tf[i]))) file_out.close() vector, lines, start_num, num_atoms, is_direct = get_infor()
if is_direct : print"\n%s has Direct Coordinates, Contersion starts.... " %(file_to_be_converted) convert() else: print"\n%s has Cartesian Coordinates Already! We are going to fix layers only." %(file_to_be_converted) convert() print'-----------------------------------------------------\n' print'\n %s with Cartesian Coordiates is named as %s_C\n' %(file_to_be_converted, file_to_be_converted) print'-----------------------------------------------------\n'
[ctan@baifq-hpc141 primitive-slab-opt-1]$ cat POSCAR_C CONTCAR\(1\1\1) 1.0 2.5701000690 0.0000000000 0.0000000000 -1.2850500345 2.2257719501 0.0000000000 0.0000000000 0.0000000000 21.2954006195 Cu 4 Selective Cartesian +0.0000000000 +0.0000000000 +0.0000000000 F F F +1.2850628850 +0.7419165641 +2.0984487770 F F F -0.0000128505 +1.4838553860 +4.1968975541 T T T +0.0000000000 +0.0000000000 +6.2953463311 T T T
CONTCAR_C
1 2 3 4 5 6 7 8 9 10 11 12 13 14
[ctan@baifq-hpc141 primitive-slab-opt-1]$ cat CONTCAR_C CONTCAR\(1\1\1) 1.00000000000000 2.5701000690000000 0.0000000000000000 0.0000000000000000 -1.2850500345000000 2.2257719501000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 21.2954006195000005 Cu/0e71e558f37 4 Selective Cartesian +0.0000000000 +0.0000000000 +0.0000000000 F F F +1.2850628850 +0.7419165641 +2.0984487770 F F F -0.0000084856 +1.4838528659 +4.2004787017 T T T -0.0000015980 +0.0000009226 +6.2855788488 T T T
[ctan@baifq-hpc141 primitive-slab-opt-1]$ grep ' without' OUTCAR energy without entropy= -13.96941183 energy(sigma->0) = -13.97673168 energy without entropy= -13.96945528 energy(sigma->0) = -13.97676958 energy without entropy= -13.97006413 energy(sigma->0) = -13.97726241 energy without entropy= -13.97020643 energy(sigma->0) = -13.97735554 energy without entropy= -13.97017969 energy(sigma->0) = -13.97735013
CONTCAR\(1\1\1) 1.0 2.5701000690 0.0000000000 0.0000000000 -1.2850500345 2.2257719501 0.0000000000 0.0000000000 0.0000000000 21.2954006195 Cu 4 Selective Dynamics Direct 0.000000000 0.000000000 0.000000000 F F F 0.666670000 0.333330000 0.098540000 F F F 0.333330000 0.666670000 0.197080000 T T T 0.000000000 0.000000000 0.295620000 T T T
[ctan@baifq-hpc141 primitive-slab-opt]$ grep ' without' OUTCAR energy without entropy= -13.96941183 energy(sigma->0) = -13.97673168 energy without entropy= -13.96945528 energy(sigma->0) = -13.97676958 energy without entropy= -13.97006413 energy(sigma->0) = -13.97726241 energy without entropy= -13.97020643 energy(sigma->0) = -13.97735554 energy without entropy= -13.97017969 energy(sigma->0) = -13.97735013
计算时间:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
General timing and accounting informations for this job: ========================================================
Total CPU time used (sec): 53.453 User time (sec): 49.556 System time (sec): 3.896 Elapsed time (sec): 55.466
Maximum memory used (kb): 134456. Average memory used (kb): N/A
Minor page faults: 12550 Major page faults: 686 Voluntary context switches: 1587
General timing and accounting informations for this job: ========================================================
Total CPU time used (sec): 93.113 User time (sec): 87.076 System time (sec): 6.036 Elapsed time (sec): 94.073
Maximum memory used (kb): 126136. Average memory used (kb): N/A
Minor page faults: 11497 Major page faults: 687 Voluntary context switches: 1456
能量信息:
1 2 3 4 5 6 7 8 9 10 11 12
[ctan@baifq-hpc141 primitive-slab-opt-2]$ grep ' without' OUTCAR energy without entropy= -13.96941183 energy(sigma->0) = -13.97673168 energy without entropy= -13.96949582 energy(sigma->0) = -13.97680372 energy without entropy= -13.96971572 energy(sigma->0) = -13.97698803 energy without entropy= -13.97005607 energy(sigma->0) = -13.97725330 energy without entropy= -13.97030617 energy(sigma->0) = -13.97735559 energy without entropy= -13.97026927 energy(sigma->0) = -13.97738319 energy without entropy= -13.97031853 energy(sigma->0) = -13.97745396 energy without entropy= -13.97042910 energy(sigma->0) = -13.97762319 energy without entropy= -13.97041285 energy(sigma->0) = -13.97773496 energy without entropy= -13.97039032 energy(sigma->0) = -13.97772890 energy without entropy= -13.97040171 energy(sigma->0) = -13.97773244
POTLOK: cpu time 0.0215: real time 0.0258 SETDIJ: cpu time 0.0109: real time 0.0118 EDDAV: cpu time 0.7451: real time 0.7613 DOS: cpu time 0.0052: real time 0.0060 -------------------------------------------- LOOP: cpu time 0.7826: real time 0.8050
eigenvalue-minimisations : 2548 total energy-change (2. order) : 0.3445715E+03 (-0.1837296E+04) number of electron 44.0000000 magnetization augmentation part 44.0000000 magnetization
DIPCOR: dipole corrections for dipol direction 3 min pos 155, dipolmoment 0.000000 0.000000 0.000026 electrons x Angstroem Tr[quadrupol] -31.061780
energy correction for charged system 0.000000 eV dipol+quadrupol energy correction -0.000000 eV added-field ion interaction 0.001451 eV (added to PSCEN)
Free energy of the ion-electron system (eV) --------------------------------------------------- alpha Z PSCENC = 96.14159556 Ewald energy TEWEN = 16384.30326894 -Hartree energ DENC = -21746.47963692 -exchange EXHF = 0.00000000 -V(xc)+E(xc) XCENC = 182.01436818 PAW double counting = 4912.82663951 -5336.19386850 entropy T*S EENTRO = 0.00034874 eigenvalues EBANDS = 288.07434016 atomic energy EATOM = 5563.88447798 Solvation Ediel_sol = 0.00000000 --------------------------------------------------- free energy TOTEN = 344.57153365 eV
energy without entropy = 344.57118491 energy(sigma->0) = 344.57141740
----------------------------------------------------------------------------- | | | EEEEEEE RRRRRR RRRRRR OOOOOOO RRRRRR ### ### ### | | E R R R R O O R R ### ### ### | | E R R R R O O R R ### ### ### | | EEEEE RRRRRR RRRRRR O O RRRRRR # # # | | E R R R R O O R R | | E R R R R O O R R ### ### ### | | EEEEEEE R R R R OOOOOOO R R ### ### ### | | | | Error EDDDAV: Call to ZHEGV failed. Returncode = 7 1 8 | | | | ----> I REFUSE TO CONTINUE WITH THIS SICK JOB ... BYE!!! <---- | | | -----------------------------------------------------------------------------