/home66/gary/public_html/cloudy/c10_branch/source/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 "hmi.h"
#include "mole.h"
#include "thermal.h"
#include "thirdparty.h"
#include "conv.h"
#include "secondaries.h"
#include "phycon.h"
#include "atmdat.h"
#include "heavy.h"
#include "elementnames.h"
#include "dense.h"
#include "radius.h"
#include "ionbal.h"
#include "taulines.h"
#include "trace.h"
Include dependency graph for ion_solver.cpp:

Go to the source code of this file.

Defines

#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_)])
#define ENABLE_SIMULTANEOUS_SOLUTION   0
#define THRESHOLD   0.75

Functions

bool lgOH_ChargeTransferDominant (void)
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 > &source, valarray< double > &auger, double *abund_total)
STATIC void combine_arrays (valarray< double > &xmat, const valarray< double > &xmat1, const valarray< double > &xmat2, long ion_range1, long ion_range2)
STATIC double get_total_abundance_ions (long int nelem)
STATIC bool lgHomogeneousSource (long nelem, long ion_low, long ion_range, valarray< double > &xmat, valarray< double > &source, double abund_total)
STATIC void store_new_densities (long nelem, long ion_range, long ion_low, double *source, long lgHomogeneous, double abund_total, bool *lgNegPop)
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_solver (long int nelem1, long int nelem2, bool lgPrintIt)
void ion_wrapper (long nelem)

Define Documentation

#define ENABLE_SIMULTANEOUS_SOLUTION   0

Referenced by ion_solver().

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

Definition at line 53 of file ion_solver.cpp.

Referenced by combine_arrays().

#define MAT2 ( M_,
I_,
J_   )     ((M_)[(I_)*(ion_range2)+(J_)])

Definition at line 56 of file ion_solver.cpp.

Referenced by combine_arrays().

#define THRESHOLD   0.75

Function Documentation

STATIC void combine_arrays ( valarray< double > &  xmat,
const valarray< double > &  xmat1,
const valarray< double > &  xmat2,
long  ion_range1,
long  ion_range2 
)

Definition at line 305 of file ion_solver.cpp.

References DEBUG_ENTRY, fp_equal(), MAT, MAT1, and MAT2.

Referenced by ion_solver().

Here is the call graph for this function:

STATIC void fill_array ( long int  nelem,
long  ion_range,
valarray< double > &  xmat,
valarray< double > &  source,
valarray< double > &  auger,
double *  abund_total 
)
STATIC void find_solution ( long  nelem,
long  ion_range,
valarray< double > &  xmat,
valarray< double > &  source 
)
STATIC double get_total_abundance_ions ( long int  nelem  ) 
void ion_solver ( long int  nelem1,
long int  nelem2,
bool  lgPrintIt 
)

ion_solver same as above but solves two elements simultaneously

Parameters:
nelem1 
nelem2 
lgPrintIt - option to print details of matrix elements

Definition at line 96 of file ion_solver.cpp.

References ASSERT, cdEXIT, combine_arrays(), DEBUG_ENTRY, dense, ENABLE_SIMULTANEOUS_SOLUTION, fill_array(), find_solution(), get_total_abundance_ions(), ion_solver(), t_dense::IonHigh, t_dense::IonLow, ioQQQ, ipHYDROGEN, ipOXYGEN, t_prt::lgPrtArry, lgTrivialSolution(), LIMELM, MAT, PrintRates(), prt, source, store_new_densities(), and t_dense::xIonDense.

Here is the call graph for this function:

void ion_solver ( long int  nelem,
bool  lgPrintIt 
)

ion_solver solve the bi-diagonal matrix for ionization balance

Parameters:
nelem - element number on C scale, He is 1
lgPrintIt - option to print details of matrix elements

Definition at line 58 of file ion_solver.cpp.

References DEBUG_ENTRY, dense, fill_array(), find_solution(), get_total_abundance_ions(), t_dense::IonHigh, t_dense::IonLow, lgHomogeneousSource(), t_prt::lgPrtArry, lgTrivialSolution(), LIMELM, PrintRates(), prt, source, and store_new_densities().

Referenced by ion_solver(), IonAlumi(), IonArgon(), IonBeryl(), IonBoron(), IonCalci(), IonCarbo(), IonChlor(), IonChrom(), IonCobal(), IonCoppe(), IonFluor(), IonHelium(), IonHydro(), IonIron(), IonLithi(), IonMagne(), IonManga(), IonNeon(), IonNicke(), IonNitro(), IonOxyge(), IonPhosi(), IonPotas(), IonScand(), IonSilic(), IonSodiu(), IonSulph(), IonTitan(), IonVanad(), and IonZinc().

Here is the call graph for this function:

void ion_wrapper ( long  nelem  ) 
STATIC bool lgHomogeneousSource ( long  nelem,
long  ion_low,
long  ion_range,
valarray< double > &  xmat,
valarray< double > &  source,
double  abund_total 
)
bool lgOH_ChargeTransferDominant ( void   ) 
STATIC bool lgTrivialSolution ( long  nelem,
double  abund_total 
)

Definition at line 180 of file ion_solver.cpp.

References dense, t_dense::IonHigh, t_dense::lgSetIoniz, t_dense::SetIoniz, and t_dense::xIonDense.

Referenced by ion_solver().

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 
)

Definition at line 1473 of file ion_solver.cpp.

References cdEXIT, DEBUG_ENTRY, and ioQQQ.

STATIC void store_new_densities ( long  nelem,
long  ion_range,
long  ion_low,
double *  source,
long  lgHomogeneous,
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.

Definition at line 340 of file ion_solver.cpp.

References ASSERT, t_elementnames::chElementSym, conv, DEBUG_ENTRY, dense, dynamics, elementnames, fixit(), t_thermal::heating, hmi, ionbal, t_dense::IonHigh, t_dense::IonLow, ioQQQ, ipHYDROGEN, iso, iteration, t_dynamics::lgAdvection, t_hmi::lgNoH2Mole, t_conv::lgSearch, LIMELM, MAT, MAX_DENSITY, t_dynamics::n_initial_relax, NISO, t_iso::numLevels_max, nzone, t_dynamics::Rate, t_ionbal::RateIonizTot(), t_ionbal::RateRecomTot, StatesElemNEW, thermal, TorF(), and t_dense::xIonDense.

Referenced by ion_solver().

Here is the call graph for this function:

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 15 Nov 2012 for cloudy by  doxygen 1.6.1