diff --git a/include/openmc/distribution_multi.h b/include/openmc/distribution_multi.h index 493ad85e07..1b1a262b82 100644 --- a/include/openmc/distribution_multi.h +++ b/include/openmc/distribution_multi.h @@ -43,6 +43,11 @@ public: //! \param seed Pseudorandom number seed pointer //! \return Direction sampled Direction sample(uint64_t* seed) const; + + // Observing pointers + auto mu() const { return mu_.get(); } + auto phi() const { return phi_.get(); } + private: UPtrDist mu_; //!< Distribution of polar angle UPtrDist phi_; //!< Distribution of azimuthal angle diff --git a/include/openmc/distribution_spatial.h b/include/openmc/distribution_spatial.h index f3c7bb67d4..8d5017a81e 100644 --- a/include/openmc/distribution_spatial.h +++ b/include/openmc/distribution_spatial.h @@ -32,6 +32,11 @@ public: //! \param seed Pseudorandom number seed pointer //! \return Sampled position Position sample(uint64_t* seed) const; + + // Observer pointers + auto x() const { return x_.get(); } + auto y() const { return x_.get(); } + auto z() const { return x_.get(); } private: UPtrDist x_; //!< Distribution of x coordinates UPtrDist y_; //!< Distribution of y coordinates @@ -50,6 +55,11 @@ public: //! \param seed Pseudorandom number seed pointer //! \return Sampled position Position sample(uint64_t* seed) const; + + auto r() const { return r_.get(); } + auto phi() const { return phi_.get(); } + auto z() const { return z_.get(); } + auto origin() const { return origin_; } private: UPtrDist r_; //!< Distribution of r coordinates UPtrDist phi_; //!< Distribution of phi coordinates @@ -70,6 +80,11 @@ public: //! \param seed Pseudorandom number seed pointer //! \return Sampled position Position sample(uint64_t* seed) const; + + auto r() const { return r_.get(); } + auto theta() const { return theta_.get(); } + auto phi() const { return phi_.get(); } + auto origin () const { return origin_; } private: UPtrDist r_; //!< Distribution of r coordinates UPtrDist theta_; //!< Distribution of theta coordinates @@ -92,6 +107,8 @@ public: // Properties bool only_fissionable() const { return only_fissionable_; } + Position lower_left() const { return lower_left_; } + Position upper_right() const { return upper_right_; } private: Position lower_left_; //!< Lower-left coordinates of box Position upper_right_; //!< Upper-right coordinates of box @@ -112,6 +129,8 @@ public: //! \param seed Pseudorandom number seed pointer //! \return Sampled position Position sample(uint64_t* seed) const; + + auto r() const { return r_; } private: Position r_; //!< Single position at which sites are generated }; diff --git a/include/openmc/source.h b/include/openmc/source.h index 97b18d2286..aaa0f48e0f 100644 --- a/include/openmc/source.h +++ b/include/openmc/source.h @@ -43,7 +43,14 @@ public: Particle::Bank sample(uint64_t* seed) const; // Properties + Particle::Type particle_type() const { return particle_; } double strength() const { return strength_; } + + // Make observing pointers available + auto space() const { return space_.get(); } + auto angle() const { return angle_.get(); } + auto energy() const { return energy_.get(); } + private: Particle::Type particle_ {Particle::Type::neutron}; //!< Type of particle emitted double strength_ {1.0}; //!< Source strength