Move tally % nuclide_bins to C++

This commit is contained in:
Sterling Harper 2019-01-27 14:29:23 -05:00
parent e99fd9e7e4
commit f4d7c81bd4
8 changed files with 164 additions and 72 deletions

View file

@ -20,6 +20,9 @@ class Tally {
public:
Tally() {}
//----------------------------------------------------------------------------
// Methods for getting and setting filter/stride data.
const std::vector<int32_t>& filters() {return filters_;}
int32_t filters(int i) const {return filters_[i];}
@ -30,13 +33,26 @@ public:
int32_t n_filter_bins() const {return n_filter_bins_;}
//----------------------------------------------------------------------------
// Major public data members.
int type_ {TALLY_VOLUME}; //!< volume, surface current
//! Event type that contributes to this tally
int estimator_ {ESTIMATOR_TRACKLENGTH};
//! Whether this tally is currently being updated
bool active_ {false};
//! Index of each nuclide to be tallied. -1 indicates total material.
std::vector<int> nuclides_;
//! True if this tally has a bin for every nuclide in the problem
bool all_nuclides_ {false};
//----------------------------------------------------------------------------
// Miscellaneous public members.
// We need to have quick access to some filters. The following gives indices
// for various filters that could be in the tally or C_NONE if they are not
// present.
@ -49,6 +65,9 @@ public:
int deriv_ {C_NONE}; //!< Index of a TallyDerivative object for diff tallies.
private:
//----------------------------------------------------------------------------
// Private data.
std::vector<int32_t> filters_; //!< Filter indices in global filters array
//! Index strides assigned to each filter to support 1D indexing.