diff --git a/include/openmc/particle_data.h b/include/openmc/particle_data.h index 63092ab3d07..6f6b7c51e30 100644 --- a/include/openmc/particle_data.h +++ b/include/openmc/particle_data.h @@ -343,487 +343,151 @@ class ParticleData { //========================================================================== // Methods and accessors - NuclideMicroXS& neutron_xs(int i) - { - return neutron_xs_[i]; - } - const NuclideMicroXS& neutron_xs(int i) const - { - return neutron_xs_[i]; - } - ElementMicroXS& photon_xs(int i) - { - return photon_xs_[i]; - } - MacroXS& macro_xs() - { - return macro_xs_; - } - const MacroXS& macro_xs() const - { - return macro_xs_; - } - - int64_t& id() - { - return id_; - } - const int64_t& id() const - { - return id_; - } - ParticleType& type() - { - return type_; - } - const ParticleType& type() const - { - return type_; - } - - int& n_coord() - { - return n_coord_; - } - const int& n_coord() const - { - return n_coord_; - } - int& cell_instance() - { - return cell_instance_; - } - const int& cell_instance() const - { - return cell_instance_; - } - LocalCoord& coord(int i) - { - return coord_[i]; - } - const LocalCoord& coord(int i) const - { - return coord_[i]; - } - const vector& coord() const - { - return coord_; - } - - LocalCoord& lowest_coord() - { - return coord_[n_coord_ - 1]; - } - const LocalCoord& lowest_coord() const - { - return coord_[n_coord_ - 1]; - } - - int& n_coord_last() - { - return n_coord_last_; - } - const int& n_coord_last() const - { - return n_coord_last_; - } - int& cell_last(int i) - { - return cell_last_[i]; - } - const int& cell_last(int i) const - { - return cell_last_[i]; - } - - double& E() - { - return E_; - } - const double& E() const - { - return E_; - } - double& E_last() - { - return E_last_; - } - const double& E_last() const - { - return E_last_; - } - int& g() - { - return g_; - } - const int& g() const - { - return g_; - } - int& g_last() - { - return g_last_; - } - const int& g_last() const - { - return g_last_; - } - - double& wgt() - { - return wgt_; - } - double wgt() const - { - return wgt_; - } - double& mu() - { - return mu_; - } - const double& mu() const - { - return mu_; - } - double& time() - { - return time_; - } - const double& time() const - { - return time_; - } - double& time_last() - { - return time_last_; - } - const double& time_last() const - { - return time_last_; - } - bool alive() const - { - return wgt_ != 0.0; - } - - Position& r_last_current() - { - return r_last_current_; - } - const Position& r_last_current() const - { - return r_last_current_; - } - Position& r_last() - { - return r_last_; - } - const Position& r_last() const - { - return r_last_; - } - Position& u_last() - { - return u_last_; - } - const Position& u_last() const - { - return u_last_; - } - double& wgt_last() - { - return wgt_last_; - } - const double& wgt_last() const - { - return wgt_last_; - } - - bool& fission() - { - return fission_; - } - TallyEvent& event() - { - return event_; - } - const TallyEvent& event() const - { - return event_; - } - int& event_nuclide() - { - return event_nuclide_; - } - const int& event_nuclide() const - { - return event_nuclide_; - } - int& event_mt() - { - return event_mt_; - } - int& delayed_group() - { - return delayed_group_; - } - - int& n_bank() - { - return n_bank_; - } - int& n_bank_second() - { - return n_bank_second_; - } - double& wgt_bank() - { - return wgt_bank_; - } - int* n_delayed_bank() - { - return n_delayed_bank_; - } - int& n_delayed_bank(int i) - { - return n_delayed_bank_[i]; - } - - int& surface() - { - return surface_; - } - const int& surface() const - { - return surface_; - } - int& cell_born() - { - return cell_born_; - } - const int& cell_born() const - { - return cell_born_; - } - int& material() - { - return material_; - } - const int& material() const - { - return material_; - } - int& material_last() - { - return material_last_; - } - - BoundaryInfo& boundary() - { - return boundary_; - } - - double& sqrtkT() - { - return sqrtkT_; - } - const double& sqrtkT() const - { - return sqrtkT_; - } - double& sqrtkT_last() - { - return sqrtkT_last_; - } - - int& n_collision() - { - return n_collision_; - } - const int& n_collision() const - { - return n_collision_; - } - - bool& write_track() - { - return write_track_; - } - uint64_t& seeds(int i) - { - return seeds_[i]; - } - uint64_t* seeds() - { - return seeds_; - } - int& stream() - { - return stream_; - } - - SourceSite& secondary_bank(int i) - { - return secondary_bank_[i]; - } - decltype(secondary_bank_)& secondary_bank() - { - return secondary_bank_; - } - int64_t& current_work() - { - return current_work_; - } - const int64_t& current_work() const - { - return current_work_; - } - double& flux_derivs(int i) - { - return flux_derivs_[i]; - } - const double& flux_derivs(int i) const - { - return flux_derivs_[i]; - } - decltype(filter_matches_)& filter_matches() - { - return filter_matches_; - } - FilterMatch& filter_matches(int i) - { - return filter_matches_[i]; - } - decltype(tracks_)& tracks() - { - return tracks_; - } - decltype(nu_bank_)& nu_bank() - { - return nu_bank_; - } - NuBank& nu_bank(int i) - { - return nu_bank_[i]; - } - vector& pht_storage() - { - return pht_storage_; - } - - double& keff_tally_absorption() - { - return keff_tally_absorption_; - } - double& keff_tally_collision() - { - return keff_tally_collision_; - } - double& keff_tally_tracklength() - { - return keff_tally_tracklength_; - } - double& keff_tally_leakage() - { - return keff_tally_leakage_; - } - - bool& trace() - { - return trace_; - } - double& collision_distance() - { - return collision_distance_; - } - int& n_event() - { - return n_event_; - } - - int n_split() const - { - return n_split_; - } - int& n_split() - { - return n_split_; - } - - double ww_factor() const - { - return ww_factor_; - } - double& ww_factor() - { - return ww_factor_; - } + NuclideMicroXS& neutron_xs(int i) { return neutron_xs_[i]; } + const NuclideMicroXS& neutron_xs(int i) const { return neutron_xs_[i]; } + ElementMicroXS& photon_xs(int i) { return photon_xs_[i]; } + MacroXS& macro_xs() { return macro_xs_; } + const MacroXS& macro_xs() const { return macro_xs_; } + + int64_t& id() { return id_; } + const int64_t& id() const { return id_; } + ParticleType& type() { return type_; } + const ParticleType& type() const { return type_; } + + int& n_coord() { return n_coord_; } + const int& n_coord() const { return n_coord_; } + int& cell_instance() { return cell_instance_; } + const int& cell_instance() const { return cell_instance_; } + LocalCoord& coord(int i) { return coord_[i]; } + const LocalCoord& coord(int i) const { return coord_[i]; } + const vector& coord() const { return coord_; } + + LocalCoord& lowest_coord() { return coord_[n_coord_ - 1]; } + const LocalCoord& lowest_coord() const { return coord_[n_coord_ - 1]; } + + int& n_coord_last() { return n_coord_last_; } + const int& n_coord_last() const { return n_coord_last_; } + int& cell_last(int i) { return cell_last_[i]; } + const int& cell_last(int i) const { return cell_last_[i]; } + + double& E() { return E_; } + const double& E() const { return E_; } + double& E_last() { return E_last_; } + const double& E_last() const { return E_last_; } + int& g() { return g_; } + const int& g() const { return g_; } + int& g_last() { return g_last_; } + const int& g_last() const { return g_last_; } + + double& wgt() { return wgt_; } + double wgt() const { return wgt_; } + double& mu() { return mu_; } + const double& mu() const { return mu_; } + double& time() { return time_; } + const double& time() const { return time_; } + double& time_last() { return time_last_; } + const double& time_last() const { return time_last_; } + bool alive() const { return wgt_ != 0.0; } + + Position& r_last_current() { return r_last_current_; } + const Position& r_last_current() const { return r_last_current_; } + Position& r_last() { return r_last_; } + const Position& r_last() const { return r_last_; } + Position& u_last() { return u_last_; } + const Position& u_last() const { return u_last_; } + double& wgt_last() { return wgt_last_; } + const double& wgt_last() const { return wgt_last_; } + + bool& fission() { return fission_; } + TallyEvent& event() { return event_; } + const TallyEvent& event() const { return event_; } + int& event_nuclide() { return event_nuclide_; } + const int& event_nuclide() const { return event_nuclide_; } + int& event_mt() { return event_mt_; } + int& delayed_group() { return delayed_group_; } + + int& n_bank() { return n_bank_; } + int& n_bank_second() { return n_bank_second_; } + double& wgt_bank() { return wgt_bank_; } + int* n_delayed_bank() { return n_delayed_bank_; } + int& n_delayed_bank(int i) { return n_delayed_bank_[i]; } + + int& surface() { return surface_; } + const int& surface() const { return surface_; } + int& cell_born() { return cell_born_; } + const int& cell_born() const { return cell_born_; } + int& material() { return material_; } + const int& material() const { return material_; } + int& material_last() { return material_last_; } + + BoundaryInfo& boundary() { return boundary_; } + + double& sqrtkT() { return sqrtkT_; } + const double& sqrtkT() const { return sqrtkT_; } + double& sqrtkT_last() { return sqrtkT_last_; } + + int& n_collision() { return n_collision_; } + const int& n_collision() const { return n_collision_; } + + bool& write_track() { return write_track_; } + uint64_t& seeds(int i) { return seeds_[i]; } + uint64_t* seeds() { return seeds_; } + int& stream() { return stream_; } + + SourceSite& secondary_bank(int i) { return secondary_bank_[i]; } + decltype(secondary_bank_)& secondary_bank() { return secondary_bank_; } + int64_t& current_work() { return current_work_; } + const int64_t& current_work() const { return current_work_; } + double& flux_derivs(int i) { return flux_derivs_[i]; } + const double& flux_derivs(int i) const { return flux_derivs_[i]; } + decltype(filter_matches_)& filter_matches() { return filter_matches_; } + FilterMatch& filter_matches(int i) { return filter_matches_[i]; } + decltype(tracks_)& tracks() { return tracks_; } + decltype(nu_bank_)& nu_bank() { return nu_bank_; } + NuBank& nu_bank(int i) { return nu_bank_[i]; } + vector& pht_storage() { return pht_storage_; } + + double& keff_tally_absorption() { return keff_tally_absorption_; } + double& keff_tally_collision() { return keff_tally_collision_; } + double& keff_tally_tracklength() { return keff_tally_tracklength_; } + double& keff_tally_leakage() { return keff_tally_leakage_; } + + bool& trace() { return trace_; } + double& collision_distance() { return collision_distance_; } + int& n_event() { return n_event_; } + + int n_split() const { return n_split_; } + int& n_split() { return n_split_; } + + double ww_factor() const { return ww_factor_; } + double& ww_factor() { return ww_factor_; } #ifdef DAGMC - moab::DagMC::RayHistory& history() - { - return history_; - } - Direction& last_dir() - { - return last_dir_; - } + moab::DagMC::RayHistory& history() { return history_; } + Direction& last_dir() { return last_dir_; } #endif - int64_t& n_progeny() - { - return n_progeny_; - } + int64_t& n_progeny() { return n_progeny_; } // Accessors for position in global coordinates - Position& r() - { - return coord_[0].r; - } - const Position& r() const - { - return coord_[0].r; - } + Position& r() { return coord_[0].r; } + const Position& r() const { return coord_[0].r; } // Accessors for position in local coordinates - Position& r_local() - { - return coord_[n_coord_ - 1].r; - } - const Position& r_local() const - { - return coord_[n_coord_ - 1].r; - } + Position& r_local() { return coord_[n_coord_ - 1].r; } + const Position& r_local() const { return coord_[n_coord_ - 1].r; } // Accessors for direction in global coordinates - Direction& u() - { - return coord_[0].u; - } - const Direction& u() const - { - return coord_[0].u; - } + Direction& u() { return coord_[0].u; } + const Direction& u() const { return coord_[0].u; } // Accessors for direction in local coordinates - Direction& u_local() - { - return coord_[n_coord_ - 1].u; - } - const Direction& u_local() const - { - return coord_[n_coord_ - 1].u; - } + Direction& u_local() { return coord_[n_coord_ - 1].u; } + const Direction& u_local() const { return coord_[n_coord_ - 1].u; } //! Gets the pointer to the particle's current PRN seed - uint64_t* current_seed() - { - return seeds_ + stream_; - } - const uint64_t* current_seed() const - { - return seeds_ + stream_; - } + uint64_t* current_seed() { return seeds_ + stream_; } + const uint64_t* current_seed() const { return seeds_ + stream_; } //! Force recalculation of neutron xs by setting last energy to zero void invalidate_neutron_xs() diff --git a/include/openmc/plot.h b/include/openmc/plot.h index 02251900cdc..72661511982 100644 --- a/include/openmc/plot.h +++ b/include/openmc/plot.h @@ -29,7 +29,7 @@ namespace model { extern std::unordered_map plot_map; //!< map of plot ids to index extern vector> - plots; //!< Plot instance container + plots; //!< Plot instance container extern uint64_t plotter_seed; // Stream index used by the plotter @@ -151,10 +151,10 @@ class SlicePlotBase { // Members public: - Position origin_; //!< Plot origin in geometry - Position width_; //!< Plot width in geometry - PlotBasis basis_; //!< Plot basis (XY/XZ/YZ) - array pixels_; //!< Plot size in pixels + Position origin_; //!< Plot origin in geometry + Position width_; //!< Plot width in geometry + PlotBasis basis_; //!< Plot basis (XY/XZ/YZ) + array pixels_; //!< Plot size in pixels bool slice_color_overlaps_; //!< Show overlapping cells? int slice_level_ {-1}; //!< Plot universe level private: diff --git a/include/openmc/tallies/tally.h b/include/openmc/tallies/tally.h index 93725743344..005538e500f 100644 --- a/include/openmc/tallies/tally.h +++ b/include/openmc/tallies/tally.h @@ -86,9 +86,9 @@ class Tally { //---------------------------------------------------------------------------- // Major public data members. - int id_ {C_NONE}; //!< User-defined identifier + int id_ {C_NONE}; //!< User-defined identifier - std::string name_; //!< User-defined name + std::string name_; //!< User-defined name TallyType type_ {TallyType::VOLUME}; //!< e.g. volume, surface current diff --git a/src/dagmc.cpp b/src/dagmc.cpp index b42f1a8c54f..01b1e877933 100644 --- a/src/dagmc.cpp +++ b/src/dagmc.cpp @@ -182,10 +182,11 @@ void DAGUniverse::init_geometry() model::cell_map[c->id_] = model::cells.size(); } else { warning(fmt::format("DAGMC Cell IDs: {}", dagmc_ids_for_dim(3))); - fatal_error(fmt::format("DAGMC Universe {} contains a cell with ID {}, which " - "already exists elsewhere in the geometry. Setting auto_geom_ids " - "to True when initiating the DAGMC Universe may " - "resolve this issue", + fatal_error(fmt::format( + "DAGMC Universe {} contains a cell with ID {}, which " + "already exists elsewhere in the geometry. Setting auto_geom_ids " + "to True when initiating the DAGMC Universe may " + "resolve this issue", this->id_, c->id_)); } diff --git a/src/output.cpp b/src/output.cpp index 3a4def2cd7f..17e158d3f32 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -5,8 +5,8 @@ #include // for strlen #include // for time, localtime #include -#include // for setw, setprecision, put_time -#include // for fixed, scientific, left +#include // for setw, setprecision, put_time +#include // for fixed, scientific, left #include #include #include