diff --git a/src/scattdata.cpp b/src/scattdata.cpp index b12ec1acb..dd8ca07e4 100644 --- a/src/scattdata.cpp +++ b/src/scattdata.cpp @@ -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& 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& 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++; } } diff --git a/src/xsdata.cpp b/src/xsdata.cpp index b79d02e20..62bfdc916 100644 --- a/src/xsdata.cpp +++ b/src/xsdata.cpp @@ -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++) {