add some accessors for copying stuff to GPU

This commit is contained in:
Gavin Ridley 2020-03-19 15:43:39 -04:00
parent 8154e5a035
commit 24843a4593
3 changed files with 31 additions and 0 deletions

View file

@ -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

View file

@ -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
};

View file

@ -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