Implemented pitch angle resolution.
Still includes (and uses) the non-pitch angle resolved fields as well; have to be either removed completely or refactored s.t. one of the two options is chosen. Pitch angle distribution has a hardcoded number of bins for now, and exists in 'energy_binning.h'
This commit is contained in:
@@ -105,6 +105,91 @@ class DynamicDensityField : public DensityField {
|
||||
bool timer_restarted_ = false;
|
||||
};
|
||||
|
||||
// includes a resolution of the pitch angle (i.e. cos(angle(\vec{v}, \vec{B})))
|
||||
class DynamicDensityFieldWithPitchAngle : public DensityField {
|
||||
public:
|
||||
|
||||
DynamicDensityFieldWithPitchAngle(const CylinderBinning& positionBinning,
|
||||
const EnergyBinning& energy_binning,
|
||||
const PitchAngleBinning& pitch_angle_binning,
|
||||
std::shared_ptr<Timer> timer);
|
||||
|
||||
double density(const Coordinate& position);
|
||||
double density(const Coordinate& position, double energy_eV);
|
||||
|
||||
bool changedPositionBin(const Coordinate& old_position,
|
||||
const Coordinate& new_position) const;
|
||||
|
||||
bool changedEnergyBin(double old_energy_eV, double new_energy_eV) const;
|
||||
|
||||
void logMovement(const Coordinate& position,
|
||||
double energy_eV,
|
||||
double pitch_angle,
|
||||
double time_in_bin_s);
|
||||
|
||||
void logDeletion(const Coordinate& position,
|
||||
double energy_eV,
|
||||
double pitch_angle);
|
||||
|
||||
double particleNumber();
|
||||
blitz::TinyVector<double, 5> draw(std::mt19937* engine);
|
||||
|
||||
bool changedPitchAngleBin(double old_pitch_angle, double new_pitch_angle) const;
|
||||
|
||||
blitz::Array<double, 3> densityArray();
|
||||
blitz::Array<double, 4> spectrumArray();
|
||||
blitz::Array<double, 5> timeInBinArray() const;
|
||||
blitz::Array<long int, 5> deletedParticlesArray() const;
|
||||
blitz::Array<double, 3> binVolumeArray() const;
|
||||
|
||||
const EnergyBinning* energyBinning() const;
|
||||
const CylinderBinning* positionBinning() const;
|
||||
const PitchAngleBinning* pitchAngleBinning() const;
|
||||
|
||||
double physicalTime() const;
|
||||
double timeResolution() const;
|
||||
|
||||
void resetDynamicDensityField();
|
||||
|
||||
friend class CpuSynchronizer;
|
||||
|
||||
void setDensityDistribution();
|
||||
|
||||
void restartTimer(double time, double delta_t);
|
||||
void restartTimeInBin(blitz::Array<double, 5> time_in_bin);
|
||||
void restartDeletedParticlesArray(blitz::Array<long int, 5> deleted_particles);
|
||||
|
||||
private:
|
||||
|
||||
// BinCoordinate densityBin(const CylinderCoordinate& position) const;
|
||||
void recalculateDensityArray();
|
||||
void initPositionDistributions();
|
||||
// use ordering r, phi, z, pitch_angle, E
|
||||
|
||||
blitz::Array<double, 5> time_in_bin_s_;
|
||||
blitz::Array<long int, 5> deleted_particles_;
|
||||
|
||||
blitz::Array<double, 5> sync_time_in_bin_s_;
|
||||
blitz::Array<long int, 5> sync_deleted_particles_;
|
||||
|
||||
blitz::Array<double, 4> density_per_m3_;
|
||||
blitz::Array<double, 3> bin_volume_m3_;
|
||||
|
||||
const CylinderBinning position_binning_;
|
||||
const EnergyBinning energy_binning_;
|
||||
|
||||
// random distributions for drawing from
|
||||
std::uniform_real_distribution<double> r_dist_;
|
||||
std::uniform_real_distribution<double> phi_dist_;
|
||||
std::uniform_real_distribution<double> z_dist_;
|
||||
std::uniform_real_distribution<double> density_dist_;
|
||||
|
||||
const PitchAngleBinning pitch_angle_binning_;
|
||||
|
||||
std::shared_ptr<Timer> timer_;
|
||||
bool timer_restarted_ = false;
|
||||
};
|
||||
|
||||
class ConstantDensityField : public DensityField {
|
||||
public:
|
||||
ConstantDensityField(std::shared_ptr<ScalarField> density);
|
||||
|
||||
Reference in New Issue
Block a user