Cloudy
Spectral Synthesis Code for Astrophysics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ion_solver.cpp File Reference
#include "cddefines.h"
#include "yield.h"
#include "prt.h"
#include "continuum.h"
#include "iso.h"
#include "dynamics.h"
#include "grainvar.h"
#include "newton_step.h"
#include "conv.h"
#include "secondaries.h"
#include "phycon.h"
#include "atmdat.h"
#include "heavy.h"
#include "elementnames.h"
#include "ionbal.h"
#include "trace.h"
#include "ion_trim.h"
#include "mole.h"
#include "freebound.h"
#include "dense.h"
#include "thirdparty.h"
Include dependency graph for ion_solver.cpp:

Macros

#define MAT(M_, I_, J_)   ((M_)[(I_)*(ion_range)+(J_)])
 
#define MAT1(M_, I_, J_)   ((M_)[(I_)*(ion_range1)+(J_)])
 
#define MAT2(M_, I_, J_)   ((M_)[(I_)*(ion_range2)+(J_)])
 

Functions

STATIC bool lgTrivialSolution (long nelem, double abund_total)
 
STATIC void find_solution (long nelem, long ion_range, valarray< double > &xmat, valarray< double > &source)
 
STATIC void fill_array (long int nelem, long ion_range, valarray< double > &xmat, valarray< double > &auger)
 
STATIC void fill_ext_src_and_snk (long nelem, long ion_low, long ion_range, valarray< double > &xmat, valarray< double > &source)
 
STATIC double get_total_abundance_ions (long int nelem)
 
STATIC void HomogeneousSource (long nelem, long ion_low, long ion_range, valarray< double > &xmat, valarray< double > &source, double abund_total)
 
STATIC void renorm_solution (long nelem, long ion_range, long ion_low, double *source, double abund_total, bool *lgNegPop)
 
STATIC void store_new_densities (long nelem, long ion_range, long ion_low, double *source)
 
STATIC void clean_up (long nelem, double abund_total)
 
STATIC void PrintRates (long nelem, bool lgNegPop, double abund_total, valarray< double > &auger, bool lgPrintIt)
 
void solveions (double *ion, double *rec, double *snk, double *src, long int nlev, long int nmax)
 
void ion_solver (long int nelem, bool lgPrintIt)
 
void ion_wrapper (long nelem)
 

Macro Definition Documentation

#define MAT (   M_,
  I_,
  J_ 
)    ((M_)[(I_)*(ion_range)+(J_)])
#define MAT1 (   M_,
  I_,
  J_ 
)    ((M_)[(I_)*(ion_range1)+(J_)])
#define MAT2 (   M_,
  I_,
  J_ 
)    ((M_)[(I_)*(ion_range2)+(J_)])

Function Documentation

STATIC void clean_up ( long  nelem,
double  abund_total 
)

References ASSERT, DEBUG_ENTRY, dense, fixit, ion_trim_small(), t_dense::IonHigh, t_dense::IonLow, ipH_LIKE, iso_renorm(), and NISO.

Referenced by ion_solver().

Here is the call graph for this function:

STATIC void fill_ext_src_and_snk ( long  nelem,
long  ion_low,
long  ion_range,
valarray< double > &  xmat,
valarray< double > &  source 
)
STATIC void HomogeneousSource ( long  nelem,
long  ion_low,
long  ion_range,
valarray< double > &  xmat,
valarray< double > &  source,
double  abund_total 
)
void ion_solver ( long int  nelem,
bool  lgPrintIt 
)
void ion_wrapper ( long  nelem)

ion_wrapper a wrapper that redirects to IonHelium, IonCarbo, etc..

References ASSERT, t_elementnames::chElementSym, DEBUG_ENTRY, dense, elementnames, fprintf(), t_dense::gas_phase, IonHelium(), IonHydro(), IonNelem(), ioQQQ, ipHELIUM, ipHYDROGEN, lgElemsConserved(), t_dense::lgElmtOn, t_trace::lgHeavyBug, t_trace::lgTrace, LIMELM, trace, and t_dense::xIonDense.

Referenced by ConvBase().

Here is the call graph for this function:

STATIC bool lgTrivialSolution ( long  nelem,
double  abund_total 
)

References dense, t_dense::IonHigh, t_dense::IonLow, ipH_LIKE, iso_renorm(), t_dense::lgSetIoniz, NISO, t_dense::SetIoniz, and t_dense::xIonDense.

Referenced by ion_solver().

Here is the call graph for this function:

STATIC void renorm_solution ( long  nelem,
long  ion_range,
long  ion_low,
double *  source,
double  abund_total,
bool *  lgNegPop 
)
Todo:
2 renorm should == 1 when the molecules and ionization are in equilibrium. Should monitor this figure of merit in calling routine.

References ASSERT, t_elementnames::chElementSym, conv, DEBUG_ENTRY, dense, elementnames, fixit, fprintf(), ionbal, t_dense::IonHigh, t_dense::IonLow, ioQQQ, iso_sp, iteration, t_conv::lgSearch, LIMELM, MAT, MAX_DENSITY, NISO, t_iso_sp::numLevels_max, nzone, t_ionbal::RateIonizTot(), t_ionbal::RateRecomTot, and TorF().

Referenced by ion_solver().

Here is the call graph for this function:

void solveions ( double *  ion,
double *  rec,
double *  snk,
double *  src,
long int  nlev,
long int  nmax 
)

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

Here is the call graph for this function:

STATIC void store_new_densities ( long  nelem,
long  ion_range,
long  ion_low,
double *  source 
)

References ASSERT, DEBUG_ENTRY, dense, MAX_DENSITY, and t_dense::xIonDense.

Referenced by ion_solver().