Have ufs_get_weight accept a reference instead of pointer

This commit is contained in:
Paul Romano 2020-04-23 09:51:49 -05:00
parent 498fb181d6
commit e7ab675e3e
4 changed files with 6 additions and 6 deletions

View file

@ -69,7 +69,7 @@ void shannon_entropy();
void ufs_count_sites();
//! Get UFS weight corresponding to particle's location
extern "C" double ufs_get_weight(const Particle* p);
double ufs_get_weight(const Particle& p);
//! Write data related to k-eigenvalue to statepoint
//! \param[in] group HDF5 group

View file

@ -573,12 +573,12 @@ void ufs_count_sites()
}
}
double ufs_get_weight(const Particle* p)
double ufs_get_weight(const Particle& p)
{
// Determine indices on ufs mesh for current location
int mesh_bin = simulation::ufs_mesh->get_bin(p->r());
int mesh_bin = simulation::ufs_mesh->get_bin(p.r());
if (mesh_bin < 0) {
p->write_restart();
p.write_restart();
fatal_error("Source site outside UFS mesh!");
}

View file

@ -153,7 +153,7 @@ create_fission_sites(Particle* p, int i_nuclide, const Reaction* rx)
{
// If uniform fission source weighting is turned on, we increase or decrease
// the expected number of fission sites produced
double weight = settings::ufs_on ? ufs_get_weight(p) : 1.0;
double weight = settings::ufs_on ? ufs_get_weight(*p) : 1.0;
// Determine the expected number of neutrons produced
double nu_t = p->wgt_ / simulation::keff * weight * p->neutron_xs_[

View file

@ -92,7 +92,7 @@ create_fission_sites(Particle* p)
{
// If uniform fission source weighting is turned on, we increase or decrease
// the expected number of fission sites produced
double weight = settings::ufs_on ? ufs_get_weight(p) : 1.0;
double weight = settings::ufs_on ? ufs_get_weight(*p) : 1.0;
// Determine the expected number of neutrons produced
double nu_t = p->wgt_ / simulation::keff * weight *