use base class to handle layout of particle data

This commit is contained in:
Gavin Ridley 2021-04-16 15:35:33 -04:00
parent 5cf8482d9a
commit 2af4c9cd92
39 changed files with 834 additions and 795 deletions

View file

@ -44,7 +44,7 @@ void read_particle_restart(Particle& p, RunMode& previous_run_mode)
read_dataset(file_id, "id", p.id());
int type;
read_dataset(file_id, "type", type);
p.type() = static_cast<Particle::Type>(type);
p.type() = static_cast<ParticleType>(type);
read_dataset(file_id, "weight", p.wgt());
read_dataset(file_id, "energy", p.E());
read_dataset(file_id, "xyz", p.r());
@ -116,16 +116,6 @@ void run_particle_restart()
if (p.write_track())
add_particle_track(p);
// Every particle starts with no accumulated flux derivative.
if (!model::active_tallies.empty()) {
p.flux_derivs().resize(model::tally_derivs.size(), 0.0);
std::fill(p.flux_derivs().begin(), p.flux_derivs().end(), 0.0);
}
// Allocate space for tally filter matches (TODO shouldn't this be in the
// particle constructor, instead?)
p.filter_matches().resize(model::tally_filters.size());
// Transport neutron
transport_history_based_single_particle(p);