Reverted last commit.
Changed powerlaw drawing from left to right cell for power calculation
This commit is contained in:
@@ -161,9 +161,9 @@ void BorisMover::move(particle::Particle* particle,
|
|||||||
? delta_timeresolution*SimConstants::compare_epsilon
|
? delta_timeresolution*SimConstants::compare_epsilon
|
||||||
: (max_time_alive - timestep);
|
: (max_time_alive - timestep);
|
||||||
}
|
}
|
||||||
if(died_in_bin && !left_simulation_domain
|
if(died_in_bin && !left_simulation_domain) {
|
||||||
&& (leftover_time > SimConstants::compare_epsilon ||
|
// && (leftover_time > SimConstants::compare_epsilon ||
|
||||||
changed_energy_bin || changed_mu_bin || changed_position_bin)) {
|
// changed_energy_bin || changed_mu_bin || changed_position_bin)) {
|
||||||
// use new values, since that is necessary if died_in_bin and a change in
|
// use new values, since that is necessary if died_in_bin and a change in
|
||||||
// bin can occur at the same time
|
// bin can occur at the same time
|
||||||
particle->specie()->dynamicDensityField()->logMovement(
|
particle->specie()->dynamicDensityField()->logMovement(
|
||||||
|
|||||||
@@ -498,8 +498,7 @@ void Simulation::processUntilTermination(
|
|||||||
if (particle.specie()->terminator()->reachedMaxTimeAlive(
|
if (particle.specie()->terminator()->reachedMaxTimeAlive(
|
||||||
&particle) &&
|
&particle) &&
|
||||||
!particle.specie()->terminator()->leftSimulationDomain(
|
!particle.specie()->terminator()->leftSimulationDomain(
|
||||||
&particle) &&
|
&particle)) {
|
||||||
particle.wasDeposited()) {
|
|
||||||
#ifdef debug_level3
|
#ifdef debug_level3
|
||||||
DEBUG_LEVEL_3("Terminate particle " + particle.specie()->name() +
|
DEBUG_LEVEL_3("Terminate particle " + particle.specie()->name() +
|
||||||
". Reached timeresolution.");
|
". Reached timeresolution.");
|
||||||
@@ -574,14 +573,14 @@ void Simulation::processUntilTermination(
|
|||||||
// in order to log the position. (Not ideal, but otherwise it would be a bit
|
// in order to log the position. (Not ideal, but otherwise it would be a bit
|
||||||
// more effort to calculate the pitchangle here again...)
|
// more effort to calculate the pitchangle here again...)
|
||||||
// should work, since the check for died in bin should immediatly happen (hopefully)
|
// should work, since the check for died in bin should immediatly happen (hopefully)
|
||||||
if(particle.specie()->terminator()->reachedMaxTimeAlive(&particle)
|
// if(particle.specie()->terminator()->reachedMaxTimeAlive(&particle)
|
||||||
&& !particle.wasDeposited() && !output.deleteCurrentParticle()) {
|
// && !particle.wasDeposited() && !output.deleteCurrentParticle()) {
|
||||||
particle.specie()->mover()->move(&particle, 1,
|
// particle.specie()->mover()->move(&particle, 1,
|
||||||
electric_field_.get(), magnetic_field_.get(), gravity_field_.get());
|
// electric_field_.get(), magnetic_field_.get(), gravity_field_.get());
|
||||||
if(!particle.wasDeposited()) {
|
// if(!particle.wasDeposited()) {
|
||||||
ERROR("particle was not deposited even though it should have been");
|
// ERROR("particle was not deposited even though it should have been");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
particle.increaseInteractionCounter();
|
particle.increaseInteractionCounter();
|
||||||
|
|
||||||
|
|||||||
@@ -225,11 +225,19 @@ CartesianVector VelocityDistributionFromDensityField::drawVelocity(
|
|||||||
// DEBUG(out.str());
|
// DEBUG(out.str());
|
||||||
// #endif
|
// #endif
|
||||||
} else {
|
} else {
|
||||||
double nl = density_field_->particleNumber(index -
|
// check missing for if nl or nr = 0! -> what alpha to choose?
|
||||||
blitz::TinyVector<int, 5>(0,0,0,0,1));
|
double nl = density_field_->particleNumber(index);
|
||||||
double nr = density_field_->particleNumber(index);
|
double nr = density_field_->particleNumber(index+
|
||||||
|
blitz::TinyVector<int,5>(0,0,0,0,1));
|
||||||
|
|
||||||
double alpha = std::log(nr/nl)/std::log(energyBinBorders_[index(4) + 2]/
|
double alpha = std::log(nr/nl)/std::log(energyBinBorders_[index(4) + 2]/
|
||||||
energyBinBorders_[index(4) + 1]);
|
energyBinBorders_[index(4) + 1]);
|
||||||
|
// no reason for specific values, just to avoid these cases
|
||||||
|
if(nl == 0) {
|
||||||
|
alpha = 1;
|
||||||
|
} else if (nr == 0) {
|
||||||
|
alpha = -1;
|
||||||
|
}
|
||||||
if(alpha == -1) {
|
if(alpha == -1) {
|
||||||
energy_eV = (std::pow(2, theta_distribution_(*engine)) - 1)*energy_step
|
energy_eV = (std::pow(2, theta_distribution_(*engine)) - 1)*energy_step
|
||||||
+ energyBinBorders_[index(4) + 1];
|
+ energyBinBorders_[index(4) + 1];
|
||||||
|
|||||||
Reference in New Issue
Block a user