-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcutoff_adjoint_electroatomic.py
More file actions
70 lines (52 loc) · 2.83 KB
/
cutoff_adjoint_electroatomic.py
File metadata and controls
70 lines (52 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#! /usr/bin/env python
import PyFrensie.Data.Native as Native
import PyFrensie.Utility as Utility
import PyFrensie.Utility.Prng as Prng
import PyFrensie.Utility.Interpolation as Interpolation
import PyFrensie.MonteCarlo.Collision as Collision
import PyTrilinos.Teuchos as Teuchos
import numpy
import matplotlib.pyplot as plt
Utility.initFrensiePrng()
#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 )
data_list = cs_list.get( 'H-Native' )
# -------------------------------------------------------------------------- ##
# Adjoint Elastic Data
# -------------------------------------------------------------------------- ##
adjoint_file_name = datadir + data_list.get( 'adjoint_electroatomic_file_path' )
adjoint_data = Native.AdjointElectronPhotonRelaxationDataContainer( adjoint_file_name )
adjoint_energy_grid = adjoint_data.getAdjointElectronEnergyGrid()
tot_adjoint_elastic_cs = adjoint_data.getAdjointTotalElasticCrossSection()
adjoint_cutoff_cs = adjoint_data.getAdjointCutoffElasticCrossSection()
reduced_cutoff_ratio = adjoint_data.getReducedCutoffCrossSectionRatios()
adjoint_screen_rutherford_cs = adjoint_data.getAdjointScreenedRutherfordElasticCrossSection()
adjoint_screen_rutherford_index = adjoint_data.getAdjointScreenedRutherfordElasticCrossSectionThresholdEnergyIndex()
adjoint_excitation_cs = adjoint_data.getAdjointAtomicExcitationCrossSection()
adjoint_ionization_cs = adjoint_data.getAdjointElectroionizationCrossSection(1)
adjoint_brem_cs = adjoint_data.getAdjointBremsstrahlungElectronCrossSection()
###
### Cutoff Distribution/Reaction Unit Test Check
###
adjoint_cutoff_dist = Collision.createLogLogLogCorrelatedCutoffElasticDistribution(adjoint_data, 1.0, 1e-7)
cutoff_cdf = adjoint_cutoff_dist.evaluateCDF( 20.0, 0.9 )
ratio = reduced_cutoff_ratio[reduced_cutoff_ratio.size -1]
cutoff_cs = adjoint_cutoff_cs[reduced_cutoff_ratio.size -1]
print 'cutoff_cdf = ','%.16e' % cutoff_cdf
print 'ratio = ','%.16e' % ratio
print 'cutoff_cs = ','%.16e' % cutoff_cs
cutoff_cdf = adjoint_cutoff_dist.evaluateCDF( 1e-3, 0.9 )
print 'cutoff_cdf = ','%.16e' % cutoff_cdf
cutoff_cdf = adjoint_cutoff_dist.evaluateCDF( 1e-5, 0.9 )
print 'cutoff_cdf = ','%.16e' % cutoff_cdf
# change cutoff
adjoint_cutoff_dist = Collision.createLogLogLogCorrelatedCutoffElasticDistribution(adjoint_data, 0.9, 1e-7)
cutoff_cdf = adjoint_cutoff_dist.evaluateCutoffCrossSectionRatio( 20.0 )
print 'cutoff_cdf = ','%.16e' % cutoff_cdf
cutoff_cdf = adjoint_cutoff_dist.evaluateCutoffCrossSectionRatio( 1e-3 )
print 'cutoff_cdf = ','%.16e' % cutoff_cdf
cutoff_cdf = adjoint_cutoff_dist.evaluateCutoffCrossSectionRatio( 1e-5 )
print 'cutoff_cdf = ','%.16e' % cutoff_cdf