mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-29 06:35:48 -04:00
Use Position and Direction in Particle class
This commit is contained in:
parent
477309c917
commit
368f89697d
45 changed files with 423 additions and 487 deletions
|
|
@ -45,11 +45,8 @@ void read_particle_restart(Particle& p, int& previous_run_mode)
|
|||
p.type_ = static_cast<Particle::Type>(type);
|
||||
read_dataset(file_id, "weight", p.wgt_);
|
||||
read_dataset(file_id, "energy", p.E_);
|
||||
std::array<double, 3> x;
|
||||
read_dataset(file_id, "xyz", x);
|
||||
std::copy(x.data(), x.data() + 3, p.coord_[0].xyz);
|
||||
read_dataset(file_id, "uvw", x);
|
||||
std::copy(x.data(), x.data() + 3, p.coord_[0].uvw);
|
||||
read_dataset(file_id, "xyz", p.r());
|
||||
read_dataset(file_id, "uvw", p.u());
|
||||
|
||||
// Set energy group and average energy in multi-group mode
|
||||
if (!settings::run_CE) {
|
||||
|
|
@ -59,9 +56,9 @@ void read_particle_restart(Particle& p, int& previous_run_mode)
|
|||
|
||||
// Set particle last attributes
|
||||
p.last_wgt_ = p.wgt_;
|
||||
std::copy(p.coord_[0].xyz, p.coord_[0].xyz + 3, p.last_xyz_current_);
|
||||
std::copy(p.coord_[0].xyz, p.coord_[0].xyz + 3, p.last_xyz_);
|
||||
std::copy(p.coord_[0].uvw, p.coord_[0].uvw + 3, p.last_uvw_);
|
||||
p.r_last_current_ = p.r();
|
||||
p.r_last_ = p.r();
|
||||
p.u_last_ = p.u();
|
||||
p.last_E_ = p.E_;
|
||||
p.last_g_ = p.g_;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue