Fixed bug with mu=-1; added nan-check in
drawing velocity from density if DO_DEBUG is true in the config file
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "simulation/velocity_distribution_function.h"
|
||||
#include "simulation/density_field.h"
|
||||
#include "simulation/electromagnetic_field.h"
|
||||
#include "simulation/errors.h"
|
||||
|
||||
// utility function returning a unit vector perpendicular to the given
|
||||
// (cartesian) TinyVector
|
||||
@@ -119,7 +120,24 @@ CartesianVector VelocityDistributionFromDensityField::rollVelocity(
|
||||
pitchAngleBinBorders_.end(),
|
||||
pitchAngleValues.begin());
|
||||
|
||||
double pitchAngle = pitchAngle_dist(*engine);
|
||||
double pitchAngle = pitchAngle_dist(*engine);
|
||||
|
||||
#ifdef debug
|
||||
if((std::isnan(pitchAngle)) || (std::isnan(energy_eV))) {
|
||||
std::stringstream out;
|
||||
out << "pitchAngle: " << pitchAngle;
|
||||
out << "\nenergy value: " << energy_eV;
|
||||
out << "\nenergy values: " << energyValues;
|
||||
out << "\npitch angle values: " << pitchAngleValues;
|
||||
out << "\nenergy bin borders: [ ";
|
||||
for(auto element : energyBinBorders_) {
|
||||
out << element << " ";
|
||||
}
|
||||
out << "]";
|
||||
|
||||
ERROR(out.str());
|
||||
}
|
||||
#endif
|
||||
|
||||
// construct the velocity
|
||||
|
||||
|
||||
Reference in New Issue
Block a user