diff --git a/include/openmc/particle_data.h b/include/openmc/particle_data.h index f72948f6eb..93001134e3 100644 --- a/include/openmc/particle_data.h +++ b/include/openmc/particle_data.h @@ -352,6 +352,10 @@ public: Position& r_born() { return r_born_; } const Position& r_born() const { return r_born_; } + // Direction at birth + Direction& u_born() { return u_born_; } + const Direction& u_born() const { return u_born_; } + // Coordinates of last collision or reflective/periodic surface // crossing for current tallies Position& r_last_current() { return r_last_current_; } @@ -426,6 +430,7 @@ private: vector cell_last_; //!< coordinates for all levels Position r_born_; //!< coordinates at birth + Position u_born_; //!< direction at birth Position r_last_current_; //!< coordinates of the last collision or //!< reflective/periodic surface crossing for //!< current tallies diff --git a/src/particle.cpp b/src/particle.cpp index 779ae18da9..fa3bcc7f51 100644 --- a/src/particle.cpp +++ b/src/particle.cpp @@ -165,6 +165,7 @@ void Particle::from_source(const SourceSite* src) r() = src->r; u() = src->u; r_born() = src->r; + u_born() = src->u; r_last_current() = src->r; r_last() = src->r; u_last() = src->u;