Ejemplo n.º 1
0
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.")
Ejemplo n.º 2
0
#Create the directory to contain output files.
os.system('if [ -d outfile ]; then rm -rf outfile; fi; mkdir outfile')

outfile_lev_b = 'outfile/fe18b.en'
outfile_lev_a = outfile_lev_b[:-4]+'a.en'

outfile_rr_b = 'outfile/fe18b.rr'
outfile_rr_a = outfile_rr_b[:-4]+'a.rr'

outfile_tr_b = 'outfile/fe18b.tr'
outfile_tr_a = outfile_rr_b[:-4]+'a.tr'

#Structure
#Bound configurations
fac.Structure(outfile_lev_b, ['T1.2*']) #, 'T1.3*', 'T1.4*', 'T1.5*', 'T1.6*', 'T1.7*', 'T1.8*', 'T1.9*', 'T1.10*'])
fac.Structure(outfile_lev_b, ['T1.3*'])
fac.Structure(outfile_lev_b, ['T1.4*'])
fac.Structure(outfile_lev_b, ['T1.5*'])
fac.Structure(outfile_lev_b, ['T1.6*'])
fac.Structure(outfile_lev_b, ['T1.7*'])
fac.Structure(outfile_lev_b, ['T1.8*'])
fac.Structure(outfile_lev_b, ['T1.9*'])
fac.Structure(outfile_lev_b, ['T1.10*'])

#Target configurations
#fac.Structure(outfile_lev_b, ['T1'])
#fac.Structure(outfile_lev_b, ['T2'])
#fac.Structure(outfile_lev_b, ['T1', 'T2', 'T31.4s', 'T31.4p', 'T31.4d', 'T31.4f', 'T32.4s', 'T32.4p', 'T32.4d', 'T32.4f', 'T33.4*'])

#Quasi-bound configurations
fac.ConfigEnergy(0)
fac.OptimizeRadial(['T1.2*'])
fac.ConfigEnergy(1)

#Create the directory to contain output files.
os.system('if [ -d outfile ]; then rm -rf outfile; fi; mkdir outfile')

outfile_lev_b = 'outfile/fe18b.en'
outfile_lev_a = outfile_lev_b[:-4] + 'a.en'

outfile_rr_b = 'outfile/fe18b.rr'
outfile_rr_a = outfile_rr_b[:-4] + 'a.rr'

#Structure
#Bound configurations
fac.Structure(outfile_lev_b, ['T1.2*'])
fac.Structure(outfile_lev_b, ['T1.3*'])
fac.Structure(outfile_lev_b, ['T1.4*'])
fac.Structure(outfile_lev_b, ['T1.5*'])
fac.Structure(outfile_lev_b, ['T1.6*'])
fac.Structure(outfile_lev_b, ['T1.7*'])
fac.Structure(outfile_lev_b, ['T1.8*'])
fac.Structure(outfile_lev_b, ['T1.9*'])
fac.Structure(outfile_lev_b, ['T1.10*'])

#Target configurations
#mixing
fac.Structure(outfile_lev_b, [
    'T1', 'T2', 'T31.4s', 'T31.4p', 'T31.4d', 'T31.4f', 'T32.4s', 'T32.4p',
    'T32.4d', 'T32.4f', 'T33.4*', 'T4', 'T5', 'T6', 'T7', 'T8', 'T9'
])
Ejemplo n.º 4
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)
Ejemplo n.º 5
0
if use_openmp:
    # enable openmp with 2 cores
    fac.InitializeMPI(2)
    
fac.SetAtom('Fe')
# 1s shell is closed
fac.Closed('1s')
fac.Config('2*8', group = 'n2')
# instead of a keyword, the group name can also
# be given as the first argument.
fac.Config('n3', '2*7 3*1')
# Self-consistent iteration for optimized central potential
fac.ConfigEnergy(0)
# the configurations passed to OptimizeRadial should always
# be one or two of the lowest lying ones. and it is often best to
# just use the ground configurations. If you need more highly
# excited levels, such as n=4, 5, 6, ..., do not put them
# in the OptimizeRadial. 
fac.OptimizeRadial(['n2'])
fac.ConfigEnergy(1)
fac.GetPotential('ne.pot')
fac.Structure('ne.lev.b', ['n2', 'n3'])
fac.MemENTable('ne.lev.b')
fac.PrintTable('ne.lev.b', 'ne.lev', 1)

fac.TransitionTable('ne.tr.b', ['n2'], ['n3'])
fac.PrintTable('ne.tr.b', 'ne.tr', 1)

if use_openmp:
    fac.FinalizeMPI()
Ejemplo n.º 6
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)
Ejemplo n.º 7
0
""" 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)
Ejemplo n.º 8
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)
Ejemplo n.º 9
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)
Ejemplo n.º 10
0
fac.Config('1s2 2*2', group='ground')

fac.Config('1s2 2*1 3*1', group='2exc3')
fac.Config('1s2 2*1 4*1', group='2exc4')
fac.Config('1s2 2*1 5*1', group='2exc5')

fac.Config('1s 2*3', group='1exc2')
fac.Config('1s 2*2 3*1', group='1exc3')
fac.Config('1s 2*2 4*1', group='1exc4')
fac.Config('1s 2*2 5*1', group='1exc5')

fac.ConfigEnergy(0)
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