cloudy trunk
Loading...
Searching...
No Matches
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 "newton_step.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.

Macros

#define SOLVE_TWO   0
#define MAT(M_, I_, J_)
#define MAT1(M_, I_, J_)
#define MAT2(M_, I_, J_)
#define THRESHOLD   0.25

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 > &source, valarray< double > &auger, double *abund_total)
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 store_new_densities (long nelem, long ion_range, long ion_low, double *source, 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)
bool lgOH_ChargeTransferDominant (void)
void ion_wrapper (long nelem)

Macro Definition Documentation

◆ MAT

#define MAT ( M_,
I_,
J_ )
Value:
((M_)[(I_)*(ion_range)+(J_)])
#define J_(A_)
Definition iso.h:23

Definition at line 54 of file ion_solver.cpp.

Referenced by fill_array(), find_solution(), HomogeneousSource(), and store_new_densities().

◆ MAT1

#define MAT1 ( M_,
I_,
J_ )
Value:
((M_)[(I_)*(ion_range1)+(J_)])

Definition at line 57 of file ion_solver.cpp.

◆ MAT2

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

Definition at line 60 of file ion_solver.cpp.

◆ SOLVE_TWO

#define SOLVE_TWO   0

Definition at line 28 of file ion_solver.cpp.

◆ THRESHOLD

#define THRESHOLD   0.25

Function Documentation

◆ fill_array()

STATIC void fill_array ( long int nelem,
long ion_range,
valarray< double > & xmat,
valarray< double > & source,
valarray< double > & auger,
double * abund_total )

◆ find_solution()

STATIC void find_solution ( long nelem,
long ion_range,
valarray< double > & xmat,
valarray< double > & source )

Definition at line 264 of file ion_solver.cpp.

References ASSERT, cdEXIT, conv, DEBUG_ENTRY, dense, elementnames, EXIT_FAILURE, fnzone, getrf_wrapper(), getrs_wrapper(), ionbal, ioQQQ, ipHYDROGEN, isnan, MAT, MAX_DENSITY, mole, phycon, solve_system(), source, and STATIC.

Referenced by ion_solver().

Here is the call graph for this function:

◆ get_total_abundance_ions()

STATIC double get_total_abundance_ions ( long int nelem)

Definition at line 617 of file ion_solver.cpp.

References ASSERT, conv, DEBUG_ENTRY, dense, fp_equal_tol(), ionbal, ioQQQ, LIMELM, MAX_DENSITY, and STATIC.

Referenced by ion_solver().

Here is the call graph for this function:

◆ HomogeneousSource()

STATIC void HomogeneousSource ( long nelem,
long ion_low,
long ion_range,
valarray< double > & xmat,
valarray< double > & source,
double abund_total )

Definition at line 901 of file ion_solver.cpp.

References ASSERT, conv, DEBUG_ENTRY, dense, dynamics, fixit(), fnzone, ionbal, ioQQQ, ipHYDROGEN, iteration, MAT, MAX2, mole, nzone, SDIV(), source, and STATIC.

Referenced by ion_solver().

Here is the call graph for this function:

◆ ion_solver()

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 62 of file ion_solver.cpp.

References ASSERT, conv, DEBUG_ENTRY, dense, fill_array(), find_solution(), get_total_abundance_ions(), HomogeneousSource(), ION_SOLVES, ipH_LIKE, iso_charge_transfer_update(), iso_departure_coefficients(), ISO_LOOPS, iso_satellite_update(), iso_set_ion_rates(), iso_solve(), lgTrivialSolution(), LIMELM, MIN2, NISO, PrintRates(), prt, source, and store_new_densities().

Referenced by IonHelium(), IonHydro(), and IonNelem().

Here is the call graph for this function:

◆ ion_wrapper()

void ion_wrapper ( long nelem)

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

Definition at line 1498 of file ion_solver.cpp.

References ASSERT, DEBUG_ENTRY, dense, elementnames, IonHelium(), IonHydro(), IonNelem(), ioQQQ, ipHELIUM, ipHYDROGEN, lgElemsConserved(), LIMELM, and trace.

Referenced by ConvBase().

Here is the call graph for this function:

◆ lgOH_ChargeTransferDominant()

bool lgOH_ChargeTransferDominant ( void )

Definition at line 370 of file ion_solver.cpp.

References atmdat, dense, ionbal, ipHYDROGEN, ipOXYGEN, mole, and THRESHOLD.

◆ lgTrivialSolution()

STATIC bool lgTrivialSolution ( long nelem,
double abund_total )

Definition at line 239 of file ion_solver.cpp.

References dense, ipH_LIKE, iso_renorm(), NISO, and STATIC.

Referenced by ion_solver().

Here is the call graph for this function:

◆ PrintRates()

STATIC void PrintRates ( long nelem,
bool lgNegPop,
double abund_total,
valarray< double > & auger,
bool lgPrintIt )

Definition at line 1063 of file ion_solver.cpp.

References ASSERT, atmdat, cdEXIT, ContNegative(), DEBUG_ENTRY, dense, dynamics, elementnames, EXIT_FAILURE, fnzone, gv, Heavy, ionbal, ioQQQ, ipHELIUM, ipHYDROGEN, iso_sp, min(), mole, t_atmdat::NCX, NISO, nzone, phycon, prt, SDIV(), secondaries, ShowMe(), source, and STATIC.

Referenced by ion_solver().

Here is the call graph for this function:

◆ solveions()

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

Definition at line 1448 of file ion_solver.cpp.

References cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, and ioQQQ.

◆ store_new_densities()

STATIC void store_new_densities ( 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.

Definition at line 429 of file ion_solver.cpp.

References ASSERT, conv, DEBUG_ENTRY, dense, elementnames, fixit(), ionbal, ioQQQ, ipH_LIKE, iso_renorm(), iso_sp, iteration, LIMELM, MAT, MAX_DENSITY, NISO, nzone, source, STATIC, thermal, and TorF().

Referenced by ion_solver().

Here is the call graph for this function: