예제 #1
0
datadir = '/home/software/mcnpdata/'
datadir = '/home/lkersting/frensie/src/packages/test_files/'
#datadir = '/home/lkersting/research/frensie-repos/lkersting/src/packages/test_files/'

source = Teuchos.FileInputSource(datadir + '/cross_sections.xml')
xml_obj = source.getObject()
cs_list = Teuchos.XMLParameterListReader().toParameterList(xml_obj)

h_data_list = cs_list.get('Al-Native')
pb_data_list = cs_list.get('Pb-Native')
h_adjoint_file_name = datadir + h_data_list.get(
    'adjoint_electroatomic_file_path')
h_native_file_name = datadir + h_data_list.get('electroatomic_file_path')
pb_native_file_name = datadir + pb_data_list.get('electroatomic_file_path')

h_native_data = Native.ElectronPhotonRelaxationDataContainer(
    h_native_file_name)
h_adjoint_data = Native.AdjointElectronPhotonRelaxationDataContainer(
    h_adjoint_file_name)
pb_native_data = Native.ElectronPhotonRelaxationDataContainer(
    pb_native_file_name)

energy_grid = h_native_data.getElectronEnergyGrid()
angular_energy_grid = h_native_data.getElasticAngularEnergyGrid()
print angular_energy_grid
shells = h_native_data.getSubshells()

for shell in shells:
    print h_native_data.getSubshellBindingEnergy(shell)

angular_energy_grid = pb_native_data.getElasticAngularEnergyGrid()
print angular_energy_grid
예제 #2
0
# Set the xlim and ylim
xlims = [[0.7, .99], [0.5, 1.0]]
ylims = [[0.05, 0.4], [0.0, 1.0]]

xlims = [[0.7, 1.0], [0.7, 1.0]]
ylims = [[0.0, 0.02], [0.0, 0.02]]

### -------------------------------------------------------------------------- ##
###  Coupled Plots
### -------------------------------------------------------------------------- ##

# filename = datadir + 'epr_native_' + str(atomic_number) + '.xml'
filename = datadir + 'test_epr_' + str(atomic_number) + '_native.xml'

native_data = Native.ElectronPhotonRelaxationDataContainer(filename)
energy_grid = native_data.getElasticAngularEnergyGrid()

# Distributions
if interp == "Correlated":
    # Distributions
    coupled_dist1 = Electron.createCoupledElasticDistribution_LogLogCorrelated(
        native_data, MonteCarlo.ONE_D_UNION, 1e-15)
    coupled_dist2 = Electron.createCoupledElasticDistribution_LogLogCorrelated(
        native_data, MonteCarlo.TWO_D_UNION, 1e-15)
    coupled_dist3 = Electron.createCoupledElasticDistribution_LogLogCorrelated(
        native_data, MonteCarlo.MODIFIED_TWO_D_UNION, 1e-15)

    # Reactions
    coupled_reaction = Electron.createCoupledElasticReaction_LogLogCorrelated(
        native_data, MonteCarlo.TWO_D_UNION, 1e-15)
#datadir = '/home/software/mcnpdata/'
datadir = '/home/lkersting/frensie/src/packages/test_files/'

source = Teuchos.FileInputSource(datadir + '/cross_sections.xml')
xml_obj = source.getObject()
cs_list = Teuchos.XMLParameterListReader().toParameterList(xml_obj)

# -------------------------------------------------------------------------- ##
#  Adjoint Electroatom Tests
# -------------------------------------------------------------------------- ##
data_list = cs_list.get('H-Native')
adjoint_file_name = datadir + data_list.get('adjoint_electroatomic_file_path')
forward_file_name = datadir + data_list.get('electroatomic_file_path')
adjoint_data = Native.AdjointElectronPhotonRelaxationDataContainer(
    adjoint_file_name)
forward_data = Native.ElectronPhotonRelaxationDataContainer(forward_file_name)
adjoint_energy_grid = adjoint_data.getAdjointElectronEnergyGrid()

###
###  Adjoint Electroatom/Electroatom Core Test Check
###
print "\n----- Electroatom Classes -----\n"
adjoint_brem_cs = adjoint_data.getAdjointBremsstrahlungElectronCrossSection()
adjoint_excitation_cs = adjoint_data.getAdjointAtomicExcitationCrossSection()
adjoint_analog_cs = adjoint_data.getAdjointTotalElasticCrossSection()
forward_inelastic_cs = adjoint_data.getForwardInelasticElectronCrossSection()

energies = [1e-5, 1e-3, 20.0]
for energy in energies:
    index = 0
    for i in range(0, adjoint_energy_grid.size):
# uncommented and that path to PyFrensie can be manually inserted.
# sys.path.insert(0, '/home/lkersting/research/frensie-repos/lkersting/lib/python2.7/site-packages/')

import PyFrensie.Utility as Utility
import PyFrensie.Data.Native as Native
import PyFrensie.MonteCarlo as MonteCarlo
import PyFrensie.DataGen.ElectronPhoton as ElectronPhoton

# Get the date for the table notes
today = str(datetime.datetime.today())
notes="This table was generated on " + today + ". It is for testing only!"

# Update adjoint Hydrogen data
print bcolors.BOLD + "Updating the adjoint H native test data ...\n" + bcolors.ENDC

h_epr_data = Native.ElectronPhotonRelaxationDataContainer( "test_epr_1_native.xml" )

generator_h = ElectronPhoton.StandardAdjointElectronPhotonRelaxationDataGenerator( h_epr_data, 1e-3, 20.0, 1e-5, 20.0 )

# Set default photon grid tolerances
generator_h.setDefaultPhotonGridConvergenceTolerance( 1e-3 )
generator_h.setDefaultPhotonGridAbsoluteDifferenceTolerance( 1e-42 )
generator_h.setDefaultPhotonGridDistanceTolerance( 1e-16 )

generator_h.setPhotonThresholdEnergyNudgeFactor( 1.0001 )
generator_h.setAdjointPairProductionEnergyDistNormConstantEvaluationTolerance( 1e-3 )
generator_h.setAdjointPairProductionEnergyDistNormConstantNudgeValue( 1e-6 )
generator_h.setAdjointTripletProductionEnergyDistNormConstantEvaluationTolerance( 1e-3 )
generator_h.setAdjointTripletProductionEnergyDistNormConstantNudgeValue( 1e-6 )
generator_h.setAdjointIncoherentMaxEnergyNudgeValue( 0.2 )
generator_h.setAdjointIncoherentEnergyToMaxEnergyNudgeValue( 1e-5 )