built restart utilities
This commit is contained in:
@@ -232,6 +232,7 @@ blitz::TinyVector<double, 4> DynamicDensityField::drawPositionAndEnergy(
|
||||
DEBUG_LEVEL_3("Density is empty");
|
||||
return blitz::TinyVector<double, 4> (0,0,0,0);
|
||||
}
|
||||
setDensityDistribution();
|
||||
double random_r, random_z, random_phi, random_E, random_n;
|
||||
double density_in_random_cell;
|
||||
|
||||
@@ -324,6 +325,44 @@ void DynamicDensityField::resetDynamicDensityField() {
|
||||
sync_deleted_particles_ = 0.;
|
||||
}
|
||||
|
||||
void DynamicDensityField::restartTimer(double time, double delta_t) {
|
||||
// make sure that the timer can only be restarted once (per dynamicDensityField object)
|
||||
// probably not necessary, but whatever
|
||||
if(timer_restarted_) {
|
||||
return;
|
||||
}
|
||||
timer_restarted_ = true;
|
||||
timer_->setTime(time);
|
||||
timer_->setDeltaT(delta_t);
|
||||
}
|
||||
|
||||
void DynamicDensityField::restartTimeInBin(blitz::Array<double, 4> time_in_bin) {
|
||||
if(!blitz::all(time_in_bin_s_.length() == time_in_bin.length())) {
|
||||
std::stringstream out;
|
||||
out << "Expected a size of " << time_in_bin_s_.length();
|
||||
out << ", received a length of " << time_in_bin.length();
|
||||
out << " for time_in_bin array";
|
||||
ERROR(out.str());
|
||||
}
|
||||
std::stringstream out;
|
||||
out << "Before: " << time_in_bin_s_;
|
||||
time_in_bin_s_ = time_in_bin.copy();
|
||||
out << "After: " << time_in_bin_s_;
|
||||
// DEBUG_LEVEL_0(out.str());
|
||||
}
|
||||
|
||||
void DynamicDensityField::restartDeletedParticlesArray(
|
||||
blitz::Array<long int, 4> deleted_particles) {
|
||||
if(!blitz::all(deleted_particles_.length() == deleted_particles.length())) {
|
||||
std::stringstream out;
|
||||
out << "Expected a size of " << deleted_particles_.length();
|
||||
out << ", received a length of " << deleted_particles.length();
|
||||
out << " for deleted_particles array";
|
||||
ERROR(out.str());
|
||||
}
|
||||
deleted_particles_ = deleted_particles.copy();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user