cloudy trunk
Loading...
Searching...
No Matches
hydro_bauman.cpp File Reference
#include "cddefines.h"
#include "physconst.h"
#include "thirdparty.h"
#include "hydro_bauman.h"
Include dependency graph for hydro_bauman.cpp:

Go to the source code of this file.

Data Structures

struct  t_mx
struct  t_mxq

Typedefs

typedef struct t_mx mx
typedef struct t_mxq mxq

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 H_Einstein_A_log10 (long int n, long int l, long int np, long int lp, long int iz)
double OscStr_f (long int n, long int l, long int np, long int lp, long int iz)
double OscStr_f_log10 (long int n, long int l, long int np, long int lp, long int iz)
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)
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 hri_log10 (long int n, long int l, long int np, long int lp, long int iz)
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)
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)

Typedef Documentation

◆ mx

typedef struct t_mx mx

Definition at line 26 of file hydro_bauman.cpp.

◆ mxq

typedef struct t_mxq mxq

Definition at line 34 of file hydro_bauman.cpp.

Function Documentation

◆ add_mx()

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

Definition at line 4351 of file hydro_bauman.cpp.

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

Referenced by sub_mx().

Here is the call graph for this function:

◆ bh()

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

Definition at line 740 of file hydro_bauman.cpp.

References ASSERT, bhintegrand(), DEBUG_ENTRY, and STATIC.

Referenced by H_photo_cs_lin().

Here is the call graph for this function:

◆ bh_log()

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

Definition at line 777 of file hydro_bauman.cpp.

References ASSERT, bhintegrand_log(), DEBUG_ENTRY, and STATIC.

Referenced by H_photo_cs_log10().

Here is the call graph for this function:

◆ bhG()

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

Definition at line 1006 of file hydro_bauman.cpp.

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

Referenced by bhg().

Here is the call graph for this function:

◆ bhg()

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

Definition at line 2053 of file hydro_bauman.cpp.

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

Referenced by bhintegrand().

Here is the call graph for this function:

◆ bhg_log()

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

Definition at line 2113 of file hydro_bauman.cpp.

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

Referenced by bhintegrand_log().

Here is the call graph for this function:

◆ bhG_mx()

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

Definition at line 1100 of file hydro_bauman.cpp.

References ASSERT, bhGm_mx(), bhGp_mx(), cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, lfactorial(), LOG10_E, mxify_log10(), PI, SQRTPIBY2, and STATIC.

Referenced by bhg_log().

Here is the call graph for this function:

◆ bhGm()

STATIC double bhGm ( long int q,
double K,
long int n,
long int l,
long int lp,
double * rcsvV,
double GK )

Definition at line 1696 of file hydro_bauman.cpp.

References ASSERT, bhGm(), DEBUG_ENTRY, t_mxq::q, and STATIC.

Referenced by bhG(), and bhGm().

Here is the call graph for this function:

◆ bhGm_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 )

Definition at line 1840 of file hydro_bauman.cpp.

References ASSERT, bhGm_mx(), DEBUG_ENTRY, mult_mx(), t_mxq::mx, mxify(), normalize_mx(), t_mxq::q, STATIC, and sub_mx().

Referenced by bhG_mx(), and bhGm_mx().

Here is the call graph for this function:

◆ bhGp()

STATIC double bhGp ( long int q,
double K,
long int n,
long int l,
long int lp,
double * rcsvV,
double GK )

Definition at line 1317 of file hydro_bauman.cpp.

References ASSERT, bhGp(), DEBUG_ENTRY, t_mxq::q, and STATIC.

Referenced by bhG(), and bhGp().

Here is the call graph for this function:

◆ bhGp_mx()

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 1468 of file hydro_bauman.cpp.

References ASSERT, bhGp_mx(), DEBUG_ENTRY, mult_mx(), t_mxq::mx, mxify(), normalize_mx(), t_mxq::q, STATIC, and sub_mx().

Referenced by bhG_mx(), and bhGp_mx().

Here is the call graph for this function:

◆ bhintegrand()

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

Definition at line 830 of file hydro_bauman.cpp.

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

Referenced by bh().

Here is the call graph for this function:

◆ bhintegrand_log()

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

Definition at line 909 of file hydro_bauman.cpp.

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

Referenced by bh_log().

Here is the call graph for this function:

◆ F21()

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

Definition at line 3847 of file hydro_bauman.cpp.

References ASSERT, CALLOC, DEBUG_ENTRY, F21i(), and STATIC.

Referenced by hrii().

Here is the call graph for this function:

◆ F21_mx()

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

Definition at line 3960 of file hydro_bauman.cpp.

References ASSERT, CALLOC, DEBUG_ENTRY, F21i_log(), and STATIC.

Referenced by hrii_log().

Here is the call graph for this function:

◆ F21i()

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

Definition at line 4072 of file hydro_bauman.cpp.

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

Referenced by F21(), and F21i().

Here is the call graph for this function:

◆ F21i_log()

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

Definition at line 4173 of file hydro_bauman.cpp.

References ASSERT, DEBUG_ENTRY, F21i_log(), t_mx::m, t_mxq::mx, powi(), t_mxq::q, STATIC, and t_mx::x.

Referenced by F21_mx(), and F21i_log().

Here is the call graph for this function:

◆ fsff()

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

Definition at line 3455 of file hydro_bauman.cpp.

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

Referenced by hrii().

Here is the call graph for this function:

◆ H_Einstein_A()

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 2324 of file hydro_bauman.cpp.

References DEBUG_ENTRY, H_Einstein_A_lin(), and H_Einstein_A_log10().

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

Here is the call graph for this function:

◆ H_Einstein_A_lin()

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

Definition at line 2358 of file hydro_bauman.cpp.

References cdEXIT, CONST_ONE, DEBUG_ENTRY, EXIT_FAILURE, HPLANCK, hri(), hv(), ioQQQ, pow3(), and STATIC.

Referenced by H_Einstein_A().

Here is the call graph for this function:

◆ H_Einstein_A_log10()

double H_Einstein_A_log10 ( 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 2409 of file hydro_bauman.cpp.

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

Referenced by H_Einstein_A().

Here is the call graph for this function:

◆ H_photo_cs()

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 564 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:

◆ H_photo_cs_lin()

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

Definition at line 594 of file hydro_bauman.cpp.

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

Referenced by H_photo_cs().

Here is the call graph for this function:

◆ H_photo_cs_log10()

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 665 of file hydro_bauman.cpp.

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

Referenced by H_photo_cs().

Here is the call graph for this function:

◆ hri()

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

Definition at line 2561 of file hydro_bauman.cpp.

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

Referenced by H_Einstein_A_lin(), and OscStr_f().

Here is the call graph for this function:

◆ hri_log10()

double hri_log10 ( long int n,
long int l,
long int np,
long int lp,
long int iz )
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

Definition at line 2651 of file hydro_bauman.cpp.

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

Referenced by H_Einstein_A_log10(), and OscStr_f_log10().

Here is the call graph for this function:

◆ hrii()

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

Definition at line 2708 of file hydro_bauman.cpp.

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

Referenced by hri().

Here is the call graph for this function:

◆ hrii_log()

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

Definition at line 3012 of file hydro_bauman.cpp.

References ASSERT, cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, F21_mx(), lfactorial(), log10_fsff(), t_mx::m, powi(), STATIC, and t_mx::x.

Referenced by hri_log10().

Here is the call graph for this function:

◆ hv()

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

◆ local_product()

double local_product ( double K,
long int lp )
inline

Definition at line 2229 of file hydro_bauman.cpp.

Referenced by bhg().

◆ log10_fsff()

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

Definition at line 3607 of file hydro_bauman.cpp.

References ASSERT, DEBUG_ENTRY, lfactorial(), and STATIC.

Referenced by hrii_log().

Here is the call graph for this function:

◆ log10_prodxx()

double log10_prodxx ( long int lp,
double Ksqrd )
inline

Definition at line 4428 of file hydro_bauman.cpp.

References ASSERT, and pow2().

Referenced by bhg_log().

Here is the call graph for this function:

◆ mult_mx()

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

Definition at line 4417 of file hydro_bauman.cpp.

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

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

Here is the call graph for this function:

◆ mxify()

mx mxify ( double a)
inline

Definition at line 4380 of file hydro_bauman.cpp.

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

Referenced by bhGm_mx(), and bhGp_mx().

Here is the call graph for this function:

◆ mxify_log10()

mx mxify_log10 ( double log10_a)
inline

Definition at line 4396 of file hydro_bauman.cpp.

References t_mx::m, and t_mx::x.

Referenced by bhg_log(), and bhG_mx().

◆ normalize_mx()

void normalize_mx ( mx & target)
inline

Definition at line 4336 of file hydro_bauman.cpp.

References t_mx::m, and t_mx::x.

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

◆ OscStr_f()

double OscStr_f ( long int n,
long int l,
long int np,
long int lp,
long int iz )
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 3786 of file hydro_bauman.cpp.

References EN1RYD, hri(), and hv().

Here is the call graph for this function:

◆ OscStr_f_log10()

double OscStr_f_log10 ( long int n,
long int l,
long int np,
long int lp,
long int iz )
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 3823 of file hydro_bauman.cpp.

References EN1RYD, hri_log10(), and hv().

Here is the call graph for this function:

◆ sub_mx()

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

Definition at line 4368 of file hydro_bauman.cpp.

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

Referenced by bhGm_mx(), and bhGp_mx().

Here is the call graph for this function:

◆ unmxify()

double unmxify ( const mx & a_mx)
inline

Definition at line 4391 of file hydro_bauman.cpp.

References t_mx::m, powi(), and t_mx::x.

Referenced by bhg_log().

Here is the call graph for this function:

Variable Documentation

◆ CONST_ONE

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

Definition at line 537 of file hydro_bauman.cpp.

Referenced by H_Einstein_A_lin(), and H_Einstein_A_log10().

◆ PHYSICAL_CONSTANT_TWO

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

Definition at line 560 of file hydro_bauman.cpp.

Referenced by H_photo_cs_lin(), and H_photo_cs_log10().