changed the way powerlaw drawing alpha is limited
This commit is contained in:
@@ -67,6 +67,8 @@ class VelocityDistributionFromDensityField : public VelocityDistribution {
|
|||||||
private:
|
private:
|
||||||
// mass of the species of which the density field is a part of
|
// mass of the species of which the density field is a part of
|
||||||
const double mass_kg_;
|
const double mass_kg_;
|
||||||
|
double alpha_lower_limit;
|
||||||
|
double alpha_upper_limit;
|
||||||
|
|
||||||
std::shared_ptr<DynamicDensityField> density_field_;
|
std::shared_ptr<DynamicDensityField> density_field_;
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ VelocityDistributionFromDensityField::VelocityDistributionFromDensityField(
|
|||||||
pitchAngleBinBorders_(density_field->pitchAngleBinning()->binBorders()),
|
pitchAngleBinBorders_(density_field->pitchAngleBinning()->binBorders()),
|
||||||
theta_distribution_(std::uniform_real_distribution<double>(0.,1.)),
|
theta_distribution_(std::uniform_real_distribution<double>(0.,1.)),
|
||||||
mass_kg_(mass_kg) {
|
mass_kg_(mass_kg) {
|
||||||
|
alpha_lower_limit = -300/std::log10(energyBinBorders_.front());
|
||||||
|
alpha_upper_limit = 300/std::log10(energyBinBorders_.back());
|
||||||
// necessary to include the underflow bin in the energy domain
|
// necessary to include the underflow bin in the energy domain
|
||||||
energyBinBorders_.insert(energyBinBorders_.begin(), 0);
|
energyBinBorders_.insert(energyBinBorders_.begin(), 0);
|
||||||
}
|
}
|
||||||
@@ -243,7 +245,8 @@ CartesianVector VelocityDistributionFromDensityField::drawVelocity(
|
|||||||
energyBinBorders_[index(4) + 1]);
|
energyBinBorders_[index(4) + 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
alpha = std::abs(alpha) > 100 ?(alpha/std::abs(alpha))*100 : alpha;
|
// alpha = std::abs(alpha) > 100 ?(alpha/std::abs(alpha))*100 : alpha;
|
||||||
|
alpha = std::min(std::max(alpha, alpha_lower_limit), alpha_upper_limit);
|
||||||
|
|
||||||
if(alpha == -1) {
|
if(alpha == -1) {
|
||||||
energy_eV = std::pow(energyBinBorders_[index(4) + 2]
|
energy_eV = std::pow(energyBinBorders_[index(4) + 2]
|
||||||
@@ -290,6 +293,15 @@ CartesianVector VelocityDistributionFromDensityField::drawVelocity(
|
|||||||
std::stringstream out;
|
std::stringstream out;
|
||||||
out << "pitchAngle: " << pitchAngle;
|
out << "pitchAngle: " << pitchAngle;
|
||||||
out << "\nenergy value: " << energy_eV;
|
out << "\nenergy value: " << energy_eV;
|
||||||
|
out << "\nalpha: " << alpha;
|
||||||
|
out << "\ncurrent index: " << index;
|
||||||
|
out << "\nNl: " << density_field_->particleNumber(index);
|
||||||
|
out << "\nNl: " << density_field_->particleNumber(index +
|
||||||
|
blitz::TinyVector<int, 5>(0,0,0,0,1));
|
||||||
|
out << "\nEl: " << energyBinBorders_[index(4) + 1];
|
||||||
|
out << "\nEr: " << energyBinBorders_[index(4) + 2];
|
||||||
|
out << "\nEl^(alpha+1): " << std::pow(energyBinBorders_[index(4) + 1], alpha + 1);
|
||||||
|
out << "\nEr^(alpha+1): " << std::pow(energyBinBorders_[index(4) + 2], alpha + 1);
|
||||||
// out << "\nenergy values: " << energyValues;
|
// out << "\nenergy values: " << energyValues;
|
||||||
// out << "\npitch angle values: " << pitchAngleValues;
|
// out << "\npitch angle values: " << pitchAngleValues;
|
||||||
out << "\nenergy bin borders: [ ";
|
out << "\nenergy bin borders: [ ";
|
||||||
|
|||||||
Reference in New Issue
Block a user