mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
start with initial value
read a current this->matrix before combined
This commit is contained in:
parent
51581341f1
commit
e98c50fcef
1 changed files with 17 additions and 2 deletions
|
|
@ -65,7 +65,10 @@ ScattData::base_combine(size_t max_order,
|
|||
xt::xtensor<double, 3> this_matrix({groups, groups, max_order}, 0.);
|
||||
xt::xtensor<double, 2> mult_numer({groups, groups}, 0.);
|
||||
xt::xtensor<double, 2> mult_denom({groups, groups}, 0.);
|
||||
|
||||
// TODO: Need to review this:
|
||||
if (this->scattxs.size() > 0) {
|
||||
this_matrix = this->get_matrix(max_order);
|
||||
}
|
||||
// Build the dense scattering and multiplicity matrices
|
||||
// Get the multiplicity_matrix
|
||||
// To combine from nuclidic data we need to use the final relationship
|
||||
|
|
@ -110,7 +113,19 @@ ScattData::base_combine(size_t max_order,
|
|||
|
||||
// Combine mult_numer and mult_denom into the combined multiplicity matrix
|
||||
xt::xtensor<double, 2> this_mult({groups, groups}, 1.);
|
||||
this_mult = xt::nan_to_num(mult_numer / mult_denom);
|
||||
// TODO: Need to check this too
|
||||
xt::xtensor<double, 2> this_mult({groups, groups}, 1.);
|
||||
for (int gin = 0; gin < groups; gin++) {
|
||||
for (int gout = 0; gout < groups; gout++) {
|
||||
if (std::abs(mult_denom(gin, gout)) > 0.0) {
|
||||
this_mult(gin, gout) = mult_numer(gin, gout) / mult_denom(gin, gout);
|
||||
} else {
|
||||
if (mult_numer(gin, gout) == 0.0) {
|
||||
this_mult(gin, gout) = 1.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// We have the data, now we need to convert to a jagged array and then use
|
||||
// the initialize function to store it on the object.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue