cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Data Structures | Enumerations | Functions | Variables
hydro_bauman.cpp File Reference
#include "cddefines.h"
#include "hydro_bauman.h"
#include "thirdparty.h"
#include "dense.h"
Include dependency graph for hydro_bauman.cpp:

Go to the source code of this file.

Data Structures

struct  mx
 
struct  mxq
 

Enumerations

enum  { DEBUG_AUL = false }
 

Functions

STATIC double H_photo_cs_lin (double rel_photon_energy, long int n, long int l, long int iz)
 
double H_photo_cs_log10 (double photon_energy, long int n, long int l, long int iz)
 
STATIC double H_Einstein_A_lin (long int n, long int l, long int np, long int lp, long int iz, double mass_nuc)
 
double H_Einstein_A_log10 (long int n, long int l, long int np, long int lp, long int iz, double mass_nuc)
 
double OscStr_f (long int n, long int l, long int np, long int lp, long int iz, double mass_nuc)
 
double OscStr_f_log10 (long int n, long int l, long int np, long int lp, long int iz, double mass_nuc)
 
STATIC double F21 (long int a, long int b, long int c, double y, char A)
 
STATIC double F21i (long int a, long int b, long int c, double y, double *yV)
 
double hv (long int n, long int nprime, long int iz, double mass_nuc)
 
STATIC double fsff (long int n, long int l, long int np)
 
STATIC double log10_fsff (long int n, long int l, long int np)
 
STATIC mx F21_mx (long int a, long int b, long int c, double y, char A)
 
STATIC mx F21i_log (long int a, long int b, long int c, double y, mxq *yV)
 
double hri (long int n, long int l, long int np, long int lp, long int iz, double mass_nuc)
 
double hri_log10 (long int n, long int l, long int np, long int lp, long int iz, double mass_nuc)
 
STATIC double hrii (long int n, long int l, long int np, long int lp)
 
STATIC double hrii_log (long int n, long int l, long int np, long int lp)
 
STATIC double bh (double k, long int n, long int l, double *rcsvV)
 
STATIC double bh_log (double k, long int n, long int l, mxq *rcsvV_mxq)
 
STATIC double bhintegrand (double k, long int n, long int l, long int lp, double *rcsvV)
 
STATIC double bhintegrand_log (double k, long int n, long int l, long int lp, mxq *rcsvV_mxq)
 
STATIC double bhG (double K, long int n, long int l, long int lp, double *rcsvV)
 
STATIC mx bhG_mx (double K, long int n, long int l, long int lp, mxq *rcsvV_mxq)
 
STATIC double bhGp (long int q, double K, long int n, long int l, long int lp, double *rcsvV, double GK)
 
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 double bhGm (long int q, double K, long int n, long int l, long int lp, double *rcsvV, double GK)
 
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 (double K, long int n, long int l, long int lp, double *rcsvV)
 
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 local_product (double K, long int lp)
 
double log10_prodxx (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)
 
double H_Einstein_A (long int n, long int l, long int np, long int lp, long int iz)
 

Variables

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)
 

Enumeration Type Documentation

anonymous enum
Enumerator
DEBUG_AUL 

Definition at line 2396 of file hydro_bauman.cpp.

Function Documentation

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

Definition at line 4463 of file hydro_bauman.cpp.

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

Referenced by sub_mx().

Here is the call graph for this function:

STATIC double bh ( double  k,
long int  n,
long int  l,
double *  rcsvV 
)

Definition at line 745 of file hydro_bauman.cpp.

References ASSERT, bhintegrand(), and DEBUG_ENTRY.

Referenced by H_photo_cs_lin().

Here is the call graph for this function:

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

Definition at line 782 of file hydro_bauman.cpp.

References ASSERT, bhintegrand_log(), and DEBUG_ENTRY.

Referenced by H_photo_cs_log10().

Here is the call graph for this function:

STATIC double bhG ( double  K,
long int  n,
long int  l,
long int  lp,
double *  rcsvV 
)

Definition at line 1011 of file hydro_bauman.cpp.

References ASSERT, bhGm(), bhGp(), cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, factorial(), and powi().

Referenced by bhg().

Here is the call graph for this function:

STATIC double bhg ( double  K,
long int  n,
long int  l,
long int  lp,
double *  rcsvV 
)

Definition at line 2058 of file hydro_bauman.cpp.

References ASSERT, bhG(), DEBUG_ENTRY, factorial(), local_product(), and powi().

Referenced by bhintegrand().

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 
)

Definition at line 2118 of file hydro_bauman.cpp.

References ASSERT, bhG_mx(), DEBUG_ENTRY, lfactorial(), log10_prodxx(), mult_mx(), mxify_log10(), normalize_mx(), 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 
)

Definition at line 1105 of file hydro_bauman.cpp.

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 double bhGm ( long int  q,
double  K,
long int  n,
long int  l,
long int  lp,
double *  rcsvV,
double  GK 
)

Definition at line 1701 of file hydro_bauman.cpp.

References ASSERT, and DEBUG_ENTRY.

Referenced by bhG().

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 
)

Definition at line 1845 of file hydro_bauman.cpp.

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 bhGp ( long int  q,
double  K,
long int  n,
long int  l,
long int  lp,
double *  rcsvV,
double  GK 
)

Definition at line 1322 of file hydro_bauman.cpp.

References ASSERT, and DEBUG_ENTRY.

Referenced by bhG().

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 
)

Definition at line 1473 of file hydro_bauman.cpp.

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 ( double  k,
long int  n,
long int  l,
long int  lp,
double *  rcsvV 
)

Definition at line 835 of file hydro_bauman.cpp.

References ASSERT, bhg(), DEBUG_ENTRY, and max().

Referenced by bh().

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 
)

Definition at line 914 of file hydro_bauman.cpp.

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

Referenced by bh_log().

Here is the call graph for this function:

STATIC double F21 ( long int  a,
long int  b,
long int  c,
double  y,
char  A 
)

Definition at line 3974 of file hydro_bauman.cpp.

References ASSERT, DEBUG_ENTRY, F21i(), and get_ptr().

Referenced by hrii().

Here is the call graph for this function:

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

Definition at line 4079 of file hydro_bauman.cpp.

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

Referenced by hrii_log().

Here is the call graph for this function:

STATIC double F21i ( long int  a,
long int  b,
long int  c,
double  y,
double *  yV 
)

Definition at line 4184 of file hydro_bauman.cpp.

References ASSERT, and DEBUG_ENTRY.

Referenced by F21().

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

Definition at line 4285 of file hydro_bauman.cpp.

References ASSERT, DEBUG_ENTRY, mx::m, mxq::mx, powi(), mxq::q, and mx::x.

Referenced by F21_mx().

Here is the call graph for this function:

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

Definition at line 3566 of file hydro_bauman.cpp.

References ASSERT, cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, factorial(), is_odd(), and powi().

Referenced by hrii().

Here is the call graph for this function:

double 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

Definition at line 2356 of file hydro_bauman.cpp.

References ASSERT, t_dense::AtomicWeight, DEBUG_ENTRY, dense, H_Einstein_A_lin(), H_Einstein_A_log10(), and LIMELM.

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

Here is the call graph for this function:

STATIC double H_Einstein_A_lin ( long int  n,
long int  l,
long int  np,
long int  lp,
long int  iz,
double  mass_nuc 
)

Definition at line 2405 of file hydro_bauman.cpp.

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

Referenced by H_Einstein_A().

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

Definition at line 2476 of file hydro_bauman.cpp.

References cdEXIT, CONST_ONE, DEBUG_AUL, 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

Definition at line 572 of file hydro_bauman.cpp.

References DEBUG_ENTRY, H_photo_cs_lin(), and H_photo_cs_log10().

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

Here is the call graph for this function:

STATIC double H_photo_cs_lin ( double  rel_photon_energy,
long int  n,
long int  l,
long int  iz 
)

Definition at line 602 of file hydro_bauman.cpp.

References ASSERT, bh(), cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, fprintf(), ioQQQ, NPRE_FACTORIAL, and PHYSICAL_CONSTANT_TWO.

Referenced by H_photo_cs().

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

Definition at line 673 of file hydro_bauman.cpp.

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 ( long int  n,
long int  l,
long int  np,
long int  lp,
long int  iz,
double  mass_nuc 
)
inline
 This routine, hri(), 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

Definition at line 2648 of file hydro_bauman.cpp.

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

Referenced by H_Einstein_A_lin(), and OscStr_f().

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

Definition at line 2746 of file hydro_bauman.cpp.

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

Referenced by H_Einstein_A_log10(), and OscStr_f_log10().

Here is the call graph for this function:

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

Definition at line 2807 of file hydro_bauman.cpp.

References ASSERT, cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, F21(), factorial(), fsff(), pow2(), and powi().

Referenced by hri().

Here is the call graph for this function:

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

Definition at line 3117 of file hydro_bauman.cpp.

References ASSERT, cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, exp10(), F21_mx(), lfactorial(), log10_fsff(), mx::m, 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

Definition at line 2583 of file hydro_bauman.cpp.

References ASSERT, cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, fprintf(), ioQQQ, and reduced_mass_rel().

Referenced by H_Einstein_A_lin(), H_Einstein_A_log10(), OscStr_f(), and OscStr_f_log10().

Here is the call graph for this function:

double local_product ( double  K,
long int  lp 
)
inline

Definition at line 2239 of file hydro_bauman.cpp.

Referenced by bhg().

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

Definition at line 3718 of file hydro_bauman.cpp.

References ASSERT, DEBUG_ENTRY, and lfactorial().

Referenced by hrii_log().

Here is the call graph for this function:

double log10_prodxx ( long int  lp,
double  Ksqrd 
)
inline

Definition at line 4540 of file hydro_bauman.cpp.

References ASSERT, and pow2().

Referenced by bhg_log().

Here is the call graph for this function:

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

Definition at line 4529 of file hydro_bauman.cpp.

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

Definition at line 4492 of file hydro_bauman.cpp.

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

Definition at line 4508 of file hydro_bauman.cpp.

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

Referenced by bhg_log(), and bhG_mx().

Here is the call graph for this function:

void normalize_mx ( mx target)
inline

Definition at line 4448 of file hydro_bauman.cpp.

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

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

double OscStr_f ( long int  n,
long int  l,
long int  np,
long int  lp,
long int  iz,
double  mass_nuc 
)
inline
 Calc the Oscillator Strength f(*) given by                         

                   E(n,l;n',l')     max(l,l')  |              | 2   
 f(n,l;n',l') = -  ------------   ------------ | R(n,l;n',l') |     
                    3 R_oo         ( 2l + 1 )  |              |     

     f(n,l;n',l') is dimensionless.                                 

 See for example Gordan Drake's                                     
    Atomic, Molecular, & Optical Physics Handbook pg.638            

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

Definition at line 3897 of file hydro_bauman.cpp.

References DEBUG_ENTRY, hri(), hv(), and reduced_mass_rel().

Here is the call graph for this function:

double OscStr_f_log10 ( long int  n,
long int  l,
long int  np,
long int  lp,
long int  iz,
double  mass_nuc 
)
inline
 Calc the Oscillator Strength f(*) given by                         

                   E(n,l;n',l')     max(l,l')  |              | 2   
 f(n,l;n',l') = -  ------------   ------------ | R(n,l;n',l') |     
                    3 R_oo         ( 2l + 1 )  |              |     

     f(n,l;n',l') is dimensionless.                                 

 See for example Gordan Drake's                                     
    Atomic, Molecular, & Optical Physics Handbook pg.638            

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

Definition at line 3942 of file hydro_bauman.cpp.

References DEBUG_ENTRY, hri_log10(), hv(), and reduced_mass_rel().

Here is the call graph for this function:

STATIC double reduced_mass_rel ( double  mass_nuc)
inline

Definition at line 2277 of file hydro_bauman.cpp.

References ASSERT, and DEBUG_ENTRY.

Referenced by hri(), hri_log10(), hv(), OscStr_f(), and OscStr_f_log10().

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

Definition at line 4480 of file hydro_bauman.cpp.

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

Definition at line 4503 of file hydro_bauman.cpp.

References mx::m, powi(), 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

Definition at line 545 of file hydro_bauman.cpp.

Referenced by H_Einstein_A_lin(), and H_Einstein_A_log10().

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

Definition at line 568 of file hydro_bauman.cpp.

Referenced by H_photo_cs_lin(), and H_photo_cs_log10().