mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
use base class to handle layout of particle data
This commit is contained in:
parent
5cf8482d9a
commit
2af4c9cd92
39 changed files with 834 additions and 795 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue