From 796844fd0b206cd0423dd5d2de8bcd71b2f86334 Mon Sep 17 00:00:00 2001 From: John Tramm Date: Thu, 5 Dec 2019 18:39:02 +0000 Subject: [PATCH] fixed broken stuff from prn interface changes --- include/openmc/geometry.h | 11 ----------- include/openmc/particle.h | 12 ++++++++++++ include/openmc/simulation.h | 4 ++++ src/physics.cpp | 2 +- src/simulation.cpp | 11 ++++++++++- 5 files changed, 27 insertions(+), 13 deletions(-) diff --git a/include/openmc/geometry.h b/include/openmc/geometry.h index e386348c4..ef226db66 100644 --- a/include/openmc/geometry.h +++ b/include/openmc/geometry.h @@ -24,17 +24,6 @@ extern std::vector overlap_check_count; } // namespace model -//============================================================================== -// Information about nearest boundary crossing -//============================================================================== - -struct BoundaryInfo { - double distance {INFINITY}; //!< distance to nearest boundary - int surface_index {0}; //!< if boundary is surface, index in surfaces vector - int coord_level; //!< coordinate level after crossing boundary - std::array lattice_translation {}; //!< which way lattice indices will change -}; - //============================================================================== //! Check two distances by coincidence tolerance //============================================================================== diff --git a/include/openmc/particle.h b/include/openmc/particle.h index d65959c76..74e09f3d8 100644 --- a/include/openmc/particle.h +++ b/include/openmc/particle.h @@ -131,6 +131,17 @@ struct MacroXS { double pair_production; //!< macroscopic pair production xs }; +//============================================================================== +// Information about nearest boundary crossing +//============================================================================== + +struct BoundaryInfo { + double distance {INFINITY}; //!< distance to nearest boundary + int surface_index {0}; //!< if boundary is surface, index in surfaces vector + int coord_level; //!< coordinate level after crossing boundary + std::array lattice_translation {}; //!< which way lattice indices will change +}; + //============================================================================ //! State of a particle being transported through geometry //============================================================================ @@ -279,6 +290,7 @@ public: // Indices for various arrays int surface_ {0}; //!< index for surface particle is on + BoundaryInfo boundary_; int cell_born_ {-1}; //!< index for cell particle was born in int material_ {-1}; //!< index for current material int material_last_ {-1}; //!< index for last material diff --git a/include/openmc/simulation.h b/include/openmc/simulation.h index 8efac4c7f..4ee02a0f0 100644 --- a/include/openmc/simulation.h +++ b/include/openmc/simulation.h @@ -16,6 +16,10 @@ constexpr int STATUS_EXIT_NORMAL {0}; constexpr int STATUS_EXIT_MAX_BATCH {1}; constexpr int STATUS_EXIT_ON_TRIGGER {2}; +extern Particle::Bank * shared_fission_bank; +extern int shared_fission_bank_length; +extern int shared_fission_bank_max; + //============================================================================== // Global variable declarations //============================================================================== diff --git a/src/physics.cpp b/src/physics.cpp index f6885a310..2fbc9dec5 100644 --- a/src/physics.cpp +++ b/src/physics.cpp @@ -187,7 +187,7 @@ create_fission_sites(Particle* p, int i_nuclide, const Reaction* rx, sample_fission_neutron(i_nuclide, rx, p->E_, &site, p->current_seed()); // Set the delayed group on the particle as well - p->delayed_group_ = site.delayed_group; + p->delayed_group_ = site->delayed_group; // Increment the number of neutrons born delayed if (p->delayed_group_ > 0) { diff --git a/src/simulation.cpp b/src/simulation.cpp index a162de8a8..7e4bf7305 100644 --- a/src/simulation.cpp +++ b/src/simulation.cpp @@ -2,23 +2,32 @@ #include "openmc/bank.h" #include "openmc/capi.h" +#include "openmc/cell.h" #include "openmc/container_util.h" #include "openmc/eigenvalue.h" #include "openmc/error.h" +#include "openmc/geometry.h" #include "openmc/material.h" #include "openmc/message_passing.h" +#include "openmc/mgxs_interface.h" #include "openmc/nuclide.h" #include "openmc/output.h" #include "openmc/particle.h" #include "openmc/photon.h" +#include "openmc/physics.h" +#include "openmc/physics_mg.h" #include "openmc/random_lcg.h" #include "openmc/settings.h" #include "openmc/source.h" #include "openmc/state_point.h" +#include "openmc/thermal.h" #include "openmc/timer.h" +#include "openmc/tallies/derivative.h" #include "openmc/tallies/filter.h" #include "openmc/tallies/tally.h" +#include "openmc/tallies/tally_scoring.h" #include "openmc/tallies/trigger.h" +#include "openmc/track_output.h" #ifdef _OPENMP #include @@ -348,7 +357,7 @@ void process_advance_particle_events() } else if (p->macro_xs_.total == 0.0) { d_collision = INFINITY; } else { - d_collision = -std::log(prn(p->prn_seeds_, p->stream_)) / p->macro_xs_.total; + d_collision = -std::log(prn(p->prn_seeds_ + p->stream_)) / p->macro_xs_.total; } // -------------- break here? -------------------