mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
Fix build warnings
This commit is contained in:
parent
2ab24d85cd
commit
86c33fa7cb
5 changed files with 19 additions and 7 deletions
|
|
@ -152,8 +152,7 @@ public:
|
|||
int indx_; //!< An index to a Lattice universes or offsets array.
|
||||
|
||||
LatticeIter(Lattice &lat, int indx)
|
||||
: lat_(lat),
|
||||
indx_(indx)
|
||||
: indx_(indx), lat_(lat)
|
||||
{}
|
||||
|
||||
bool operator==(const LatticeIter &rhs) {return (indx_ == rhs.indx_);}
|
||||
|
|
|
|||
|
|
@ -267,7 +267,7 @@ void sample_photon_reaction(Particle* p)
|
|||
double phi = 2.0*PI*prn();
|
||||
double E_electron = (alpha - alpha_out)*MASS_ELECTRON_EV - e_b;
|
||||
int electron = static_cast<int>(Particle::Type::electron);
|
||||
if (E_electron >= settings::energy_cutoff[electron]) {
|
||||
if (E_electron >= settings::energy_cutoff[electron]) {
|
||||
double mu_electron = (alpha - alpha_out*mu)
|
||||
/ std::sqrt(alpha*alpha + alpha_out*alpha_out - 2.0*alpha*alpha_out*mu);
|
||||
Direction u = rotate_angle(p->u(), mu_electron, &phi);
|
||||
|
|
@ -504,6 +504,9 @@ Reaction* sample_fission(int i_nuclide, double E)
|
|||
// Create fission bank sites if fission occurs
|
||||
if (prob > cutoff) return rx;
|
||||
}
|
||||
|
||||
// If we reached here, no reaction was sampled
|
||||
throw std::runtime_error{"No fission reaction was sampled for " + nuc->name_};
|
||||
}
|
||||
|
||||
void sample_photon_product(int i_nuclide, double E, int* i_rx, int* i_product)
|
||||
|
|
@ -901,8 +904,11 @@ Direction sample_target_velocity(const Nuclide* nuc, double E, Direction u,
|
|||
}
|
||||
}
|
||||
}
|
||||
} // case RVS, DBRC
|
||||
} // case RVS, DBRC
|
||||
} // switch (sampling_method)
|
||||
|
||||
throw std::runtime_error{"Unable to sample target velocity for "
|
||||
"elastic scattering."};
|
||||
}
|
||||
|
||||
Direction
|
||||
|
|
|
|||
|
|
@ -80,9 +80,10 @@ SphericalHarmonicsFilter::text_label(int bin) const
|
|||
if (bin < (n + 1) * (n + 1)) {
|
||||
int m = (bin - n*n) - n;
|
||||
out << "Spherical harmonic expansion, Y" << n << "," << m;
|
||||
return out.str();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return out.str();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -65,9 +65,10 @@ ZernikeFilter::text_label(int bin) const
|
|||
int first = last - (n + 1);
|
||||
int m = -n + (bin - first) * 2;
|
||||
out << "Zernike expansion, Z" << n << "," << m;
|
||||
return out.str();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return out.str();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -83,6 +83,9 @@ check_tally_triggers(double& ratio, int& tally_id, int& score)
|
|||
case TriggerMetric::relative_error:
|
||||
uncertainty = rel_err;
|
||||
break;
|
||||
case TriggerMetric::not_active:
|
||||
uncertainty = 0.0;
|
||||
break;
|
||||
}
|
||||
|
||||
// Compute the uncertainty / threshold ratio.
|
||||
|
|
@ -109,7 +112,6 @@ double
|
|||
check_keff_trigger()
|
||||
{
|
||||
if (settings::run_mode != RUN_MODE_EIGENVALUE) return 0.;
|
||||
if (settings::keff_trigger.metric == TriggerMetric::not_active) return 0.;
|
||||
|
||||
double k_combined[2];
|
||||
int err = openmc_get_keff(k_combined);
|
||||
|
|
@ -124,6 +126,9 @@ check_keff_trigger()
|
|||
break;
|
||||
case TriggerMetric::relative_error:
|
||||
uncertainty = k_combined[1] / k_combined[0];
|
||||
break;
|
||||
case TriggerMetric::not_active:
|
||||
break;
|
||||
}
|
||||
|
||||
double ratio = uncertainty / settings::keff_trigger.threshold;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue