Merge pull request #1454 from gridley/add_enums2

Attempt number two at enum conversion!
This commit is contained in:
Paul Romano 2020-01-21 17:13:35 -06:00 committed by GitHub
commit 832c32e16a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
90 changed files with 865 additions and 894 deletions

View file

@ -14,9 +14,17 @@
namespace openmc {
// Different independent variables
enum class DerivativeVariable {
DENSITY,
NUCLIDE_DENSITY,
TEMPERATURE
};
struct TallyDerivative {
DerivativeVariable variable; //!< Independent variable (like temperature)
int id; //!< User-defined identifier
int variable; //!< Independent variable (like temperature)
int diff_material; //!< Material this derivative is applied to
int diff_nuclide; //!< Nuclide this material is applied to
@ -66,12 +74,6 @@ extern std::vector<TallyDerivative> tally_derivs;
extern std::unordered_map<int, int> tally_deriv_map;
} // namespace model
// Independent variables
//TODO: convert to enum
constexpr int DIFF_DENSITY {1};
constexpr int DIFF_NUCLIDE_DENSITY {2};
constexpr int DIFF_TEMPERATURE {3};
} // namespace openmc
#endif // OPENMC_TALLIES_DERIVATIVE_H

View file

@ -58,7 +58,7 @@ public:
//! \param[out] match will contain the matching bins and corresponding
//! weights; note that there may be zero matching bins
virtual void
get_all_bins(const Particle* p, int estimator, FilterMatch& match) const = 0;
get_all_bins(const Particle* p, TallyEstimator estimator, FilterMatch& match) const = 0;
//! Writes data describing this filter to an HDF5 statepoint group.
virtual void

View file

@ -29,7 +29,7 @@ public:
void from_xml(pugi::xml_node node) override;
void get_all_bins(const Particle* p, int estimator, FilterMatch& match)
void get_all_bins(const Particle* p, TallyEstimator estimator, FilterMatch& match)
const override;
void to_statepoint(hid_t filter_group) const override;

View file

@ -30,7 +30,7 @@ public:
void from_xml(pugi::xml_node node) override;
void get_all_bins(const Particle* p, int estimator, FilterMatch& match)
void get_all_bins(const Particle* p, TallyEstimator estimator, FilterMatch& match)
const override;
void to_statepoint(hid_t filter_group) const override;

View file

@ -33,7 +33,7 @@ public:
void from_xml(pugi::xml_node node) override;
void get_all_bins(const Particle* p, int estimator, FilterMatch& match)
void get_all_bins(const Particle* p, TallyEstimator estimator, FilterMatch& match)
const override;
void to_statepoint(hid_t filter_group) const override;

View file

@ -19,7 +19,7 @@ public:
std::string type() const override {return "cellborn";}
void get_all_bins(const Particle* p, int estimator, FilterMatch& match)
void get_all_bins(const Particle* p, TallyEstimator estimator, FilterMatch& match)
const override;
std::string text_label(int bin) const override;

View file

@ -19,7 +19,7 @@ public:
std::string type() const override {return "cellfrom";}
void get_all_bins(const Particle* p, int estimator, FilterMatch& match)
void get_all_bins(const Particle* p, TallyEstimator estimator, FilterMatch& match)
const override;
std::string text_label(int bin) const override;

View file

@ -31,7 +31,7 @@ public:
void from_xml(pugi::xml_node node) override;
void get_all_bins(const Particle* p, int estimator, FilterMatch& match)
void get_all_bins(const Particle* p, TallyEstimator estimator, FilterMatch& match)
const override;
void to_statepoint(hid_t filter_group) const override;

View file

@ -26,7 +26,7 @@ public:
void from_xml(pugi::xml_node node) override;
void get_all_bins(const Particle* p, int estimator, FilterMatch& match)
void get_all_bins(const Particle* p, TallyEstimator estimator, FilterMatch& match)
const override;
void to_statepoint(hid_t filter_group) const override;

View file

@ -28,7 +28,7 @@ public:
void from_xml(pugi::xml_node node) override;
void get_all_bins(const Particle* p, int estimator, FilterMatch& match)
void get_all_bins(const Particle* p, TallyEstimator estimator, FilterMatch& match)
const override;
void to_statepoint(hid_t filter_group) const override;
@ -68,7 +68,7 @@ public:
std::string type() const override {return "energyout";}
void get_all_bins(const Particle* p, int estimator, FilterMatch& match)
void get_all_bins(const Particle* p, TallyEstimator estimator, FilterMatch& match)
const override;
std::string text_label(int bin) const override;

View file

@ -33,7 +33,7 @@ public:
void from_xml(pugi::xml_node node) override;
void get_all_bins(const Particle* p, int estimator, FilterMatch& match)
void get_all_bins(const Particle* p, TallyEstimator estimator, FilterMatch& match)
const override;
void to_statepoint(hid_t filter_group) const override;

View file

@ -26,7 +26,7 @@ public:
void from_xml(pugi::xml_node node) override;
void get_all_bins(const Particle* p, int estimator, FilterMatch& match)
void get_all_bins(const Particle* p, TallyEstimator estimator, FilterMatch& match)
const override;
void to_statepoint(hid_t filter_group) const override;

View file

@ -30,7 +30,7 @@ public:
void from_xml(pugi::xml_node node) override;
void get_all_bins(const Particle* p, int estimator, FilterMatch& match)
void get_all_bins(const Particle* p, TallyEstimator estimator, FilterMatch& match)
const override;
void to_statepoint(hid_t filter_group) const override;

View file

@ -28,7 +28,7 @@ public:
void from_xml(pugi::xml_node node) override;
void get_all_bins(const Particle* p, int estimator, FilterMatch& match)
void get_all_bins(const Particle* p, TallyEstimator estimator, FilterMatch& match)
const override;
void to_statepoint(hid_t filter_group) const override;

View file

@ -13,7 +13,7 @@ public:
std::string type() const override {return "meshsurface";}
void get_all_bins(const Particle* p, int estimator, FilterMatch& match)
void get_all_bins(const Particle* p, TallyEstimator estimator, FilterMatch& match)
const override;
std::string text_label(int bin) const override;
@ -22,6 +22,21 @@ public:
// Accessors
void set_mesh(int32_t mesh) override;
enum class MeshDir {
OUT_LEFT, // x min
IN_LEFT, // x min
OUT_RIGHT, // x max
IN_RIGHT, // x max
OUT_BACK, // y min
IN_BACK, // y min
OUT_FRONT, // y max
IN_FRONT, // y max
OUT_BOTTOM, // z min
IN_BOTTOM, // z min
OUT_TOP, // z max
IN_TOP // z max
};
};
} // namespace openmc

View file

@ -29,7 +29,7 @@ public:
void from_xml(pugi::xml_node node) override;
void get_all_bins(const Particle* p, int estimator, FilterMatch& match)
void get_all_bins(const Particle* p, TallyEstimator estimator, FilterMatch& match)
const override;
void to_statepoint(hid_t filter_group) const override;

View file

@ -27,7 +27,7 @@ public:
void from_xml(pugi::xml_node node) override;
void get_all_bins(const Particle* p, int estimator, FilterMatch& match)
void get_all_bins(const Particle* p, TallyEstimator estimator, FilterMatch& match)
const override;
void to_statepoint(hid_t filter_group) const override;

View file

@ -29,7 +29,7 @@ public:
void from_xml(pugi::xml_node node) override;
void get_all_bins(const Particle* p, int estimator, FilterMatch& match)
void get_all_bins(const Particle* p, TallyEstimator estimator, FilterMatch& match)
const override;
void to_statepoint(hid_t filter_group) const override;

View file

@ -32,7 +32,7 @@ public:
void from_xml(pugi::xml_node node) override;
void get_all_bins(const Particle* p, int estimator, FilterMatch& match)
void get_all_bins(const Particle* p, TallyEstimator estimator, FilterMatch& match)
const override;
void to_statepoint(hid_t filter_group) const override;

View file

@ -30,7 +30,7 @@ public:
void from_xml(pugi::xml_node node) override;
void get_all_bins(const Particle* p, int estimator, FilterMatch& match)
void get_all_bins(const Particle* p, TallyEstimator estimator, FilterMatch& match)
const override;
void to_statepoint(hid_t filter_group) const override;

View file

@ -30,7 +30,7 @@ public:
void from_xml(pugi::xml_node node) override;
void get_all_bins(const Particle* p, int estimator, FilterMatch& match)
void get_all_bins(const Particle* p, TallyEstimator estimator, FilterMatch& match)
const override;
void to_statepoint(hid_t filter_group) const override;

View file

@ -30,7 +30,7 @@ public:
void from_xml(pugi::xml_node node) override;
void get_all_bins(const Particle* p, int estimator, FilterMatch& match)
void get_all_bins(const Particle* p, TallyEstimator estimator, FilterMatch& match)
const override;
void to_statepoint(hid_t filter_group) const override;

View file

@ -26,7 +26,7 @@ public:
void from_xml(pugi::xml_node node) override;
void get_all_bins(const Particle* p, int estimator, FilterMatch& match)
void get_all_bins(const Particle* p, TallyEstimator estimator, FilterMatch& match)
const override;
void to_statepoint(hid_t filter_group) const override;
@ -76,7 +76,7 @@ public:
std::string type() const override {return "zernikeradial";}
void get_all_bins(const Particle* p, int estimator, FilterMatch& match)
void get_all_bins(const Particle* p, TallyEstimator estimator, FilterMatch& match)
const override;
std::string text_label(int bin) const override;

View file

@ -79,10 +79,10 @@ public:
std::string name_; //!< User-defined name
int type_ {TALLY_VOLUME}; //!< e.g. volume, surface current
TallyType type_ {TallyType::VOLUME}; //!< e.g. volume, surface current
//! Event type that contributes to this tally
int estimator_ {ESTIMATOR_TRACKLENGTH};
TallyEstimator estimator_ {TallyEstimator::TRACKLENGTH};
//! Whether this tally is currently being updated
bool active_ {false};