#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"
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 ENABLE_SIMULTANEOUS_SOLUTION 0 |
Referenced by ion_solver().
#define MAT | ( | M_, | |||
I_, | |||||
J_ | ) | ((M_)[(I_)*(ion_range)+(J_)]) |
Definition at line 50 of file ion_solver.cpp.
Referenced by combine_arrays(), fill_array(), find_solution(), ion_solver(), lgHomogeneousSource(), and store_new_densities().
#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 |
Referenced by lgOH_ChargeTransferDominant().
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().
STATIC void fill_array | ( | long int | nelem, | |
long | ion_range, | |||
valarray< double > & | xmat, | |||
valarray< double > & | source, | |||
valarray< double > & | auger, | |||
double * | abund_total | |||
) |
Definition at line 623 of file ion_solver.cpp.
References ASSERT, atmdat, broken(), t_ionbal::CollIonRate_Ground, conv, t_secondaries::csupra, DEBUG_ENTRY, dense, t_yield::elec_eject_frac(), fixit(), t_dense::gas_phase, GrainVar::GrainChTrRate, gv, t_atmdat::HCharExcIonOf, Heavy, t_atmdat::HeCharExcIonOf, Singleton< t_yield >::Inst(), ionbal, t_dense::IonHigh, t_dense::IonLow, ipCARBON, ipHELIUM, ipHYDROGEN, ipiv, iteration, t_atmdat::lgCTOn, GrainVar::lgDustOn(), t_mole::lgElem_in_chemistry, t_ionbal::lgGrainIonRecom, GrainVar::lgGrainPhysicsOn, LIMELM, MAT, MAX2, MAX3, MIN2, mole, t_yield::nelec_eject(), NISO, t_Heavy::nsShells, t_conv::nTotalIoniz, t_ionbal::PhotoRate_Shell, t_ionbal::RateIoniz, t_ionbal::RateRecomTot, SDIV(), secondaries, t_mole::sink, sink, t_mole::source, t_ionbal::UTA_ionize_rate, t_dense::xIonDense, t_mole::xMoleChTrRate, and t_dense::xMolecules.
Referenced by ion_solver().
STATIC void find_solution | ( | long | nelem, | |
long | ion_range, | |||
valarray< double > & | xmat, | |||
valarray< double > & | source | |||
) |
Definition at line 200 of file ion_solver.cpp.
References ASSERT, cdEXIT, t_elementnames::chElementSym, conv, DEBUG_ENTRY, dense, t_dense::eden, elementnames, fnzone, getrf_wrapper(), getrs_wrapper(), ionbal, t_dense::IonHigh, t_dense::IonLow, ioQQQ, ipHYDROGEN, ipiv, isnan, MAT, MAX_DENSITY, mole, t_conv::nTotalIoniz, phycon, t_ionbal::RateIonizTot(), t_ionbal::RateRecomTot, t_mole::sink, t_mole::source, and t_phycon::te.
Referenced by ion_solver().
STATIC double get_total_abundance_ions | ( | long int | nelem | ) |
Definition at line 530 of file ion_solver.cpp.
References ASSERT, t_conv::chConvIoniz, conv, DEBUG_ENTRY, dense, t_dense::gas_phase, t_dense::IonHigh, t_dense::IonLow, ioQQQ, ipHYDROGEN, t_conv::lgConvIoniz, t_conv::lgSearch, LIMELM, MAX_DENSITY, t_conv::nTotalIoniz, SDIV(), t_dense::xIonDense, and t_dense::xMolecules.
Referenced by ion_solver().
void ion_solver | ( | long int | nelem1, | |
long int | nelem2, | |||
bool | lgPrintIt | |||
) |
ion_solver same as above but solves two elements simultaneously
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.
void ion_solver | ( | long int | nelem, | |
bool | lgPrintIt | |||
) |
ion_solver solve the bi-diagonal matrix for ionization balance
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().
void ion_wrapper | ( | long | nelem | ) |
ion_wrapper a wrapper that redirects to IonHelium, IonCarbo, etc..
Definition at line 1523 of file ion_solver.cpp.
References ASSERT, t_elementnames::chElementSym, DEBUG_ENTRY, dense, elementnames, t_dense::gas_phase, 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(), IonZinc(), ioQQQ, ipALUMINIUM, ipARGON, ipBERYLLIUM, ipBORON, ipCALCIUM, ipCARBON, ipCHLORINE, ipCHROMIUM, ipCOBALT, ipCOPPER, ipFLUORINE, ipHELIUM, ipHYDROGEN, ipIRON, ipLITHIUM, ipMAGNESIUM, ipMANGANESE, ipNEON, ipNICKEL, ipNITROGEN, ipOXYGEN, ipPHOSPHORUS, ipPOTASSIUM, ipSCANDIUM, ipSILICON, ipSODIUM, ipSULPHUR, ipTITANIUM, ipVANADIUM, ipZINC, t_dense::lgElmtOn, t_trace::lgHeavyBug, t_trace::lgTrace, LIMELM, TotalInsanity(), trace, and t_dense::xIonDense.
Referenced by ConvBase().
STATIC bool lgHomogeneousSource | ( | long | nelem, | |
long | ion_low, | |||
long | ion_range, | |||
valarray< double > & | xmat, | |||
valarray< double > & | source, | |||
double | abund_total | |||
) |
Definition at line 926 of file ion_solver.cpp.
References conv, DEBUG_ENTRY, dense, dynamics, fixit(), fnzone, t_dense::gas_phase, ionbal, ioQQQ, ipHYDROGEN, iteration, t_dynamics::lgAdvection, t_dynamics::lgEquilibrium, MAT, MAX2, t_dynamics::n_initial_relax, t_conv::nTotalIoniz, nzone, t_dynamics::Rate, t_ionbal::RateIonizTot(), t_ionbal::RateRecomTot, SDIV(), t_dynamics::Source, and t_dense::xMolecules.
Referenced by ion_solver().
bool lgOH_ChargeTransferDominant | ( | void | ) |
Definition at line 294 of file ion_solver.cpp.
References atmdat, dense, t_atmdat::HCharExcIonOf, t_atmdat::HCharExcIonTotal, t_atmdat::HCharExcRecTo, t_atmdat::HCharExcRecTotal, ionbal, ipHYDROGEN, ipOXYGEN, mole, t_ionbal::RateIonizTot(), t_ionbal::RateRecomTot, t_mole::sink, THRESHOLD, and t_dense::xIonDense.
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 | |||
) |
Definition at line 1069 of file ion_solver.cpp.
References ASSERT, atmdat, cdEXIT, t_elementnames::chElementName, t_elementnames::chElementNameShort, t_elementnames::chElementSym, t_iso::ColIoniz, t_ionbal::CollIonRate_Ground, ContNegative(), t_ionbal::CotaRate, t_secondaries::csupra, DEBUG_ENTRY, dense, t_ionbal::DR_Badnell_rate_coef, t_ionbal::DR_old_rate_coef, t_ionbal::DR_rate_coef_used, dynamics, t_dense::eden, t_dense::EdenHCorr, elementnames, fnzone, t_iso::gamnc, t_dense::gas_phase, GrainVar::GrainChTrRate, gv, t_atmdat::HCharExcIonOf, t_atmdat::HCharExcIonTotal, t_atmdat::HCharExcRecTo, t_atmdat::HCharExcRecTotal, Heavy, t_atmdat::HeCharExcIonOf, t_atmdat::HeCharExcIonTotal, t_atmdat::HeCharExcRecTo, t_atmdat::HeCharExcRecTotal, ionbal, t_dense::IonHigh, ioQQQ, ipHELIUM, ipHYDROGEN, iso, t_dynamics::lgAdvection, t_prt::lgPrtArry, min(), mole, NISO, t_Heavy::nsShells, t_iso::numLevels_local, nzone, t_ionbal::PhotoRate_Shell, phycon, prt, t_dynamics::Rate, t_ionbal::RateIoniz, t_ionbal::RateIonizTot(), t_ionbal::RateRecomTot, t_ionbal::RR_rate_coef_used, secondaries, ShowMe(), t_mole::sink, t_dynamics::Source, t_mole::source, source, StatesElemNEW, t_phycon::te, t_ionbal::UTA_ionize_rate, t_dense::xIonDense, t_mole::xMoleChTrRate, and t_dense::xMolecules.
Referenced by ion_solver().
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 | |||
) |
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().