Reworked minor changes in structure and integration over energetic population container.
84 lines
2.0 KiB
C++
84 lines
2.0 KiB
C++
//
|
|
// population_base.h
|
|
// mc_electron
|
|
//
|
|
// Created by Christian Reiling on 06.05.19.
|
|
// Copyright © 2019 Christian Reiling. All rights reserved.
|
|
//
|
|
|
|
#ifndef population_base_h
|
|
#define population_base_h
|
|
|
|
#include "timer.hpp"
|
|
#include "random_operations.h"
|
|
|
|
#include "error_types.h"
|
|
#include "read_system.h"
|
|
#include "kinematics.h"
|
|
#include "process_base.h"
|
|
|
|
typedef blitz::TinyVector<double,3> vec3;
|
|
typedef blitz::TinyVector<int,3> bin_count3;
|
|
typedef blitz::TinyVector<int,4> bin_count4;
|
|
|
|
typedef struct pop_bin_meta_info {
|
|
int z_bin;
|
|
int r_bin;
|
|
int phi_bin;
|
|
int E_bin;
|
|
double z_min_m;
|
|
double z_max_m;
|
|
double r_min_m;
|
|
double r_max_m;
|
|
double phi_min;
|
|
double phi_max;
|
|
double E_min_eV;
|
|
double E_max_eV;
|
|
} pop_bin_meta;
|
|
|
|
typedef struct pop_bin_content {
|
|
int z_bin;
|
|
int r_bin;
|
|
int phi_bin;
|
|
int E_bin;
|
|
double cumulated_time_s;
|
|
int offset;
|
|
} pop_log_bins;
|
|
|
|
typedef std::vector<pop_bin_meta_info> meta_vec;
|
|
typedef std::vector<pop_bin_content> bin_content_vec;
|
|
|
|
|
|
class Population_Base : public Process_Base {
|
|
|
|
public:
|
|
Population_Base(species this_species) : Process_Base(this_species) {};
|
|
|
|
virtual double get_density_m3 (const vec3 &loc_m) = 0;
|
|
virtual void increase_density (const Particle &upPart, const vec3 &oldLoc_m) = 0;
|
|
virtual void decrease_denisty (const vec3 &oldLoc_m, const double &energy_eV) = 0;
|
|
|
|
virtual vec3 get_average_v_ms (const vec3 &loc_m) = 0;
|
|
virtual vec3 roll_v_ms (const vec3 &loc_m) = 0;
|
|
|
|
// For integrating over energy
|
|
virtual int get_number_E_bins() = 0;
|
|
virtual double get_E_eV (const int &E_bin) = 0;
|
|
virtual double get_density_m3(const vec3 &loc_m, const int &E_bin) = 0;
|
|
|
|
// For logging
|
|
virtual meta_vec get_bins_meta_info() = 0;
|
|
virtual bin_content_vec get_bins_content() = 0;
|
|
virtual bin_count4 get_bin_count4() = 0;
|
|
virtual void set_bins(bin_count4 bin_counts, bin_content_vec bin_contents) = 0;
|
|
|
|
// For synchronizing with other cpus
|
|
virtual int get_array_length() = 0;
|
|
virtual double *get_cumulated_time_s_array() = 0;
|
|
virtual double *get_offset_array() = 0;
|
|
|
|
};
|
|
|
|
|
|
#endif /* population_base_h */
|