예제 #1
0
파일: fac_dr.py 프로젝트: HPLegion/FAC-Eval
def compute_dr(z, dr_type, path=""):
    """
    Main routine, computes DR for given element and recombination process
    """
    elem = fac.ATOMICSYMBOL[z]
    # Initialise
    fac.Reinit()
    fac.SetAtom(elem)
    # Execute problem specific configuration
    type_name = dr_type()
    # Generate filenames
    f_stub = path + elem + "_" + type_name
    f_lev = f_stub + ".lev"
    f_lev_b = f_lev + ".b"  # temp binary
    f_tr = f_stub + ".tr"
    f_tr_b = f_tr + ".b"  # temp binary
    f_ai = f_stub + ".ai"
    f_ai_b = f_ai + ".b"  # temp binary
    # Start solving
    fac.ConfigEnergy(0)
    # According to the manual we should Optimize on the recombined ion
    # (have seen other things out in the wild)
    fac.OptimizeRadial(["final"])
    fac.ConfigEnergy(1)
    # Compute structure and energy levels
    fac.Structure(f_lev_b, ["initial", "transient", "final"])
    fac.MemENTable(f_lev_b)
    fac.PrintTable(f_lev_b, f_lev, 1)
    # Compute the transisiton table for radiative decay
    # Transition Table defaults to m=0 since FAC1.0.7 (not in current docs)
    # which computes all multipoles according to new (unreleased) docs
    fac.TransitionTable(f_tr_b, ["final"], ["transient"])
    fac.PrintTable(f_tr_b, f_tr, 1)
    # Compute the Autoionisation table
    fac.AITable(f_ai_b, ["transient"], ["initial"])
    fac.PrintTable(f_ai_b, f_ai, 1)
    # Clean up
    for f in [f_lev_b, f_tr_b, f_ai_b]:
        try:
            os.remove(f)
        except OSError as e:  ## if failed, report it back to the user ##
            print("Error: %s - %s." % (e.filename, e.strerror))
    print("Element:" + elem + " DR: " + type_name + " done.")
예제 #2
0
fac.Structure(outfile_lev_b, ['T23.4*.4*', 'T2.4f.4f', 'T3.4f.4f'])
fac.Structure(outfile_lev_b, ['T23.4*.5*', 'T2.4f.5*', 'T3.4f.5*'])
fac.Structure(outfile_lev_b, ['T23.4*.6*', 'T2.4f.6*', 'T3.4f.6*'])
fac.Structure(outfile_lev_b, ['T23.4*.7*', 'T2.4f.7*', 'T3.4f.7*'])

fac.Structure(outfile_lev_b,['T11.5*.5*'])
fac.Structure(outfile_lev_b,['T11.5*.6*'])
fac.Structure(outfile_lev_b,['T11.5*.7*'])

fac.Structure(outfile_lev_b,['T11.6*.6*'])
fac.Structure(outfile_lev_b,['T11.6*.7*'])

fac.Structure(outfile_lev_b,['T11.7*.7*']) 

#Print the energy table
fac.MemENTable(outfile_lev_b)
fac.PrintTable(outfile_lev_b, outfile_lev_a, 1)

##Generate the PI table
##================ For matching ==============
#bound_config = ['T1.2*', 'T1.3*', 'T1.4*', 'T1.5*', 'T1.6*', 'T1.7*', 'T1.8*',
#	        'T1.9*', 'T1.10*']
#free_config = ['T1', 'T2', 'T31.4s', 'T31.4p', 'T31.4d', 'T32.4s', 'T32.4p', 'T32.4d']
#fac.RRTable(outfile_rr_b, bound_config, free_config)
#
##print the rr table
#fac.PrintTable(outfile_rr_b, outfile_rr_a, 1)

#============TR==================================================================
fac.TRTable(outfile_tr_b, ['T1.4*'], ['T23.4*.4*', 'T23.4*.5*', 'T23.4*.6*', 'T23.4*.7*', 
				      'T2.4f.4f', 'T2.4f.5*', 'T2.4f.6*', 'T2.4f.7*', 
예제 #3
0
"""calculate the electron impact excitation cross sections
"""

# import the modules
from pfac import fac

fac.SetAtom('Fe')
# 1s shell is closed
fac.Closed('1s')
fac.Config('2*8', group='n2')
fac.Config('2*7 3*1', group='n3')

# Self-consistent iteration for optimized central potential
fac.ConfigEnergy(0)
fac.OptimizeRadial('n2')
fac.ConfigEnergy(1)
fac.Structure('ne.lev.b')
fac.MemENTable('ne.lev.b')
fac.PrintTable('ne.lev.b', 'ne.lev', 1)

fac.CETable('ne.ce.b', ['n2'], ['n3'])
fac.PrintTable('ne.ce.b', 'ne.ce', 1)
예제 #4
0
""" calculate the electron impact ionization cross sections
"""

# import the modules
from pfac import fac

fac.SetAtom('Fe')
# 1s shell is closed
fac.Closed('1s')
# Ne-like ground state
fac.Config('2*8', group='fe17')
# F-like configuations
fac.Config('2*7', group='fe18')

# solve the structure problem
fac.ConfigEnergy(0)
fac.OptimizeRadial(['fe17'])
fac.ConfigEnergy(1)
fac.Structure('ne_f.lev.b', ['fe17'])
fac.Structure('ne_f.lev.b', ['fe18'])
fac.MemENTable('ne_f.lev.b')
fac.PrintTable('ne_f.lev.b', 'ne_f.lev', 1)

# set the output collision energies
e = [500.0, 900.0, 1.3e3, 1.7e3, 2.1e3, 4.2e3, 6.0e3, 8.0e3]
fac.SetUsrCIEGrid(e)
fac.CITable('ne.ci.b', ['fe17'], ['fe18'])
fac.PrintTable('ne.ci.b', 'ne.ci', 1)
예제 #5
0
파일: se_ai.py 프로젝트: yzbdxiangyata/fac
""" calculate the autoionization rates for Ne-like Se.
"""

# import the modules
from pfac import fac

fac.SetAtom('Se')

# configurations for the F-like ion
fac.Closed('1s')
fac.Closed('2s')
fac.Config('2p5', group='n2')

# configurations of doubly excited Ne-like ion
fac.Config('2p4 3s2', '2p4 3s1 3p1', group='n33')

fac.ConfigEnergy(0)
fac.OptimizeRadial('n33')
fac.ConfigEnergy(1)
fac.Structure('se.lev.b', ['n2'])
fac.Structure('se.lev.b', ['n33'])
fac.MemENTable('se.lev.b')
fac.PrintTable('se.lev.b', 'se.lev', 1)

fac.AITable('se.ai.b', ['n33'], ['n2'])
fac.PrintTable('se.ai.b', 'se.ai', 1)
예제 #6
0
""" calculate the photoionization and 
    radiative recombination cross sections
"""

# import the modules
from pfac import fac

fac.SetAtom('Fe')

# specify the configurations for both recombining
# and recombined ions.
fac.Config('1s2', group='n1')
fac.Config('1s1 2*1', group='n2')
fac.Config('1s2 2*1', group='rn2')

fac.ConfigEnergy(0)
fac.OptimizeRadial(['rn2'])
fac.ConfigEnergy(1)

# configuration interaction between n=1 and n=2
# complexes are included for the recombining ion.
fac.Structure('li.lev.b', ['n1', 'n2'])
fac.Structure('li.lev.b', ['rn2'])
fac.MemENTable('li.lev.b')
fac.PrintTable('li.lev.b', 'li.lev', 1)

fac.RRTable('li.rr.b', ['rn2'], ['n1'])
fac.PrintTable('li.rr.b', 'li.rr', 1)
예제 #7
0
fac.SetUTA(0)
fac.SetAtom('Ho')
fac.Closed('1s', '2s', '2p', '3s', '3p', '3d', '4s')

fac.Config('4p6 4d2', group='Gnd.0')
fac.Config('4p5 4d3', group='Gnd.1')
fac.Config('4p6 4d1 4f1', group='Gnd.3')
fac.Config('4p5 4d2 4f1', group='Exc.1')
fac.Config('4p4 4d4', group='Exc.2')
fac.Config('4p6 4d0 4f2', group='Exc.3')

fac.ConfigEnergy(0)
fac.OptimizeRadial(['Gnd.0'])
fac.ConfigEnergy(1)

fac.Structure('Ho.lev.b',
              ['Gnd.0', 'Gnd.1', 'Gnd.3', 'Exc.1', 'Exc.2', 'Exc.3'])

fac.MemENTable('Ho.lev.b')
fac.TransitionTable('Ho.tr.b', ['Gnd.1'], ['Exc.1'], -1)
fac.TransitionTable('Ho.tr.b', ['Gnd.1'], ['Exc.2'], -1)
fac.TransitionTable('Ho.tr.b', ['Gnd.3'], ['Exc.3'], -1)

fac.PrintTable('Ho.lev.b', 'Ho30.lev', 1)
fac.PrintTable('Ho.tr.b', 'Ho30.tr', 1)

end = time.clock()
runtime = end - start
print("Total running time: %s seconds" % runtime)
예제 #8
0
파일: bed.py 프로젝트: tommykronstal/faclab
fac.OptimizeRadial(['ground'])
fac.ConfigEnergy(1)

fac.Structure('beb.en', ['ground'])
fac.Structure('beb.en', ['2exc3'])
fac.Structure('beb.en', ['2exc4'])
fac.Structure('beb.en', ['2exc5'])
fac.Structure('beb.en', ['1exc2'])
fac.Structure('beb.en', ['1exc3'])
fac.Structure('beb.en', ['1exc4'])
fac.Structure('beb.en', ['1exc5'])
fac.Structure('beb.en', ['lithium'])

g = ['ground', '2exc3', '2exc4', '2exc5', '1exc2', '1exc3', '1exc4', '1exc5']

fac.MemENTable('beb.en')
fac.PrintTable('beb.en', 'bea.en', 1)

# Radiative Transitions

for i in range(len(g)):
    for j in range(i, len(g)):
        print 'calculating radiative transitions between', g[i], 'and', g[j]
        fac.TransitionTable('beb.tr', [g[i]], [g[j]])

fac.PrintTable('beb.tr', 'bea.tr', 1)

# Collisional Transitions

print 'calculating collisional transitions'