mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-29 06:35:48 -04:00
Expand Particle::tracks_ to include full state
This commit is contained in:
parent
7752afb554
commit
a6bd42ee8e
3 changed files with 42 additions and 5 deletions
|
|
@ -56,6 +56,18 @@ struct SourceSite {
|
|||
int64_t progeny_id;
|
||||
};
|
||||
|
||||
//! State of a particle used for particle track files
|
||||
struct TrackState {
|
||||
Position r;
|
||||
Direction u;
|
||||
double E;
|
||||
double time {0.0};
|
||||
double wgt {1.0};
|
||||
int cell_id;
|
||||
int material_id {-1};
|
||||
ParticleType particle;
|
||||
};
|
||||
|
||||
//! Saved ("banked") state of a particle, for nu-fission tallying
|
||||
struct NuBank {
|
||||
double E; //!< particle energy
|
||||
|
|
@ -290,7 +302,7 @@ private:
|
|||
|
||||
vector<FilterMatch> filter_matches_; // tally filter matches
|
||||
|
||||
vector<vector<Position>> tracks_; // tracks for outputting to file
|
||||
vector<vector<TrackState>> tracks_; // tracks for outputting to file
|
||||
|
||||
vector<NuBank> nu_bank_; // bank of most recently fissioned particles
|
||||
|
||||
|
|
@ -342,6 +354,9 @@ public:
|
|||
const LocalCoord& coord(int i) const { return coord_[i]; }
|
||||
const vector<LocalCoord>& coord() const { return coord_; }
|
||||
|
||||
LocalCoord& lowest_coord() { return coord_[n_coord_ - 1]; }
|
||||
const LocalCoord& lowest_coord() const { return coord_[n_coord_ - 1]; }
|
||||
|
||||
int& n_coord_last() { return n_coord_last_; }
|
||||
const int& n_coord_last() const { return n_coord_last_; }
|
||||
int& cell_last(int i) { return cell_last_[i]; }
|
||||
|
|
@ -357,6 +372,7 @@ public:
|
|||
const int& g_last() const { return g_last_; }
|
||||
|
||||
double& wgt() { return wgt_; }
|
||||
double wgt() const { return wgt_; }
|
||||
double& mu() { return mu_; }
|
||||
const double& mu() const { return mu_; }
|
||||
double& time() { return time_; }
|
||||
|
|
@ -479,6 +495,9 @@ public:
|
|||
n_coord_ = 1;
|
||||
}
|
||||
|
||||
//! Get track information based on particle's current state
|
||||
TrackState get_track_state() const;
|
||||
|
||||
void zero_delayed_bank()
|
||||
{
|
||||
for (int& n : n_delayed_bank_) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue