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.
 
virtual void set_p (double ucom, double bfield, double betaeff, double r, double fsc)
 Methods to set momentum/energy arrays and number density arrays.
 
virtual void set_p (double gmax)
 Same as above, but assuming a fixed maximum Lorentz factor.
 
virtual void set_ndens ()
 
virtual void set_temp_kev (double T)
 
virtual void set_norm (double n)
 
virtual void set_plfrac (double f)
 
virtual void set_plfrac (double Le, double r, double eldens)
 
virtual void set_pspec (double s1)
 
virtual void cooling_steadystate (double ucom, double n0, double bfield, double r, double betaeff)
 
virtual double max_p (double ucom, double bfield, double betaeff, double r, double fsc)
 
virtual double count_th_particles ()
 
virtual double av_th_p ()
 
virtual double av_th_gamma ()
 
virtual double count_pl_particles ()
 
virtual double av_pl_p ()
 
virtual double av_pl_gamma ()
 
virtual double K2 (double x)
 Evaluate Bessel function for MJ normalization.
 
virtual void test ()
 simple method to check quantities.
 
- Public Member Functions inherited from kariba::Particles
 Particles (size_t size)
 
virtual void set_mass (double m)
 
virtual void initialize_gdens ()
 
virtual void initialize_pdens ()
 Same as above but the other way around.
 
virtual void gdens_differentiate ()
 
virtual const std::vector< double > & get_p () const
 
virtual const std::vector< double > & get_pdens () const
 
virtual const std::vector< double > & get_gamma () const
 
virtual const std::vector< double > & get_gdens () const
 
virtual const std::vector< double > & get_gdens_diff () const
 
virtual double count_particles ()
 Simple numerical integrals /w trapeze method.
 
virtual double count_particles_energy ()
 
virtual double av_p ()
 
virtual double av_gamma ()
 
virtual double av_psq ()
 
virtual double av_gammasq ()
 
virtual 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 ( )
virtual

◆ av_pl_p()

double kariba::Mixed::av_pl_p ( )
virtual

◆ av_th_gamma()

double kariba::Mixed::av_th_gamma ( )
virtual

◆ av_th_p()

double kariba::Mixed::av_th_p ( )
virtual

◆ cooling_steadystate()

void kariba::Mixed::cooling_steadystate ( double  ucom,
double  n0,
double  bfield,
double  r,
double  betaeff 
)
virtual

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 ( )
virtual

◆ count_th_particles()

double kariba::Mixed::count_th_particles ( )
virtual

◆ K2()

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

Evaluate Bessel function for MJ normalization.

◆ max_p()

double kariba::Mixed::max_p ( double  ucom,
double  bfield,
double  betaeff,
double  r,
double  fsc 
)
virtual

Method to calculate maximum momentum of non thermal particles based on acceleration and cooling timescales

◆ set_ndens()

void kariba::Mixed::set_ndens ( )
virtual

◆ set_norm()

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

◆ set_p() [1/2]

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

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 
)
virtual

Methods to set momentum/energy arrays and number density arrays.

◆ set_plfrac() [1/2]

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

◆ set_plfrac() [2/2]

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

◆ set_pspec()

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

◆ set_temp_kev()

void kariba::Mixed::set_temp_kev ( double  T)
virtual

methods to set the temperature, pl fraction, and normalizations. Temperature must be in ergs, no factor kb

◆ test()

void kariba::Mixed::test ( )
virtual

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: