mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Have ufs_get_weight accept a reference instead of pointer
This commit is contained in:
parent
498fb181d6
commit
e7ab675e3e
4 changed files with 6 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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!");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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_[
|
||||
|
|
|
|||
|
|
@ -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 *
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue