Beispiel #1
0
def reduce_2n(w2rels,
              ch='nn-1S0',
              size2=20,
              ncycl=50,
              maxd=0.01,
              minc2=500,
              maxc2=3000,
              execut=''):
    cons_red = 1
    print('(ia)    reducing widths in %s channel...' % ch)
    while cons_red:
        tmp = red_mod_2(max_coeff=maxc2,
                        min_coeff=minc2,
                        target_size=size2,
                        nbr_cycles=ncycl,
                        max_diff=maxd,
                        ord=0,
                        dr2executable=execut)
        os.system('cp ' + 'INEN ' + 'INEN_' + ch)
        mm_s = rrgm_functions.get_reduced_width_set(w2rels,
                                                    'INEN_' + ch,
                                                    bsorsc='b',
                                                    outf='WIDTH_' + ch)

        os.system('cp ' + 'INQUA_N ' + 'INQUA_N_' + ch)
        rrgm_functions.parse_ev_coeffs()
        os.system('cp ' + 'COEFF ' + 'COEFF_' + ch)
        os.system('cp ' + 'OUTPUT ' + 'out_' + ch)

        tmpa = sum([
            int(i)
            for i in [line for line in open('INEN_' + ch)][6].strip().split()
        ]) + sum([
            int(i)
            for i in [line for line in open('INEN_' + ch)][8].strip().split()
        ])

        tmpb = len([line for line in open('COEFF_' + ch)])

        cons_red = ((tmpa != tmpb) | (size2 <= int(tmp[1])))
        minc2 += 10
        #print(minc2, tmp[1], size2, tmpa, tmpb)

    print('(ib)    reduction to %d widths complete.' % size2)
def reduce_3n(ch='612-05m',
              size3=90,
              ncycl=350,
              maxd=0.005,
              minc3=200,
              maxc3=6000,
              ord=0,
              tnii=10,
              delpredd=3):

    print('reducing widths in %s channel...' % ch)

    cons_red = 1

    while cons_red:
        tmp = red_mod_3(
            typ=ch,
            max_coeff=maxc3,
            min_coeff=minc3,
            target_size=size3,
            nbr_cycles=ncycl,
            max_diff=maxd,
            ord=0,
            tniii=tnii,
            delpred=delpredd,
            dr2executable=BINpath + 'DR2END_' + mpii + '.exe')

        cons_red = (size3 <= tmp[1])
        minc3 += 20
        print(minc3, tmp[1])

    os.system('cp ' + 'INEN ' + 'INEN_' + ch)
    os.system('cp ' + 'INQUA_N ' + 'INQUA_N_' + ch)

    rrgm_functions.parse_ev_coeffs()
    os.system('cp ' + 'COEFF ' + 'COEFF_' + ch)
    os.system('cp ' + 'OUTPUT ' + 'out_' + ch)

    print('reduction to %d widths complete.' % size3)