Kariba
Loading...
Searching...
No Matches
Particles.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
5namespace kariba {
6
8struct PlParams {
9 double s;
10 double n;
11};
12
14struct BknParams {
15 double s1;
16 double s2;
17 double brk;
18 double max;
19 double m;
20};
21
23struct ThParams {
24 double t;
25 double n;
26 double m;
27};
28
30struct KParams {
31 double t;
32 double k;
33};
34
37 double s;
38 double t;
39 double nth;
40 double npl;
41 double m;
42 double min;
43 double max;
44 double cutoff;
45};
46
49 double t;
50 double k;
51 double n;
52 double m;
53};
54
57 double s;
58 double n;
59 double m;
60 double max;
61};
62
65 double s1;
66 double s2;
67 double brk;
68 double max;
69 double m;
70 double n;
71};
72
76class Particles {
77 protected:
78 double mass_gr;
79 double mass_kev;
80
81 std::vector<double> p;
82 std::vector<double> ndens;
83 std::vector<double> gamma;
84 std::vector<double> gdens;
85 std::vector<double> gdens_diff;
87
88 public:
89 Particles(size_t size);
90
91 void set_mass(double m);
92 void initialize_gdens();
93 void initialize_pdens();
95
96 const std::vector<double>& get_p() const { return p; }
97
98 const std::vector<double>& get_pdens() const { return ndens; }
99
100 const std::vector<double>& get_gamma() const { return gamma; }
101
102 const std::vector<double>& get_gdens() const { return gdens; }
103
104 const std::vector<double>& get_gdens_diff() const { return gdens_diff; }
105
106 double count_particles();
107 double count_particles_energy();
108 double av_p();
109 double av_gamma();
110 double av_psq();
111 double av_gammasq();
112
113 void test_arrays();
114};
115
116} // namespace kariba
Definition Particles.hpp:76
std::vector< double > gamma
array of particle kinetic energies for each momentum
Definition Particles.hpp:83
void initialize_gdens()
Definition Particles.cpp:60
void set_mass(double m)
Definition Particles.cpp:92
const std::vector< double > & get_p() const
Definition Particles.hpp:96
const std::vector< double > & get_gamma() const
Definition Particles.hpp:100
std::vector< double > gdens
array of number density per unit volume, per unit gamma
Definition Particles.hpp:84
void test_arrays()
simple method to check arrays; only meant for debugging
Definition Particles.cpp:98
double av_psq()
Definition Particles.cpp:45
std::vector< double > p
array of particle momenta
Definition Particles.hpp:81
double av_gamma()
Definition Particles.cpp:41
std::vector< double > gdens_diff
Definition Particles.hpp:85
const std::vector< double > & get_gdens() const
Definition Particles.hpp:102
double mass_gr
particle mass in grams
Definition Particles.hpp:78
double mass_kev
same as above but in keV, using electrons as "reference"
Definition Particles.hpp:79
std::vector< double > ndens
array of number density per unit volume, per unit momentum
Definition Particles.hpp:82
void initialize_pdens()
Same as above but the other way around.
Definition Particles.cpp:68
double count_particles_energy()
Definition Particles.cpp:25
void gdens_differentiate()
Definition Particles.cpp:76
double count_particles()
Simple numerical integrals /w trapeze method.
Definition Particles.cpp:17
double av_p()
Definition Particles.cpp:33
const std::vector< double > & get_pdens() const
Definition Particles.hpp:98
const std::vector< double > & get_gdens_diff() const
Definition Particles.hpp:104
double av_gammasq()
Definition Particles.cpp:54
Definition BBody.hpp:5
Structure used for GSL integration.
Definition Particles.hpp:14
double m
Definition Particles.hpp:19
double s2
Definition Particles.hpp:16
double brk
Definition Particles.hpp:17
double max
Definition Particles.hpp:18
double s1
Definition Particles.hpp:15
Structure used for GSL integration.
Definition Particles.hpp:64
double s1
Definition Particles.hpp:65
double n
Definition Particles.hpp:70
double s2
Definition Particles.hpp:66
double brk
Definition Particles.hpp:67
double m
Definition Particles.hpp:69
double max
Definition Particles.hpp:68
Structure used for GSL integration.
Definition Particles.hpp:48
double m
Definition Particles.hpp:52
double k
Definition Particles.hpp:50
double n
Definition Particles.hpp:51
double t
Definition Particles.hpp:49
Structure used for GSL integration.
Definition Particles.hpp:36
double m
Definition Particles.hpp:41
double t
Definition Particles.hpp:38
double max
Definition Particles.hpp:43
double npl
Definition Particles.hpp:40
double min
Definition Particles.hpp:42
double nth
Definition Particles.hpp:39
double s
Definition Particles.hpp:37
double cutoff
Definition Particles.hpp:44
Structure used for GSL integration.
Definition Particles.hpp:56
double max
Definition Particles.hpp:60
double s
Definition Particles.hpp:57
double m
Definition Particles.hpp:59
double n
Definition Particles.hpp:58
Structure used for GSL integration.
Definition Particles.hpp:30
double k
Definition Particles.hpp:32
double t
Definition Particles.hpp:31
Structure used for GSL integration.
Definition Particles.hpp:8
double n
Definition Particles.hpp:10
double s
Definition Particles.hpp:9
Structure used for GSL integration.
Definition Particles.hpp:23
double m
Definition Particles.hpp:26
double n
Definition Particles.hpp:25
double t
Definition Particles.hpp:24