Beispiel #1
0
def diff_ecis(brav):
    """
    大きな Max Cluster の CVM 計算用に ECIS の index を修正する
    使いたい ECI の eci.txt, log.txt を current dirc に配置
    また、変更したい大きな Max Cluster で展開した結果の log.txt を
    log.txt_cem として current dirc に配置しておく
    """
    Ecis.get_diff_clusters('eci.txt', 'log.txt', 'log.txt_cem', brav)
Beispiel #2
0
def hos_from_ecis(vac_corr):
    """ Calculate heat of solution from eci """
    ecis = Ecis.parse_ecitxt('eci.txt')
    try:
        null = ecis[0]
    except KeyError:
        null = 0
    try:
        points = ecis[1]
    except KeyError:
        points = 0
    corr = Fraction(vac_corr)
    if corr == 0:
        print(points)
    else:
        print(points - null / corr)
Beispiel #3
0
def print_ecis(idx_list, to_quiver):
    """ print ecis """
    ecis = Ecis.parse_ecitxt('eci.txt')
    lines = ''
    if idx_list:
        keys = [int(x) for x in idx_list.split()]
    else:
        keys = sorted(ecis.keys())
    for i in keys:
        try:
            lines += '{0}\t{1}\n'.format(i, ecis[i])
        except KeyError:
            lines += '{0}\t{1}\n'.format(i, 0)
    if to_quiver:
        values = [x.split()[1] for x in lines.split('\n')[:-1]]
        lines = '|'.join(values)
    print(lines)