Cloudy
Spectral Synthesis Code for Astrophysics
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 "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_)
 
#define MAT1(M_, I_, J_)
 
#define MAT2(M_, I_, 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

◆ MAT

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

Referenced by fill_array(), fill_ext_src_and_snk(), find_solution(), HomogeneousSource(), and renorm_solution().

◆ MAT1

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

◆ MAT2

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

Function Documentation

◆ clean_up()

STATIC void clean_up ( long nelem,
double abund_total )

References ASSERT, DEBUG_ENTRY, dense, fixit, ion_trim_small(), ipH_LIKE, iso_renorm(), NISO, and STATIC.

Referenced by ion_solver().

Here is the call graph for this function:

◆ fill_array()

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

◆ fill_ext_src_and_snk()

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

References DEBUG_ENTRY, MAT, mole, and STATIC.

Referenced by ion_solver().

◆ find_solution()

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

◆ get_total_abundance_ions()

STATIC double get_total_abundance_ions ( long int nelem)

References ASSERT, conv, DEBUG_ENTRY, dense, fp_equal_tol(), fprintf(), 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 )

References ASSERT, conv, DEBUG_ENTRY, dense, dynamics, fixit, fnzone, fprintf(), ionbal, ioQQQ, ipHYDROGEN, iteration, MAT, MAX2, mole, nzone, SDIV(), 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

References ASSERT, broken(), clean_up(), conv, DEBUG_ENTRY, dense, fill_array(), fill_ext_src_and_snk(), find_solution(), get_total_abundance_ions(), Heavy, HomogeneousSource(), ionbal, ipCARBON, ipH_LIKE, iso_charge_transfer_update(), iso_departure_coefficients(), iso_satellite_update(), iso_set_ion_rates(), iso_solve(), lgTrivialSolution(), LIMELM, MIN2, NISO, PrintRates(), prt, renorm_solution(), 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..

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

Referenced by ConvBase().

Here is the call graph for this function:

◆ lgTrivialSolution()

STATIC bool lgTrivialSolution ( long nelem,
double abund_total )

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 )

◆ renorm_solution()

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, conv, DEBUG_ENTRY, dense, elementnames, fixit, fprintf(), ionbal, ioQQQ, iso_sp, iteration, LIMELM, MAT, MAX_DENSITY, NISO, nzone, STATIC, and TorF().

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 )

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

Here is the call graph for this function:

◆ store_new_densities()

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

References ASSERT, DEBUG_ENTRY, dense, MAX_DENSITY, and STATIC.

Referenced by ion_solver().