Kariba
|
#include <Mixed.hpp>
Public Member Functions | |
Mixed (size_t size) | |
Class constructors to initialize object. | |
void | set_p (double ucom, double bfield, double betaeff, double r, double fsc) |
Methods to set momentum/energy arrays and number density arrays. | |
void | set_p (double gmax) |
Same as above, but assuming a fixed maximum Lorentz factor. | |
void | set_ndens () |
void | set_temp_kev (double T) |
void | set_norm (double n) |
void | set_plfrac (double f) |
void | set_plfrac (double Le, double r, double eldens) |
void | set_pspec (double s1) |
void | cooling_steadystate (double ucom, double n0, double bfield, double r, double betaeff) |
double | max_p (double ucom, double bfield, double betaeff, double r, double fsc) |
double | count_th_particles () |
double | av_th_p () |
double | av_th_gamma () |
double | count_pl_particles () |
double | av_pl_p () |
double | av_pl_gamma () |
double | K2 (double x) |
Evaluate Bessel function for MJ normalization. | |
void | test () |
simple method to check quantities. | |
![]() | |
Particles (size_t size) | |
void | set_mass (double m) |
void | initialize_gdens () |
void | initialize_pdens () |
Same as above but the other way around. | |
void | gdens_differentiate () |
const std::vector< double > & | get_p () const |
const std::vector< double > & | get_pdens () const |
const std::vector< double > & | get_gamma () const |
const std::vector< double > & | get_gdens () const |
const std::vector< double > & | get_gdens_diff () const |
double | count_particles () |
Simple numerical integrals /w trapeze method. | |
double | count_particles_energy () |
double | av_p () |
double | av_gamma () |
double | av_psq () |
double | av_gammasq () |
void | test_arrays () |
simple method to check arrays; only meant for debugging | |
Protected Attributes | |
double | thnorm |
double | theta |
double | Temp |
double | pspec |
double | plnorm |
double | pmin_th |
double | pmax_th |
double | pmin_pl |
double | pmax_pl |
double | plfrac |
![]() | |
double | mass_gr |
particle mass in grams | |
double | mass_kev |
same as above but in keV, using electrons as "reference" | |
std::vector< double > | p |
array of particle momenta | |
std::vector< double > | ndens |
array of number density per unit volume, per unit momentum | |
std::vector< double > | gamma |
array of particle kinetic energies for each momentum | |
std::vector< double > | gdens |
array of number density per unit volume, per unit gamma | |
std::vector< double > | gdens_diff |
Friends | |
double | th_num_dens_int (double x, void *p) |
Methods to calculate number density and average energy in thermal part. | |
double | av_th_p_int (double x, void *p) |
double | pl_num_dens_int (double x, void *p) |
Methods to calculate number density and average energy in non-thermal part. | |
double | av_pl_p_int (double x, void *p) |
Class for mixed particles, inherited from the generic Particles class in Particles.hh the minimum momentum of the PL is always be assumed to be the averge momentum of the thermal note: ndens is number density per unit momentum
The reasons the integrands are friends is kind of magic. Basically, we need pointers to the private members Temp/thnorm/theta/whatever to set the parameters of the integrand functions in the GSL libraries. In C++ this is not possible for non-static private member functions (because otherwise we could access private members from the outside by using a pointer). To quote the compiler error, C++ forbids taking the address of an unqualified or parenthesized non-static member function to form a pointer to member function. And we need a pointer member function void *p to set up the integrands for GSL libraries. By using a friend function we can instead set up a set of parameters whose value is that of a pointer which points at the values stored in the private members; by doing this, we can not change the private members' values (correctly so) but we can still access their numerical value and use it elsewhere.
kariba::Mixed::Mixed | ( | size_t | size | ) |
Class constructors to initialize object.
double kariba::Mixed::av_pl_gamma | ( | ) |
double kariba::Mixed::av_pl_p | ( | ) |
double kariba::Mixed::av_th_gamma | ( | ) |
double kariba::Mixed::av_th_p | ( | ) |
void kariba::Mixed::cooling_steadystate | ( | double | ucom, |
double | n0, | ||
double | bfield, | ||
double | r, | ||
double | betaeff | ||
) |
Method to solve steady state continuity equation. NOTE: KN cross section not included in IC cooling
double kariba::Mixed::count_pl_particles | ( | ) |
double kariba::Mixed::count_th_particles | ( | ) |
double kariba::Mixed::K2 | ( | double | x | ) |
Evaluate Bessel function for MJ normalization.
double kariba::Mixed::max_p | ( | double | ucom, |
double | bfield, | ||
double | betaeff, | ||
double | r, | ||
double | fsc | ||
) |
Method to calculate maximum momentum of non thermal particles based on acceleration and cooling timescales
void kariba::Mixed::set_ndens | ( | ) |
void kariba::Mixed::set_norm | ( | double | n | ) |
void kariba::Mixed::set_p | ( | double | gmax | ) |
Same as above, but assuming a fixed maximum Lorentz factor.
void kariba::Mixed::set_p | ( | double | ucom, |
double | bfield, | ||
double | betaeff, | ||
double | r, | ||
double | fsc | ||
) |
Methods to set momentum/energy arrays and number density arrays.
void kariba::Mixed::set_plfrac | ( | double | f | ) |
void kariba::Mixed::set_plfrac | ( | double | Le, |
double | r, | ||
double | eldens | ||
) |
void kariba::Mixed::set_pspec | ( | double | s1 | ) |
void kariba::Mixed::set_temp_kev | ( | double | T | ) |
methods to set the temperature, pl fraction, and normalizations. Temperature must be in ergs, no factor kb
void kariba::Mixed::test | ( | ) |
simple method to check quantities.
|
friend |
|
friend |
|
friend |
Methods to calculate number density and average energy in non-thermal part.
|
friend |
Methods to calculate number density and average energy in thermal part.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |