Cloudy
Spectral Synthesis Code for Astrophysics
Loading...
Searching...
No Matches
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)
 
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)
 
double hv (long int n, long int nprime, long int iz, double mass_nuc)
 

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

◆ add_mx()

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:

◆ bh_log()

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

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

Referenced by H_photo_cs_log10().

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 )

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

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

Referenced by bhg_log().

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 )

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

Referenced by bhG_mx(), and bhGm_mx().

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 )

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

Referenced by bhG_mx(), and bhGp_mx().

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 )

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

Referenced by bh_log().

Here is the call graph for this function:

◆ exp10i()

double exp10i ( long x)
inline

◆ F21_mx()

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(), STATIC, and TotalInsanity().

Referenced by hrii_log().

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,
mx & Fap2 )

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

Referenced by F21_mx().

Here is the call graph for this function:

◆ fsff_log10()

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

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

Referenced by hrii_log().

Here is the call graph for this function:

◆ H_Einstein_A()

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

◆ H_Einstein_A_log10()

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:

◆ 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

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:

◆ 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

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:

◆ hri_log10()

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:

◆ hrii_log()

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(), STATIC, and 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,
double mass_nuc )

add comment describing the parameters like in H_photo_cs

References ASSERT, DEBUG_ENTRY, and reduced_mass_rel().

Referenced by H_Einstein_A_log10().

Here is the call graph for this function:

◆ mult_mx()

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:

◆ mxify()

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:

◆ mxify_log10()

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:

◆ normalize_mx()

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

◆ prodxx_log10()

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:

◆ reduced_mass_rel()

STATIC double reduced_mass_rel ( double mass_nuc)
inline

References ASSERT, DEBUG_ENTRY, and STATIC.

Referenced by hri_log10(), and hv().

◆ sub_mx()

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:

◆ unmxify()

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_ONE

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

Referenced by H_Einstein_A_log10().

◆ maxe

const int maxe = 100
static

◆ maxm

const double maxm = 1.e100
static

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

◆ PHYSICAL_CONSTANT_TWO

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

Referenced by H_photo_cs_log10().