Beispiel #1
0
        recal_outcar = os.path.join(path, args.outcar)
        org_outcar = os.path.normpath(os.path.join(
            path, os.pardir))  #os.path.join(path,'')
        org_outcar = os.path.join(org_outcar, args.outcar)
        #    print(path)
        _, _, e_std_tr, f_std_tr, v_std_tr, train_size = stds(recal_outcar)
        _, _, e_std_all, f_std_all, v_std_all, data_size = stds(org_outcar, 0)
        e_bar, v_bar, e_std_eq, f_std_eq, v_std_eq, _ = stds(
            org_outcar, args.excudedfraction)

        #        deepmd_path = os.path.join(path,'deepmd')

        inputs['system'] = deepmd_path

        num_test, sigma, natoms, l2e_test, l2ea_test, l2f_test, l2v_test = test_ener(
            inputs)
        num_tr, sigma, natoms, l2e_tr, l2ea_tr, l2f_tr, l2v_tr = train_ener(
            inputs)

        phase = get_phase(path)
        #    print(e_std,f_std,v_std )
        vol, sigma, kp = extract_sigma_vol_kp_outcar(org_outcar)
        pii = np.mean(v_bar[:3]) / vol * eV_A3_2_GPa
        p = pii + kp / 10  # in GPa
        #    print(vol, sigma)
        t = round(sigma / boltz)
        l2v_test_gpa = l2v_test / vol * eV_A3_2_GPa
        l2v_tr_gpa = l2v_tr / vol * eV_A3_2_GPa

        out.append([
            vol, t, p, e_bar, natoms, sigma, e_std_all, f_std_all, v_std_all,
Beispiel #2
0
            sigma = float(line.split('SIGMA')[1].split('=')[1].split()[0])
            get_sigma = True
        if 'volume of cell' in line:
            vol = float(line.split('volume of cell')[1].split(':')[1].split()[0])
            get_vol = True
        if get_vol and get_sigma:
            outcar_file.close()
            return vol, sigma


out = []
for path in paths:
    
    print(path)
    deepmd_path = os.path.join(path,'deepmd')
    outcar = os.path.join(path,'OUTCAR')
    vol, sigma0 = extract_sigma_vol_outcar(outcar)
    inputs['system'] = deepmd_path
    num,simga,natoms, l2e, l2ea, l2f, l2v = test_ener(inputs)
    print(simga, l2e, l2ea, l2f, l2v)

    if abs(sigma0 - simga)>0.01:
        print("!!!!ERROR ON SIGMA, do not match!!!!")
    out.append([num,vol,simga,natoms, l2e, l2ea, l2f, l2v])
    
import numpy as np
out = np.array(out)
np.savetxt('model_test.out', out)