Fixing two failing tests - further inspection needed on mgxs_library_ce_to_mg;

This commit is contained in:
Adam G Nelson 2018-06-15 06:53:43 -04:00
parent 7c819f02bc
commit 9fd65822f0
2 changed files with 8 additions and 10 deletions

View file

@ -234,7 +234,7 @@ void ScattDataLegendre::sample(int gin, int& gout, double& mu, double& wgt)
int samples = 0;
while(true) {
double mu = 2. * prn() - 1.;
mu = 2. * prn() - 1.;
double f = calc_f(gin, gout, mu);
if (f > 0.) {
double u = prn() * M;
@ -370,6 +370,7 @@ void ScattDataLegendre::combine(std::vector<ScattData*>& those_scatts,
for (int gout = gmin_; gout <= gmax_; gout++) {
sparse_scatter[gin][i_gout] = this_matrix[gin][gout];
sparse_mult[gin][i_gout] = this_mult[gin][gout];
i_gout++;
}
}
@ -442,7 +443,7 @@ void ScattDataHistogram::init(int_1dvec& in_gmin, int_1dvec& in_gmax,
ScattData::generic_init(order, in_gmin, in_gmax, in_energy,
in_mult);
// Build the angular distributio mu values
// Build the angular distribution mu values
mu = double_1dvec(order);
dmu = 2. / order;
mu[0] = -1.;
@ -678,6 +679,7 @@ void ScattDataHistogram::combine(std::vector<ScattData*>& those_scatts,
for (int gout = gmin_; gout <= gmax_; gout++) {
sparse_scatter[gin][i_gout] = this_matrix[gin][gout];
sparse_mult[gin][i_gout] = this_mult[gin][gout];
i_gout++;
}
}

View file

@ -248,7 +248,7 @@ void XsData::_fissionable_from_hdf5(hid_t xsdata_grp, int n_pol, int n_azi,
} else if (ndims == 4) {
// nu-fission is a matrix
read_nd_vector(xsdata_grp, "nu_fission", chi_prompt);
read_nd_vector(xsdata_grp, "nu-fission", chi_prompt);
// Normalize the chi info so the CDF is 1.
for (int p = 0; p < n_pol; p++) {
@ -256,6 +256,9 @@ void XsData::_fissionable_from_hdf5(hid_t xsdata_grp, int n_pol, int n_azi,
for (int gin = 0; gin < energy_groups; gin++) {
double chi_sum = std::accumulate(chi_prompt[p][a][gin].begin(),
chi_prompt[p][a][gin].end(), 0.);
// Set the vector nu-fission from the matrix nu-fission
prompt_nu_fission[p][a][gin] = chi_sum;
if (chi_sum >= 0.) {
for (int gout = 0; gout < energy_groups; gout++) {
chi_prompt[p][a][gin][gout] /= chi_sum;
@ -275,13 +278,6 @@ void XsData::_fissionable_from_hdf5(hid_t xsdata_grp, int n_pol, int n_azi,
}
}
// Set the vector nu-fission from the matrix nu-fission
for (int gin = 0; gin < energy_groups; gin++) {
double sum = std::accumulate(chi_prompt[p][a][gin].begin(),
chi_prompt[p][a][gin].end(), 0.);
prompt_nu_fission[p][a][gin] = sum;
}
// Set the delayed-nu-fission and correct prompt-nu-fission with beta
for (int gin = 0; gin < energy_groups; gin++) {
for (int dg = 0; dg < delayed_groups; dg++) {