Kariba
Loading...
Searching...
No Matches
kariba::Mixed Class Reference

#include <Mixed.hpp>

Inheritance diagram for kariba::Mixed:
kariba::Particles

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.
 
- Public Member Functions inherited from kariba::Particles
 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
 
- Protected Attributes inherited from kariba::Particles
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)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Mixed()

kariba::Mixed::Mixed ( size_t  size)

Class constructors to initialize object.

Member Function Documentation

◆ av_pl_gamma()

double kariba::Mixed::av_pl_gamma ( )

◆ av_pl_p()

double kariba::Mixed::av_pl_p ( )

◆ av_th_gamma()

double kariba::Mixed::av_th_gamma ( )

◆ av_th_p()

double kariba::Mixed::av_th_p ( )

◆ cooling_steadystate()

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

◆ count_pl_particles()

double kariba::Mixed::count_pl_particles ( )

◆ count_th_particles()

double kariba::Mixed::count_th_particles ( )

◆ K2()

double kariba::Mixed::K2 ( double  x)

Evaluate Bessel function for MJ normalization.

◆ max_p()

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

◆ set_ndens()

void kariba::Mixed::set_ndens ( )

◆ set_norm()

void kariba::Mixed::set_norm ( double  n)

◆ set_p() [1/2]

void kariba::Mixed::set_p ( double  gmax)

Same as above, but assuming a fixed maximum Lorentz factor.

◆ set_p() [2/2]

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.

◆ set_plfrac() [1/2]

void kariba::Mixed::set_plfrac ( double  f)

◆ set_plfrac() [2/2]

void kariba::Mixed::set_plfrac ( double  Le,
double  r,
double  eldens 
)

◆ set_pspec()

void kariba::Mixed::set_pspec ( double  s1)

◆ set_temp_kev()

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

◆ test()

void kariba::Mixed::test ( )

simple method to check quantities.

Friends And Related Symbol Documentation

◆ av_pl_p_int

double av_pl_p_int ( double  x,
void *  p 
)
friend

◆ av_th_p_int

double av_th_p_int ( double  x,
void *  p 
)
friend

◆ pl_num_dens_int

double pl_num_dens_int ( double  x,
void *  p 
)
friend

Methods to calculate number density and average energy in non-thermal part.

◆ th_num_dens_int

double th_num_dens_int ( double  x,
void *  p 
)
friend

Methods to calculate number density and average energy in thermal part.

Member Data Documentation

◆ plfrac

double kariba::Mixed::plfrac
protected

◆ plnorm

double kariba::Mixed::plnorm
protected

◆ pmax_pl

double kariba::Mixed::pmax_pl
protected

◆ pmax_th

double kariba::Mixed::pmax_th
protected

◆ pmin_pl

double kariba::Mixed::pmin_pl
protected

◆ pmin_th

double kariba::Mixed::pmin_th
protected

◆ pspec

double kariba::Mixed::pspec
protected

◆ Temp

double kariba::Mixed::Temp
protected

◆ theta

double kariba::Mixed::theta
protected

◆ thnorm

double kariba::Mixed::thnorm
protected

The documentation for this class was generated from the following files: