cloudy  trunk
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Macros | Functions | Variables
lines_service.cpp File Reference
#include "cddefines.h"
#include "physconst.h"
#include "phycon.h"
#include "lines.h"
#include "radius.h"
#include "geometry.h"
#include "elementnames.h"
#include "rt.h"
#include "dense.h"
#include "rfield.h"
#include "opacity.h"
#include "ipoint.h"
#include "iso.h"
#include "taulines.h"
#include "hydrogenic.h"
#include "lines_service.h"
Include dependency graph for lines_service.cpp:

Go to the source code of this file.

Macros

#define MAXFORLIN   1000
 

Functions

void outline (transition *t)
 
double emit_frac (transition *t)
 
void DumpLine (transition *t)
 
double OccupationNumberLine (transition *t)
 
double TexcLine (transition *t)
 
double eina (double gf, double enercm, double gup)
 
double GetGF (double trans_prob, double enercm, double gup)
 
double abscf (double gf, double enercm, double gl)
 
void chIonLbl (char *chIonLbl_v, transition *t)
 
char * chLineLbl (transition *t)
 
double RefIndex (double EnergyWN)
 
void PutCS (double cs, transition *t)
 
realnum WavlenErrorGet (realnum wavelength)
 
void linadd (double xInten, realnum wavelength, const char *chLab, char chInfo, const char *chComment)
 
double emergent_line (double emissivity_in, double emissivity_out, long int ipCont)
 
void lindst (double xInten, realnum wavelength, const char *chLab, long int ipnt, char chInfo, bool lgOutToo, const char *chComment)
 
void PntForLine (double wavelength, const char *chLabel, long int *ipnt)
 
void PutLine (transition *t, const char *chComment, const char *chLabelTemp)
 
void PutLine (transition *t, const char *chComment)
 
void PutExtra (double Extra)
 
void TransitionJunk (transition *t)
 
void EmLineJunk (emission *t)
 
void CollisionJunk (collision *t)
 
void StateJunk (quantumState *t)
 
void TransitionZero (transition *t)
 
void EmLineZero (emission *t)
 
void CollisionZero (collision *t)
 
void StateZero (quantumState *t)
 
void LineConvRate2CS (transition *t, realnum rate)
 
double ConvRate2CS (realnum gHi, realnum rate)
 
bool lgTauGood (transition *t)
 
STATIC void gbar0 (double ex, realnum *g)
 
STATIC void gbar1 (double ex, realnum *g)
 
void MakeCS (transition *t)
 
double totlin (int chInfo)
 
void FndLineHt (long int *level, long int *ipStrong, double *Strong)
 
quantumStateAddState2Stack (void)
 
emissionAddLine2Stack (bool lgRadiativeTrans)
 

Variables

static double EnergyRyd
 
static realnum ExtraInten
 

Macro Definition Documentation

#define MAXFORLIN   1000

Referenced by PntForLine().

Function Documentation

double abscf ( double  gf,
double  enercm,
double  gl 
)

abscf convert gf into absorption coefficient

Parameters
gf
enercm
gl

Definition at line 224 of file lines_service.cpp.

References ASSERT, and DEBUG_ENTRY.

Referenced by ContCreatePointers(), FeIIPoint(), FillExtraLymanLine(), H2_Create(), iso_create(), and iso_satellite_update().

emission* AddLine2Stack ( bool  lgRadiativeTrans)
Todo:
2 bring these two together.

AddLine2Stack add generic emission line to GenericLines and return pointer to that state.

Definition at line 1445 of file lines_service.cpp.

References ASSERT, currentLine, DEBUG_ENTRY, DummyEmis, EmLineJunk(), EmLineZero(), GenericLines, lastLine, lgLinesAdded, linesAdded, and t_emission::next.

Referenced by atmdat_Chianti_readin(), atmdat_lamda_readin(), atmdat_readin(), FeIICreate(), H2_ReadTransprob(), HyperfineCreate(), iso_allocate(), and iso_create().

Here is the call graph for this function:

quantumState* AddState2Stack ( void  )

AddState2Stack add generic quantum state to GenericStates and return pointer to that state.

Definition at line 1417 of file lines_service.cpp.

References ASSERT, currentState, DEBUG_ENTRY, GenericStates, lastState, lgStatesAdded, t_quantumState::next, StateJunk(), statesAdded, and StateZero().

Referenced by atmdat_readin(), FeIICreate(), H2_Create(), HyperfineCreate(), iso_allocate(), and iso_create().

Here is the call graph for this function:

void chIonLbl ( char *  ,
transition t 
)
char* chLineLbl ( transition t)

chLineLbl use information in line transfer arrays to generate a line label
this label is null terminated

Parameters
*t

Definition at line 285 of file lines_service.cpp.

References ASSERT, t_elementnames::chElementSym, t_elementnames::chIonStage, DEBUG_ENTRY, elementnames, t_transition::Hi, t_quantumState::IonStg, t_quantumState::nelem, and t_transition::WLAng.

Referenced by atom_level3(), ContCreatePointers(), DumpLine(), HeatPunch(), PresTotCurrent(), prme(), PrtComment(), pun1Line(), Punch_Line_RT(), radius_next(), and RT_line_one_tau_reset().

void CollisionJunk ( collision t)

CollisionJunk set all elements of emission struc to dangerous values

Parameters
*t

collision rate coefficient, [cm^3 s-1], upper to lower

Definition at line 989 of file lines_service.cpp.

References t_collision::ColUL, t_collision::cool, t_collision::cs, t_collision::csi, DEBUG_ENTRY, t_collision::heat, and ipNCOLLIDER.

Referenced by TransitionJunk().

void CollisionZero ( collision t)

CollisionZero set all elements of collision struc to zero

Parameters
*t

Definition at line 1093 of file lines_service.cpp.

References t_collision::cool, DEBUG_ENTRY, and t_collision::heat.

Referenced by TransitionZero().

double ConvRate2CS ( realnum  gHi,
realnum  rate 
)
convert down coll rate back into electron cs in case other parts of code need this for reference 
Parameters
gHi- stat weight of upper level
rate- deexcitation rate, units s-1

Definition at line 1133 of file lines_service.cpp.

References ASSERT, t_dense::cdsqte, DEBUG_ENTRY, and dense.

Referenced by CoolOxyg().

void DumpLine ( transition t)
double eina ( double  gf,
double  enercm,
double  gup 
)

eina convert a gf into an Einstein A

Parameters
gf
enercm
gup

Definition at line 186 of file lines_service.cpp.

References DEBUG_ENTRY, POW2, and TRANS_PROB_CONST.

Referenced by atmdat_readin(), and ContCreatePointers().

double emergent_line ( double  emissivity_in,
double  emissivity_out,
long int  ipCont 
)
absorption due to continuous opacity 
Parameters
emissivity[erg cm-3 s-1] in inward direction
emissivity[erg cm-3 s-1] in outward direction
arrayindex for continuum frequency

Definition at line 523 of file lines_service.cpp.

References t_opac::albedo, ASSERT, DEBUG_ENTRY, t_opac::E2TauAbsFace, t_opac::E2TauAbsOut, t_opac::E2TauAbsTotal, geometry, iteration, t_geometry::lgSphere, t_rfield::nupper, opac, and rfield.

Referenced by lindst(), and lines_continuum().

double emit_frac ( transition t)
returns fraction of populations the produce emission 
Parameters
*t

Definition at line 79 of file lines_service.cpp.

References ASSERT, t_emission::Aul, t_dense::cdsqte, t_transition::Coll, t_collision::cs, DEBUG_ENTRY, dense, t_transition::Emis, t_transition::ipCont, t_emission::Pdest, t_emission::Pelec_esc, and t_emission::Pesc.

Referenced by lines_lv1_li_ne(), and lines_lv1_na_ar().

void EmLineJunk ( emission t)
void EmLineZero ( emission t)
void FndLineHt ( long int *  level,
long int *  ipStrong,
double *  Strong 
)

FndLineHt search through line heat arrays to find the strongest heat source

Parameters
*level
*ipStrongthis is the index of the strongest line in the array on the c scale
*Strong

Definition at line 1330 of file lines_service.cpp.

References atmolEmis, C12O16Rotate, C13O16Rotate, t_transition::Coll, DEBUG_ENTRY, t_collision::heat, HFLines, t_transition::Hi, linesAdded2, nCORotate, t_quantumState::nelem, nHFLines, NISO, nLevel1, nWindLine, TauLine2, TauLines, and t_emission::tran.

Referenced by HeatPunch(), and radius_next().

STATIC void gbar0 ( double  ex,
realnum g 
)

Definition at line 1172 of file lines_service.cpp.

References DEBUG_ENTRY, phycon, POW2, and t_phycon::te.

Referenced by MakeCS().

STATIC void gbar1 ( double  ex,
realnum g 
)

Definition at line 1221 of file lines_service.cpp.

References DEBUG_ENTRY, phycon, POW2, and t_phycon::te.

Referenced by MakeCS().

double GetGF ( double  eina,
double  enercm,
double  gup 
)

GetGF convert Einstein A into oscillator strength

Parameters
eina
enercm
gup

Definition at line 203 of file lines_service.cpp.

References ASSERT, DEBUG_ENTRY, POW2, and TRANS_PROB_CONST.

Referenced by ContCreatePointers(), FillExtraLymanLine(), H2_Create(), hydro_vs_coll_str(), hydro_vs_deexcit(), HyperfineCreate(), iso_create(), and iso_satellite_update().

bool lgTauGood ( transition t)

lgTauGood returns true is we have not overrun optical depth scale

Parameters
*t

Definition at line 1152 of file lines_service.cpp.

References DEBUG_ENTRY, t_transition::Emis, fp_equal(), opac, t_emission::TauIn, t_opac::taumin, and t_emission::TauTot.

Referenced by RT_line_all(), and RT_line_static().

Here is the call graph for this function:

void linadd ( double  xInten,
realnum  wavelength,
const char *  chLab,
char  chInfo,
const char *  chComment 
)
enter lines into the line storage array, called once per zone for each line
Parameters
xIntenxInten - local emissivity per unit vol, no fill fac
wavelengthlam integer wavelength
*chLabstring label for ion
chInfocharacter type of entry for line - 'c' cooling, 'h' heating, 'i' info only, 'r' recom line
*chCommentstring explaining line

Definition at line 452 of file lines_service.cpp.

References ASSERT, t_tag_LineSv::chALab, t_tag_LineSv::chComment, t_tag_LineSv::chSumTyp, DEBUG_ENTRY, t_radius::dVeff, t_tag_LineSv::emslin, t_LineSave::ipass, LineSave, LineSv, t_LineSave::nsum, radius, t_tag_LineSv::sumlin, wavelength, and t_tag_LineSv::wavelength.

Referenced by lines(), lines_continuum(), lines_general(), lines_grains(), lines_helium(), lines_hydro(), lines_lv1_k_zn(), lines_lv1_li_ne(), lines_lv1_na_ar(), lines_molecules(), and PutLine().

void lindst ( double  xInten,
realnum  wavelength,
const char *  chLab,
long int  ipnt,
char  chInfo,
bool  lgOutToo,
const char *  chComment 
)
put forbidden line into stack, using index derived below 
Parameters
xIntenxInten - local emissivity per unit vol, no fill fac
wavelengthlam integer wavelength
*chLabstring label for ion
ipntoffset of line in continuum mesh
chInfocharacter type of entry for line - 'c' cooling, 'h' heating, 'i' info only, 'r' recom line
lgOutTooshould line be included in outward beam?
*chCommentstring explaining line

Definition at line 584 of file lines_service.cpp.

References t_rfield::anu, ASSERT, t_tag_LineSv::chALab, t_tag_LineSv::chComment, t_tag_LineSv::chSumTyp, DEBUG_ENTRY, t_radius::dVeff, t_radius::dVolOutwrd, t_radius::dVolReflec, emergent_line(), t_tag_LineSv::emslin, EN1RYD, EnergyRyd, t_opac::ExpZone, t_rt::fracin, t_LineSave::ipass, LineSave, LineSv, t_rfield::nflux, t_LineSave::nsum, opac, t_rfield::outlin, radius, t_rfield::reflin, rfield, rt, t_tag_LineSv::sumlin, wavelength, and t_tag_LineSv::wavelength.

Referenced by H2_LinesAdd(), lines(), lines_continuum(), lines_general(), lines_hydro(), lines_lv1_k_zn(), lines_lv1_li_ne(), lines_lv1_na_ar(), and PutLine().

Here is the call graph for this function:

void LineConvRate2CS ( transition t,
realnum  rate 
)
convert down coll rate back into electron cs in case other parts of code need this for reference 
Parameters
*t- line struct collision strength is stored in t->cs
rate- deexcitation rate, units s-1

Definition at line 1116 of file lines_service.cpp.

References ASSERT, t_dense::cdsqte, t_transition::Coll, t_collision::cs, DEBUG_ENTRY, dense, t_quantumState::g, and t_transition::Hi.

Referenced by CO_PopsEmisCool(), CoolChlo(), CoolIron(), CoolNick(), CoolSili(), and CoolSulf().

void MakeCS ( transition t)

MakeCS compute collision strength by g-bar approximations

Parameters
*t

Definition at line 1247 of file lines_service.cpp.

References t_transition::Coll, t_collision::cs, DEBUG_ENTRY, dense, t_transition::Emis, t_transition::EnergyK, t_transition::EnergyWN, gbar0(), gbar1(), t_emission::gf, t_transition::Hi, t_quantumState::IonStg, t_quantumState::nelem, WAVNRYD, and t_dense::xIonDense.

Referenced by CoolAlum(), CoolCalc(), CoolIron(), CoolMagn(), and CoolSili().

Here is the call graph for this function:

double OccupationNumberLine ( transition t)

OccupationNumberLine - derive the photon occupation number at line center for any line

Parameters
*t

Definition at line 136 of file lines_service.cpp.

References ASSERT, DEBUG_ENTRY, t_transition::Emis, t_quantumState::g, t_transition::Hi, t_transition::ipCont, t_transition::Lo, t_emission::Pesc, t_quantumState::Pop, SDIV(), and SMALLFLOAT.

Referenced by H21_cm_pops(), and PunchDo().

Here is the call graph for this function:

void outline ( transition t)

outline - adds line photons to reflin and outlin

Todo:
1 explore effects of adding term *opac.tmn[ip] to following

Definition at line 52 of file lines_service.cpp.

References ASSERT, t_radius::BeamInIn, t_radius::BeamInOut, t_radius::BeamOutOut, t_emission::ColOvTot, DEBUG_ENTRY, t_transition::Emis, t_emission::FracInwd, t_transition::ipCont, opac, t_rfield::outlin, t_emission::phots, radius, t_rfield::reflin, rfield, and t_opac::tmn.

Referenced by FeII_RT_Out(), H2_RT_diffuse(), and RT_diffuse().

void PntForLine ( double  wavelength,
const char *  chLabel,
long int *  ipnt 
)

PntForLine generate pointer for forbidden line

Parameters
wavelengthwavelength of line in Angstroms
*chLabellabel for the line
*ipntthis is array index on the f, not c scale, for the continuum cell holding the line

Definition at line 661 of file lines_service.cpp.

References ASSERT, cdEXIT, DEBUG_ENTRY, EnergyRyd, ioQQQ, t_LineSave::ipass, ipLineEnergy(), LineSave, MAXFORLIN, RYDLAM, and wavelength.

Referenced by lines(), lines_general(), lines_lv1_k_zn(), lines_lv1_li_ne(), and lines_lv1_na_ar().

Here is the call graph for this function:

void PutCS ( double  cs,
transition t 
)
void PutExtra ( double  Extra)

PutExtra enter and 'extra' intensity source for some line

Parameters
Extra

Definition at line 889 of file lines_service.cpp.

References DEBUG_ENTRY, and ExtraInten.

Referenced by lines(), lines_lv1_k_zn(), lines_lv1_li_ne(), and lines_lv1_na_ar().

void PutLine ( transition t,
const char *  chComment,
const char *  chLabel 
)

PutLine enter local line intensity into the intensity stack for eventual printout

Parameters
*ttransition structure for line
*chCommenta description of the line
*chLabelthe line label

Definition at line 730 of file lines_service.cpp.

References ASSERT, chLabel, t_transition::Coll, t_emission::ColOvTot, t_collision::cool, DEBUG_ENTRY, t_transition::Emis, t_transition::EnergyErg, ExtraInten, t_rt::fracin, t_emission::FracInwd, t_collision::heat, t_LineSave::ipass, t_transition::ipCont, linadd(), lindst(), LineSave, t_emission::PopOpc, t_emission::pump, rt, wl, t_transition::WLAng, and t_emission::xIntensity.

Referenced by DoSatelliteLines(), H2_LinesAdd(), lines(), lines_helium(), lines_hydro(), lines_lv1_k_zn(), lines_lv1_li_ne(), lines_lv1_na_ar(), and lines_molecules().

Here is the call graph for this function:

void PutLine ( transition t,
const char *  chComment 
)

PutLine enter local line intensity into the intensity stack for eventual printout

Parameters
*ttransition structure for line
*chCommenta description of the line

Definition at line 808 of file lines_service.cpp.

References ASSERT, chIonLbl(), chLabel, t_transition::Coll, t_emission::ColOvTot, t_collision::cool, DEBUG_ENTRY, t_transition::Emis, t_transition::EnergyErg, ExtraInten, t_rt::fracin, t_emission::FracInwd, t_collision::heat, t_LineSave::ipass, t_transition::ipCont, linadd(), lindst(), LineSave, t_emission::PopOpc, t_emission::pump, rt, wl, t_transition::WLAng, and t_emission::xIntensity.

Here is the call graph for this function:

double RefIndex ( double  EnergyWN)

RefIndex calculates the index of refraction of air using the line energy in wavenumbers, used to convert vacuum wavelengths to air wavelengths.

Parameters
EnergyWN

Definition at line 369 of file lines_service.cpp.

References ASSERT, and DEBUG_ENTRY.

Referenced by atmdat_Chianti_readin(), atmdat_lamda_readin(), Fe11Lev5(), Fe13Lev5(), Fe3Lev14(), Fe7Lev8(), FeIICreate(), FillExtraLymanLine(), H2_Create(), iso_create(), and lines_setup().

void StateJunk ( quantumState t)

StateJunk set all elements of quantumState struc to dangerous values

Parameters
*t

statistical weight [dimensionless]

population of state [cm-3]

ion stage of element, 1 for atom, 2 ion, etc

atomic number of element, 1 for H, 2 for He, etc

Definition at line 1009 of file lines_service.cpp.

References DEBUG_ENTRY, t_quantumState::g, t_quantumState::IonStg, t_quantumState::nelem, and t_quantumState::Pop.

Referenced by AddState2Stack().

void StateZero ( quantumState t)

StateZero set all elements of quantumState struc to zero

Parameters
*t

population of state [cm-3]

Definition at line 1105 of file lines_service.cpp.

References DEBUG_ENTRY, and t_quantumState::Pop.

Referenced by AddState2Stack(), and TransitionZero().

double TexcLine ( transition t)

TexcLine derive excitation temperature of line from contents of line array

Parameters
*t

Definition at line 160 of file lines_service.cpp.

References DEBUG_ENTRY, t_transition::EnergyK, t_quantumState::g, t_transition::Hi, t_transition::Lo, t_quantumState::Pop, and SMALLFLOAT.

Referenced by DumpLine(), H21_cm_pops(), PunchDo(), and radius_increment().

double totlin ( int  chInfo)

totlin sum total intensity of cooling, recombination, or intensity lines

Parameters
chInfochInfor is 1 char,
'i' information,
'r' recombination or
'c' collision

Definition at line 1291 of file lines_service.cpp.

References cdEXIT, DEBUG_ENTRY, ioQQQ, LineSave, LineSv, t_LineSave::nsum, and t_tag_LineSv::sumlin.

Referenced by badprt(), PrtComment(), and PrtFinal().

void TransitionJunk ( transition t)

TransitionJunk set all elements of transition struc to dangerous values

Parameters
*t

Definition at line 898 of file lines_service.cpp.

References t_transition::Coll, CollisionJunk(), DEBUG_ENTRY, DummyEmis, t_transition::Emis, t_transition::EnergyErg, t_transition::EnergyK, t_transition::EnergyWN, t_transition::Hi, t_transition::ipCont, t_transition::Lo, and t_transition::WLAng.

Referenced by atmdat_readin(), FeIICreate(), H2_Create(), HyperfineCreate(), iso_allocate(), and iso_create().

Here is the call graph for this function:

void TransitionZero ( transition t)

TransitionZero set all elements of transition struc to zero

Parameters
*t

Definition at line 1031 of file lines_service.cpp.

References t_transition::Coll, CollisionZero(), DEBUG_ENTRY, t_transition::Emis, EmLineZero(), t_transition::Hi, t_transition::Lo, and StateZero().

Referenced by CoolCarb(), FeII_LineZero(), H2_Create(), H2_LineZero(), iso_satellite(), iso_zero(), and RT_tau_init().

Here is the call graph for this function:

realnum WavlenErrorGet ( realnum  wavelength)

WavlenErrorGet - given the real wavelength in A for a line routine will find the error expected between the real wavelength and the wavelength printed in the output, with 4 sig figs,

Parameters
wavelength
Returns
function returns difference between exact and 4 sig fig wl, so we have found correct line is fabs(d wl) < return

Definition at line 425 of file lines_service.cpp.

References ASSERT, DEBUG_ENTRY, LineSave, and t_LineSave::sig_figs.

Referenced by cdDLine(), cdEmis(), cdLine(), debugLine(), GetOptLineInt(), lgCheckAsserts(), ParseNorm(), and PrtFinal().

Variable Documentation

double EnergyRyd
static

Definition at line 520 of file lines_service.cpp.

Referenced by iso_create(), lindst(), and PntForLine().

realnum ExtraInten
static

Definition at line 727 of file lines_service.cpp.

Referenced by PutExtra(), and PutLine().


Generated for cloudy by doxygen 1.8.3.1