From d45583ed1914a40ae699ca5364eba66bc732fd49 Mon Sep 17 00:00:00 2001 From: Gavin Ridley Date: Fri, 7 Feb 2020 15:16:02 -0500 Subject: [PATCH] add some getters to 1D distributions --- include/openmc/distribution.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/openmc/distribution.h b/include/openmc/distribution.h index f9d718cdb..33ff2ffcb 100644 --- a/include/openmc/distribution.h +++ b/include/openmc/distribution.h @@ -62,6 +62,9 @@ public: //! \param seed Pseudorandom number seed pointer //! \return Sampled value double sample(uint64_t* seed) const; + + double a() const { return a_; } + double b() const { return a_; } private: double a_; //!< Lower bound of distribution double b_; //!< Upper bound of distribution @@ -80,6 +83,8 @@ public: //! \param seed Pseudorandom number seed pointer //! \return Sampled value double sample(uint64_t* seed) const; + + double theta() const { return theta_; } private: double theta_; //!< Factor in exponential [eV] }; @@ -97,6 +102,9 @@ public: //! \param seed Pseudorandom number seed pointer //! \return Sampled value double sample(uint64_t* seed) const; + + double a() const { return a_; } + double b() const { return b_; } private: double a_; //!< Factor in exponential [eV] double b_; //!< Factor in square root [1/eV] @@ -115,6 +123,9 @@ public: //! \param seed Pseudorandom number seed pointer //! \return Sampled value double sample(uint64_t* seed) const; + + double mean_value() const { return mean_value_; } + double std_dev() const { return std_dev_; } private: double mean_value_; //!< middle of distribution [eV] double std_dev_; //!< standard deviation [eV] @@ -134,6 +145,10 @@ public: //! \param seed Pseudorandom number seed pointer //! \return Sampled value double sample(uint64_t* seed) const; + + double e0() const { return e0_; } + double m_rat() const { return m_rat_; } + double kt() const { return kt_; } private: // example DT fusion m_rat = 5 (D = 2 + T = 3) // ion temp = 20000 eV @@ -161,6 +176,8 @@ public: // x property std::vector& x() { return x_; } const std::vector& x() const { return x_; } + const std::vector& p() const { return p_; } + Interpolation interp() const { return interp_; } private: std::vector x_; //!< tabulated independent variable std::vector p_; //!< tabulated probability density @@ -188,6 +205,8 @@ public: //! \param seed Pseudorandom number seed pointer //! \return Sampled value double sample(uint64_t* seed) const; + + const std::vector& x() const { return x_; } private: std::vector x_; //! Possible outcomes };