Incorporation of comments from code review.

This commit is contained in:
John Tramm 2020-01-27 17:02:39 +00:00
parent 48a550aaf7
commit 02470bc630
8 changed files with 43 additions and 41 deletions

View file

@ -31,6 +31,7 @@ extern "C" bool cmfd_run; //!< is a CMFD run?
extern "C" bool dagmc; //!< indicator of DAGMC geometry
extern bool delayed_photon_scaling; //!< Scale fission photon yield to include delayed
extern "C" bool entropy_on; //!< calculate Shannon entropy?
extern bool event_based; //!< use event-based mode (instead of history-based)
extern bool legendre_to_tabular; //!< convert Legendre distributions to tabular?
extern bool material_cell_offsets; //!< create material cells offsets?
extern "C" bool output_summary; //!< write summary.h5?
@ -52,7 +53,6 @@ extern bool ufs_on; //!< uniform fission site method on?
extern bool urr_ptables_on; //!< use unresolved resonance prob. tables?
extern bool write_all_tracks; //!< write track files for every particle?
extern bool write_initial_source; //!< write out initial source file?
extern bool event_based; //!< use event-based mode (instead of history-based)
// Paths to various files
extern std::string path_cross_sections; //!< path to cross_sections.xml
@ -69,7 +69,7 @@ extern "C" int32_t gen_per_batch; //!< number of generations per batch
extern "C" int64_t n_particles; //!< number of particles per generation
extern "C" int64_t max_in_flight_particles; //!< Max num. event-based particles in flight
extern int64_t max_particles_in_flight; //!< Max num. event-based particles in flight
extern ElectronTreatment electron_treatment; //!< how to treat secondary electrons
extern std::array<double, 4> energy_cutoff; //!< Energy cutoff in [eV] for each particle type

View file

@ -4,7 +4,7 @@
//! \file shared_array.h
//! \brief Shared array data structure
#include<memory>
#include <memory>
namespace openmc {
@ -24,14 +24,6 @@ namespace openmc {
template <typename T>
class SharedArray {
private:
//==========================================================================
// Data members
std::unique_ptr<T[]> data_; //!< A pointer to hold the data
int64_t size_ {0}; //!< The current size of the SharedArray.
int64_t capacity_ {0}; //!< The maximum capacity of the SharedArray.
public:
//==========================================================================
// Constructors
@ -55,6 +47,7 @@ public:
//! Return a reference to the element at specified location i. No bounds
//! checking is performed.
T& operator[](int64_t i) {return data_[i];}
const T& operator[](int64_t i) const { return data_[i]; }
//! Allocate space in the container for the specified number of elements.
//! reserve() does not change the size of the container.
@ -116,6 +109,15 @@ public:
//! Return pointer to the underlying array serving as element storage.
T* data() {return data_.get();}
const T* data() const {return data_.get();}
private:
//==========================================================================
// Data members
std::unique_ptr<T[]> data_; //!< A pointer to hold the data
int64_t size_ {0}; //!< The current size of the SharedArray.
int64_t capacity_ {0}; //!< The maximum capacity of the SharedArray.
};