Cloudy
Spectral Synthesis Code for Astrophysics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
hydro_bauman.cpp File Reference
#include "cddefines.h"
#include "hydro_bauman.h"
#include "thirdparty.h"
#include "dense.h"
#include "hydro_tbl.h"
#include "vectorize.h"
#include "iso.h"
#include "service.h"
Include dependency graph for hydro_bauman.cpp:

Classes

struct  mx
 
struct  mxq
 

Functions

double exp10i (long x)
 
double H_photo_cs_log10 (double photon_energy, long int n, long int l, long int iz)
 
double H_Einstein_A_log10 (long int n, long int l, long int np, long int lp, long int iz, double mass_nuc)
 
double hv (long int n, long int nprime, long int iz, double mass_nuc)
 
STATIC double fsff_log10 (long int n, long int l, long int np)
 
STATIC mx F21_mx (long int a, long int b, long int c, double y, mx &Fa_plus, char ab)
 
STATIC mx F21i_log (long int a, long int b, long int c, double y, mx &Fap2)
 
double hri_log10 (long int n, long int l, long int np, long int lp, long int iz, double mass_nuc)
 
STATIC double hrii_log (long int n, long int l, long int np, long int lp)
 
STATIC double bh_log (double k, long int n, long int l, mxq *rcsvV_mxq)
 
STATIC double bhintegrand_log (double k, long int n, long int l, long int lp, mxq *rcsvV_mxq)
 
STATIC mx bhG_mx (double K, long int n, long int l, long int lp, mxq *rcsvV_mxq)
 
STATIC mx bhGp_mx (long int q, double K, long int n, long int l, long int lp, mxq *rcsvV_mxq, const mx &GK_mx)
 
STATIC mx bhGm_mx (long int q, double K, long int n, long int l, long int lp, mxq *rcsvV_mxq, const mx &GK_mx)
 
STATIC double bhg_log (double K, long int n, long int l, long int lp, mxq *rcsvV_mxq)
 
void normalize_mx (mx &target)
 
mx add_mx (const mx &a, const mx &b)
 
mx sub_mx (const mx &a, const mx &b)
 
mx mxify (double a)
 
double unmxify (const mx &a_mx)
 
mx mxify_log10 (double log10_a)
 
mx mult_mx (const mx &a, const mx &b)
 
double prodxx_log10 (long int lp, double Ksqrd)
 
double H_photo_cs (double rel_photon_energy, long int n, long int l, long int iz)
 
STATIC double reduced_mass_rel (double mass_nuc)
 
realnum H_Einstein_A (long int n, long int l, long int np, long int lp, long int iz)
 

Variables

static const int maxe = 100
 
static const double maxm = 1.e100
 
static const double CONST_ONE = 32.*pow3(PI)*pow2(BOHR_RADIUS_CM)*FINE_STRUCTURE/(3.*pow2(SPEEDLIGHT))
 
static const double PHYSICAL_CONSTANT_TWO = 4./3.*PI*FINE_STRUCTURE*pow2(BOHR_RADIUS_CM)
 

Function Documentation

mx add_mx ( const mx a,
const mx b 
)
inline

References exp10i(), mx::m, normalize_mx(), and mx::x.

Referenced by sub_mx().

Here is the call graph for this function:

STATIC double bh_log ( double  k,
long int  n,
long int  l,
mxq rcsvV_mxq 
)

References ASSERT, bhintegrand_log(), and DEBUG_ENTRY.

Referenced by H_photo_cs_log10().

Here is the call graph for this function:

STATIC double bhg_log ( double  K,
long int  n,
long int  l,
long int  lp,
mxq rcsvV_mxq 
)

References ASSERT, bhG_mx(), DEBUG_ENTRY, lfactorial(), mult_mx(), mxify_log10(), normalize_mx(), prodxx_log10(), and unmxify().

Referenced by bhintegrand_log().

Here is the call graph for this function:

STATIC mx bhG_mx ( double  K,
long int  n,
long int  l,
long int  lp,
mxq rcsvV_mxq 
)

References ASSERT, bhGm_mx(), bhGp_mx(), cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, lfactorial(), and mxify_log10().

Referenced by bhg_log().

Here is the call graph for this function:

STATIC mx bhGm_mx ( long int  q,
double  K,
long int  n,
long int  l,
long int  lp,
mxq rcsvV_mxq,
const mx GK_mx 
)

References ASSERT, DEBUG_ENTRY, mult_mx(), mxq::mx, mxify(), normalize_mx(), mxq::q, and sub_mx().

Referenced by bhG_mx().

Here is the call graph for this function:

STATIC mx bhGp_mx ( long int  q,
double  K,
long int  n,
long int  l,
long int  lp,
mxq rcsvV_mxq,
const mx GK_mx 
)

References ASSERT, DEBUG_ENTRY, mult_mx(), mxq::mx, mxify(), normalize_mx(), mxq::q, and sub_mx().

Referenced by bhG_mx().

Here is the call graph for this function:

STATIC double bhintegrand_log ( double  k,
long int  n,
long int  l,
long int  lp,
mxq rcsvV_mxq 
)

References ASSERT, bhg_log(), DEBUG_ENTRY, max(), and MAX2.

Referenced by bh_log().

Here is the call graph for this function:

double exp10i ( long  x)
inline

References BIGDOUBLE, LIKELY, max_pow10, min_pow10, neg_pow10, pos_pow10, pow2(), UNLIKELY, and mx::x.

Referenced by add_mx(), F21i_log(), hrii_log(), and unmxify().

Here is the call graph for this function:

STATIC mx F21_mx ( long int  a,
long int  b,
long int  c,
double  y,
mx Fa_plus,
char  ab 
)

References ASSERT, DEBUG_ENTRY, F21i_log(), and TotalInsanity().

Referenced by hrii_log().

Here is the call graph for this function:

STATIC mx F21i_log ( long int  a,
long int  b,
long int  c,
double  y,
mx Fap2 
)

References DEBUG_ENTRY, exp10i(), LIKELY, mx::m, maxe, maxm, UNLIKELY, and mx::x.

Referenced by F21_mx().

Here is the call graph for this function:

STATIC double fsff_log10 ( long int  n,
long int  l,
long int  np 
)

References ASSERT, DEBUG_ENTRY, and lfactorial().

Referenced by hrii_log().

Here is the call graph for this function:

realnum H_Einstein_A ( long int  n,
long int  l,
long int  np,
long int  lp,
long int  iz 
)
Calculates the Einstein A's for hydrogen                           
for the transition n,l --> n',l'                                   
units of sec^(-1)
                                                                   
In the following, we have n > n' 
Parameters
nprincipal quantum number, 1 for ground, upper level
langular momentum, 0 for s
npprincipal quantum number, 1 for ground, lower level
lpangular momentum, 0 for s
izNuclear charge, 1 for H+, 2 for He++, etc

References ASSERT, t_dense::AtomicWeight, t_iso_sp::CachedAs, DEBUG_ENTRY, dense, H_Einstein_A_log10(), Singleton< t_hydro_tbl >::Inst(), ipH_LIKE, iso_sp, LIMELM, and t_hydro_tbl::tp().

Referenced by FillExtraLymanLine(), he_1trans(), hydro_transprob(), hydro_transprob_collapsed_to_resolved(), and SanityCheckBegin().

Here is the call graph for this function:

double H_Einstein_A_log10 ( long int  n,
long int  l,
long int  np,
long int  lp,
long int  iz,
double  mass_nuc 
)
Calculates the Einstein A's for hydrogen                           
 for the transition n,l --> n',l'                                   
units of sec^(-1)                                                  

In the following, we have n > n'
Parameters
nprincipal quantum number, 1 for ground, upper level
langular momentum, 0 for s
npprincipal quantum number, 1 for ground, lower level
lpangular momentum, 0 for s
izNuclear charge, 1 for H+, 2 for He++, etc

References cdEXIT, CONST_ONE, DEBUG_ENTRY, EXIT_FAILURE, fprintf(), hri_log10(), hv(), ioQQQ, and pow3().

Referenced by H_Einstein_A().

Here is the call graph for this function:

double H_photo_cs ( double  photon_energy,
long int  n,
long int  l,
long int  iz 
)
returns hydrogenic photoionization cross section in cm^2             
Parameters
photon_energyphoton energy relative to threshold
nprincipal quantum number, 1 for ground
langular momentum, 0 for s
izcharge, 1 for H+, 2 for He++, etc

References t_hydro_tbl::cs(), DEBUG_ENTRY, H_photo_cs_log10(), and Singleton< t_hydro_tbl >::Inst().

Referenced by cross_section(), H_cross_section(), Opacity_iso_photo_cs(), and SanityCheckBegin().

Here is the call graph for this function:

double H_photo_cs_log10 ( double  photon_energy,
long int  n,
long int  l,
long int  iz 
)
************************* for LOG version of the file  ***************************************
 In this version, quantities that would normal cause a 64-bit floating point processor        
 to underflowed or overflow on intermediate values (ones internal to the calculation)         
 are evaluated using logs. This allows us to use an upper principal quantum number `n'        
 greater than 50 which is where the other version begins to fail. The trade-off is,           
 of course, lower accuracy( or is it precision ) and perhaps speed.                           
      We use LOG_10 for convenience.                                                          
**********************************************************************************************
 The functions which are evaluated using logarithms are denoted with a trailing underscore.   
      example:   hri_() calculates the same thing as hri_log10()                              
      except it uses logs internally.                                                         
**********************************************************************************************
 these are the hydrogenic routines written by Robert Bauman                                   
      For references, see h_bauman.c                                                          
**********************************************************************************************
  IN THE FOLLOWING WE HAVE  n > n'                                                            
Returns
returns hydrogenic photoionization cross section in cm^2
Parameters
photon_energyincident photon energy
nprincipal quantum number, 1 for ground
langular momentum, 0 for s
izcharge, 1 for H+, 2 for He++, etc

References ASSERT, bh_log(), cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, fprintf(), get_ptr(), ioQQQ, MAX2, and PHYSICAL_CONSTANT_TWO.

Referenced by H_photo_cs().

Here is the call graph for this function:

double hri_log10 ( long int  n,
long int  l,
long int  np,
long int  lp,
long int  iz,
double  mass_nuc 
)
inline
This routine, hri_log10(), calculates the hydrogen radial integral,  
for the transition n,l --> n',l'                                      
It is, of course, dimensionless.                                      

In the following, we have n > n'   
Parameters
nprincipal quantum number, 1 for ground, upper level
langular momentum, 0 for s
npprincipal quantum number, 1 for ground, lower level
lpangular momentum, 0 for s
izNuclear charge, 1 for H+, 2 for He++, etc
mass_nucnuclear mass, in g

References ASSERT, cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, hrii_log(), and reduced_mass_rel().

Referenced by H_Einstein_A_log10().

Here is the call graph for this function:

STATIC double hrii_log ( long int  n,
long int  l,
long int  np,
long int  lp 
)

References ASSERT, DEBUG_ENTRY, exp10(), exp10i(), F21_mx(), fsff_log10(), lfactorial(), mx::m, maxe, maxm, powi(), and mx::x.

Referenced by hri_log10().

Here is the call graph for this function:

double hv ( long int  n,
long int  nprime,
long int  iz,
double  mass_nuc 
)
inline

References ASSERT, DEBUG_ENTRY, and reduced_mass_rel().

Referenced by H_Einstein_A_log10().

Here is the call graph for this function:

mx mult_mx ( const mx a,
const mx b 
)
inline

References mx::m, normalize_mx(), and mx::x.

Referenced by bhg_log(), bhGm_mx(), and bhGp_mx().

Here is the call graph for this function:

mx mxify ( double  a)
inline

References mx::m, normalize_mx(), and mx::x.

Referenced by bhGm_mx(), and bhGp_mx().

Here is the call graph for this function:

mx mxify_log10 ( double  log10_a)
inline

References exp10(), mx::m, maxe, and mx::x.

Referenced by bhg_log(), and bhG_mx().

Here is the call graph for this function:

void normalize_mx ( mx target)
inline

References mx::m, maxe, maxm, and mx::x.

Referenced by add_mx(), bhg_log(), bhGm_mx(), bhGp_mx(), mult_mx(), mxify(), and sub_mx().

double prodxx_log10 ( long int  lp,
double  Ksqrd 
)
inline

References avx_ptr< T, lgBC >::ptr0(), reduce_a(), and vlog10().

Referenced by bhg_log().

Here is the call graph for this function:

STATIC double reduced_mass_rel ( double  mass_nuc)
inline

References ASSERT, and DEBUG_ENTRY.

Referenced by hri_log10(), and hv().

mx sub_mx ( const mx a,
const mx b 
)
inline

References add_mx(), mx::m, and normalize_mx().

Referenced by bhGm_mx(), and bhGp_mx().

Here is the call graph for this function:

double unmxify ( const mx a_mx)
inline

References exp10i(), mx::m, and mx::x.

Referenced by bhg_log().

Here is the call graph for this function:

Variable Documentation

const double CONST_ONE = 32.*pow3(PI)*pow2(BOHR_RADIUS_CM)*FINE_STRUCTURE/(3.*pow2(SPEEDLIGHT))
static

Referenced by H_Einstein_A_log10().

const int maxe = 100
static
const double maxm = 1.e100
static

Referenced by F21i_log(), hrii_log(), and normalize_mx().

const double PHYSICAL_CONSTANT_TWO = 4./3.*PI*FINE_STRUCTURE*pow2(BOHR_RADIUS_CM)
static

Referenced by H_photo_cs_log10().