mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
fixed some of @smharper comments
This commit is contained in:
parent
32674887e5
commit
e254cd0aea
4 changed files with 7 additions and 10 deletions
|
|
@ -185,9 +185,9 @@ extern "C" double normal_variate(double mean, double std_dev);
|
|||
//!
|
||||
//! modifyable parameters
|
||||
//!
|
||||
//! @param e0 peak neutron energy [ev]
|
||||
//! @param e0 peak neutron energy [eV]
|
||||
//! @param m_rat ratio of the fusion reactants to AMU
|
||||
//! @param kt the ion temperature of the reactants [ev]
|
||||
//! @param kt the ion temperature of the reactants [eV]
|
||||
//! @result The sampled outgoing energy
|
||||
//==============================================================================
|
||||
|
||||
|
|
|
|||
|
|
@ -295,7 +295,7 @@ UPtrDist distribution_from_xml(pugi::xml_node node)
|
|||
dist = UPtrDist{new Maxwell(node)};
|
||||
} else if (type == "watt") {
|
||||
dist = UPtrDist{new Watt(node)};
|
||||
} else if (type == "gaussian") {
|
||||
} else if (type == "normal") {
|
||||
dist = UPtrDist{new Normal(node)};
|
||||
} else if (type == "muir") {
|
||||
dist = UPtrDist{new Muir(node)};
|
||||
|
|
|
|||
|
|
@ -677,11 +677,8 @@ double maxwell_spectrum(double T) {
|
|||
double normal_variate(double mean, double standard_deviation) {
|
||||
// perhaps there should be a limit to the number of resamples
|
||||
while ( true ) {
|
||||
double v1 = 0.;
|
||||
double v2 = 0.;
|
||||
|
||||
v1 = 2 * prn() - 1.;
|
||||
v2 = 2 * prn() - 1.;
|
||||
double v1 = 2 * prn() - 1.;
|
||||
double v2 = 2 * prn() - 1.;
|
||||
|
||||
double r = std::pow(v1, 2) + std::pow(v2, 2);
|
||||
double r2 = std::pow(r, 2);
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ def test_normal_dist():
|
|||
ref_val = 14.08
|
||||
test_val = openmc.capi.math.normal_variate(a, b)
|
||||
|
||||
assert ref_val == test_val
|
||||
assert ref_val == pytest.approx(test_val)
|
||||
|
||||
settings.seed = 1
|
||||
a = 14.08
|
||||
|
|
@ -221,7 +221,7 @@ def test_normal_dist():
|
|||
ref_val = 16.436645416691427
|
||||
test_val = openmc.capi.math.normal_variate(a, b)
|
||||
|
||||
assert ref_val == test_val
|
||||
assert ref_val == pytest.approx(test_val)
|
||||
|
||||
|
||||
def test_broaden_wmp_polynomials():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue