Beispiel #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.")
Beispiel #2
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()
Beispiel #3
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)
Beispiel #4
0
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'

for i in range(len(g)):
    fac.CETable('beb.ce', ['ground'], [g[i]])

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

# Autoionization Rates

print 'calculating AI rates'