cloudy
trunk
|
#include <conv.h>
Public Member Functions | |
const char * | chName () const |
void | zero () |
void | comment (t_warnings &) |
void | resetConvIoniz () |
void | setConvIonizFail (const char *reason, double oldval, double newval) |
bool | lgConvIoniz () const |
const char * | chConvIoniz () const |
double | convIonizOldVal () const |
double | convIonizNewVal () const |
size_t | ntypes (void) const |
ConvergenceCounter | register_ (const string name) |
void | incrementCounter (const size_t type) |
void | resetCounters () |
void | resetCountersZone () |
long | getCounter (const long type) const |
long | getCounter (const string name) const |
long | getCounterZone (const long type) const |
const char * | getCounterName (const long type) const |
![]() | |
module () | |
virtual | ~module () |
Private Attributes | |
char | m_chConvIoniz [INPUT_LINE_LENGTH] |
bool | m_lgConvIoniz |
double | m_BadConvIoniz [2] |
std::vector< long > | m_counters |
std::vector< long > | m_counters_zone |
std::vector< string > | m_labels |
|
inline |
Definition at line 112 of file conv.h.
References m_chConvIoniz.
Referenced by ConvBase(), ConvEdenIoniz(), ConvFail(), and ConvIoniz().
|
inlinevirtual |
|
inlinevirtual |
|
inline |
Definition at line 120 of file conv.h.
References m_BadConvIoniz.
Referenced by ConvFail(), and ConvIoniz().
|
inline |
Definition at line 116 of file conv.h.
References m_BadConvIoniz.
Referenced by ConvFail(), and ConvIoniz().
|
inline |
|
inline |
Definition at line 331 of file conv.h.
References m_counters, and m_labels.
|
inline |
|
inline |
|
inline |
Definition at line 312 of file conv.h.
References m_counters, and m_counters_zone.
Referenced by ConvergenceCounter::operator++().
|
inline |
Definition at line 108 of file conv.h.
References m_lgConvIoniz.
Referenced by ConvBase(), ConvFail(), ConvIoniz(), ConvPresTempEdenIoniz(), CoolSave(), EdenError(), iso_renorm(), lgStatesConserved(), TransitionProxy::outline(), RT_OTS_PrtRate(), and SaveHeat().
|
inline |
ConvergenceCounter t_conv::register_ | ( | const string | name | ) |
Definition at line 88 of file conv.cpp.
References cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, fprintf(), ioQQQ, m_counters, m_counters_zone, and m_labels.
Referenced by ConvBase(), ConvPresTempEdenIoniz(), CoolHeatError(), EdenError(), diatomics::H2_LevelPops(), ion_solver(), mole_solve(), and newton_step().
|
inline |
Definition at line 93 of file conv.h.
References INPUT_LINE_LENGTH, m_BadConvIoniz, m_chConvIoniz, and m_lgConvIoniz.
Referenced by ConvBase(), and zero().
|
inline |
|
inline |
|
inline |
Definition at line 100 of file conv.h.
References INPUT_LINE_LENGTH, m_BadConvIoniz, m_chConvIoniz, and m_lgConvIoniz.
Referenced by check_co_ion_converge(), ConvBase(), GrainChargeTemp(), iso_renorm(), lgConvEden(), lgNetEdenSrcSmall(), lgStatesConserved(), and mole_solve().
|
virtual |
Implements module.
Definition at line 7 of file conv.cpp.
References autocv, AverEdenError, AverHeatCoolError, AverPressError, BigEdenError, BigHeatCoolError, BigPressError, chConvEden, chNotConverged, chSolverEden, chSolverTemp, dCmHdT, EdenErrorAllowed, failmx, GasPhaseAbundErrorAllowed, HeatCoolRelErrorAllowed, IonizErrorAllowed, lgAllTransitions, lgAutoIt, lgConvEden, lgConvPres, lgConvTemp, lgFirstSweepThisZone, lgLastSweepThisZone, lgLyaMaseCommentDone, lgMap, lgUpdateCouplings, LimFail, limPres2Ioniz, MaxFractionalDensityStepPerIteration, nGrainFail, nIonFail, nNeFail, nPopFail, nPreFail, nPres2Ioniz, nTeFail, nTotalFailures, nTotalIoniz, PressureErrorAllowed, resetConvIoniz(), and resetCounters().
realnum t_conv::autocv |
a convergence criteria
Definition at line 260 of file conv.h.
Referenced by ConvIterCheck(), ParseIterations(), and zero().
realnum t_conv::AverEdenError |
remember the average electron density error
Definition at line 173 of file conv.h.
Referenced by ConvInitSolution(), PrtFinal(), radius_increment(), and zero().
realnum t_conv::AverHeatCoolError |
Definition at line 177 of file conv.h.
Referenced by ConvInitSolution(), PrtFinal(), radius_increment(), and zero().
realnum t_conv::AverPressError |
Definition at line 181 of file conv.h.
Referenced by ConvInitSolution(), PrtFinal(), radius_increment(), and zero().
realnum t_conv::BigEdenError |
remember the biggest electron density error as test of convergence quality
Definition at line 215 of file conv.h.
Referenced by ConvInitSolution(), PrtComment(), PrtFinal(), radius_increment(), and zero().
realnum t_conv::BigHeatCoolError |
remember the biggest and average heating-cooling error
Definition at line 176 of file conv.h.
Referenced by ConvInitSolution(), PrtFinal(), radius_increment(), and zero().
realnum t_conv::BigPressError |
remember the biggest and average pressure error
Definition at line 180 of file conv.h.
Referenced by ConvInitSolution(), PrtFinal(), radius_increment(), and zero().
char t_conv::chConvEden[INPUT_LINE_LENGTH] |
char t_conv::chNotConverged[INPUT_LINE_LENGTH] |
this gives the reason the model was declared not converged when 'iter to convergence' command is given
Definition at line 128 of file conv.h.
Referenced by ConvIterCheck(), PrtComment(), and zero().
char t_conv::chSolverEden[20] |
which electron density solver to use? set with set eden solver command, simple and new
Definition at line 240 of file conv.h.
Referenced by ConvEdenIoniz(), ParseSet(), and zero().
char t_conv::chSolverTemp[20] |
which temperature density solver to use? set with set eden solver command, default and brent
Definition at line 244 of file conv.h.
Referenced by ConvTempEdenIoniz(), and zero().
double t_conv::dCmHdT |
numerical estimate of d(cooling-heating)/dT
Definition at line 286 of file conv.h.
Referenced by ConvTempEdenIoniz(), IterStart(), lgConvTemp(), and zero().
double t_conv::EdenErrorAllowed |
this is relative error in the electron density we want set in zero to 0.01 reset with set eden error command
Definition at line 265 of file conv.h.
Referenced by advection_set_default(), ConvBase(), GrainDrive(), GrainsInit(), diatomics::H2_LevelPops(), lgConvEden(), lgStatesConserved(), ParseSet(), PrtComment(), and zero().
realnum t_conv::failmx |
failmx is largest relative error in heating cooling match
Definition at line 206 of file conv.h.
Referenced by ConvFail(), IterStart(), PrtComment(), and zero().
realnum t_conv::GasPhaseAbundErrorAllowed |
allowed error in total gas-phase density of each element, including molecules change with "SET DENSITY TOLERANCE" command default set in zero
Definition at line 283 of file conv.h.
Referenced by get_total_abundance_ions(), lgElemsConserved(), ParseSet(), GroupMap::setup(), and zero().
realnum t_conv::HeatCoolRelErrorAllowed |
allowed error in heating - cooling balance, set with TOLERANCE command default set in zerologic
Definition at line 276 of file conv.h.
Referenced by advection_set_default(), ConvBase(), ConvFail(), CoolHeatError(), GrainsInit(), diatomics::H2_LevelPops(), lgConvTemp(), lgCoolHeatCheckConverge(), ParseSet(), and zero().
vector<double> t_conv::hist_pres_current |
Definition at line 293 of file conv.h.
Referenced by ConvPresTempEdenIoniz(), logPressureState(), and SaveDo().
vector<double> t_conv::hist_pres_density |
these are used to retain the density pressure history in current zone, can be output with save pressure history
Definition at line 293 of file conv.h.
Referenced by ConvPresTempEdenIoniz(), logPressureState(), and SaveDo().
vector<double> t_conv::hist_pres_error |
Definition at line 293 of file conv.h.
Referenced by ConvPresTempEdenIoniz(), logPressureState(), and SaveDo().
long int t_conv::hist_pres_nzone |
Definition at line 294 of file conv.h.
Referenced by ConvInitSolution(), and ConvPresTempEdenIoniz().
vector<double> t_conv::hist_temp_cool |
Definition at line 298 of file conv.h.
Referenced by CoolHeatError(), and SaveDo().
vector<double> t_conv::hist_temp_heat |
Definition at line 298 of file conv.h.
Referenced by CoolHeatError(), and SaveDo().
long int t_conv::hist_temp_nzone |
Definition at line 299 of file conv.h.
Referenced by ConvInitSolution(), and CoolHeatError().
vector<double> t_conv::hist_temp_temp |
these are used to retain the temp/heat/cooling history in current zone, can be output with save temperature history
Definition at line 298 of file conv.h.
Referenced by CoolHeatError(), and SaveDo().
long int t_conv::ifailz[12] |
zones where converge problems occurred
Definition at line 236 of file conv.h.
Referenced by ConvFail(), and PrtComment().
realnum t_conv::IonizErrorAllowed |
Definition at line 278 of file conv.h.
Referenced by ConvBase(), diatomics::H2_LevelPops(), iso_renorm(), mole_solve(), ParseSet(), and zero().
bool t_conv::lgAllTransitions |
says "iterate to convergence all" command given
Definition at line 254 of file conv.h.
Referenced by ConvIterCheck(), ParseIterations(), and zero().
bool t_conv::lgAutoIt |
says "iterate to convergence" command given
Definition at line 251 of file conv.h.
Referenced by ConvIterCheck(), ParseCommands(), ParseIterations(), PrtComment(), and zero().
bool t_conv::lgBadStop |
flag saying that calculation stopped for bad reason mostly set in lgEndfun
Definition at line 248 of file conv.h.
Referenced by iter_end_check(), PrtComment(), and PrtFinal().
bool t_conv::lgConvEden |
true when the electron density has converged
Definition at line 197 of file conv.h.
Referenced by ConvEdenIoniz(), ConvPresTempEdenIoniz(), CoolSave(), lgConvEden(), TransitionProxy::outline(), SaveHeat(), and zero().
bool t_conv::lgConvPops |
this flag is used in ConvPresTempEdenIoniz to check that populations have converged
Definition at line 136 of file conv.h.
Referenced by ConvFail(), ConvPresTempEdenIoniz(), diatomics::H2_LevelPops(), and TransitionProxy::outline().
bool t_conv::lgConvPres |
true if pressure is converged, false if not
Definition at line 194 of file conv.h.
Referenced by ConvPresTempEdenIoniz(), CoolSave(), TransitionProxy::outline(), PressureChange(), SaveDo(), SaveHeat(), and zero().
bool t_conv::lgConvTemp |
true if temperature is converged, false if not
Definition at line 191 of file conv.h.
Referenced by ConvFail(), ConvPresTempEdenIoniz(), ConvTempEdenIoniz(), CoolSave(), lgConvTemp(), TransitionProxy::outline(), SaveDo(), SaveHeat(), and zero().
bool t_conv::lgFirstSweepThisZone |
first sweep through solvers in this zone. also true is search phase
Definition at line 148 of file conv.h.
Referenced by ConvBase(), ConvInitSolution(), ConvPresTempEdenIoniz(), RT_line_all(), RT_line_all_escape(), RT_line_escape(), RT_line_pumping(), RT_tau_inc(), RT_tau_init(), UpdateUTAs(), and zero().
bool t_conv::lgIonStageTrimed |
flag set in ConvBase, saying whether ionization stage is trimmed down
Definition at line 184 of file conv.h.
Referenced by ConvBase(), ion_trim(), ion_trim2(), and RT_line_all_escape().
bool t_conv::lgLastSweepThisZone |
last sweep through solvers in this zone, so update fine opacities
Definition at line 150 of file conv.h.
Referenced by ConvInitSolution(), ConvPresTempEdenIoniz(), RT_line_all(), RT_line_all_escape(), RT_line_fine_opacity(), RT_tau_inc(), and zero().
bool t_conv::lgLyaMaseCommentDone |
Definition at line 170 of file conv.h.
Referenced by H21_cm_pops(), and zero().
bool t_conv::lgMap |
lgMap is option to map failures
Definition at line 233 of file conv.h.
Referenced by ConvFail(), ParseFail(), and zero().
bool t_conv::lgOscilOTS |
this is true if ots rates are oscillating, and this is why ionization is not converged
Definition at line 188 of file conv.h.
Referenced by ConvBase(), ConvInitSolution(), ConvIoniz(), and RT_tau_init().
bool t_conv::lgSearch |
conv.lgSearch is true during initial temp-ion search phase, false after first zone established
Definition at line 168 of file conv.h.
Referenced by ConvBase(), ConvEdenIoniz(), ConvInitSolution(), ConvIoniz(), CoolEvaluate(), dBase_solve(), EdenChange(), GrainCharge(), GrainChargeTemp(), GrainDrive(), H21_cm_pops(), diatomics::H2_Cooling(), diatomics::H2_LevelPops(), HeatSum(), ion_trim(), ion_trim2(), ion_trim_validate(), iso_level(), iter_end_check(), lgNetEdenSrcSmall(), map_do(), MyAssert(), OpacityAddTotal(), Atom_LevelN::operator()(), PresTotCurrent(), and renorm_solution().
bool t_conv::lgUpdateCouplings |
says update inter-couplings after every ion solution
Definition at line 257 of file conv.h.
Referenced by ConvBase(), ParseSet(), and zero().
long int t_conv::LimFail |
LimFail is limit to number of te failures, set with "failures" cmnd
Definition at line 230 of file conv.h.
Referenced by ConvFail(), grid_do(), ParseFail(), and zero().
long int t_conv::limPres2Ioniz |
a limit to the above, in case where one zone takes forever to not converge, usually very large, set with SET PRESIONIZ command
Definition at line 154 of file conv.h.
Referenced by ConvBase(), ParseSet(), and zero().
|
private |
when the lgConvIoniz flag is set false, the old and new numbers, the reason for the lack of convergence, should be set to following
Definition at line 141 of file conv.h.
Referenced by convIonizNewVal(), convIonizOldVal(), resetConvIoniz(), and setConvIonizFail().
|
private |
this says why the ionization did not converge, reasons can be a large change in the level of ionization, or in the heating
Definition at line 90 of file conv.h.
Referenced by chConvIoniz(), resetConvIoniz(), and setConvIonizFail().
|
private |
Definition at line 303 of file conv.h.
Referenced by getCounter(), incrementCounter(), ntypes(), register_(), and resetCounters().
|
private |
Definition at line 304 of file conv.h.
Referenced by getCounterZone(), incrementCounter(), register_(), and resetCountersZone().
|
private |
Definition at line 305 of file conv.h.
Referenced by getCounter(), getCounterName(), and register_().
|
private |
this flag is used in ConvPresTempEdenIoniz to check that ionization has converged
Definition at line 132 of file conv.h.
Referenced by lgConvIoniz(), resetConvIoniz(), and setConvIonizFail().
double t_conv::MaxFractionalDensityStepPerIteration |
Definition at line 272 of file conv.h.
Referenced by ConvPresTempEdenIoniz(), limitedDensityScaling(), and zero().
long int t_conv::nChemFail |
number of chemistry solution failures
Definition at line 227 of file conv.h.
Referenced by IterStart().
long int t_conv::nGrainFail |
number of grain ionization balance failures
Definition at line 224 of file conv.h.
Referenced by ConvFail(), IterStart(), and zero().
long int t_conv::nIonFail |
nIonFail is number of ionization failures
Definition at line 218 of file conv.h.
Referenced by cdNwcns(), ConvFail(), IterStart(), and zero().
long int t_conv::nNeFail |
nNeFail is number of electron density failures
Definition at line 212 of file conv.h.
Referenced by cdNwcns(), ConvFail(), IterStart(), and zero().
long int t_conv::nPopFail |
nIonFail is number of level population failures
Definition at line 221 of file conv.h.
Referenced by ConvFail(), IterStart(), and zero().
long int t_conv::nPreFail |
nPreFail is number of pressure failures
Definition at line 209 of file conv.h.
Referenced by cdNwcns(), ConvFail(), IterStart(), and zero().
long int t_conv::nPres2Ioniz |
this will count the number of ionizations in one call from ConvPresTempEdenIoniz
Definition at line 145 of file conv.h.
Referenced by ConvBase(), ConvInitSolution(), ConvPresTempEdenIoniz(), CoolEvaluate(), ion_photo(), iso_update_rates(), mole_h_reactions(), OpacityAddTotal(), PrtZone(), RT_line_all(), SaveDo(), and zero().
long int t_conv::nTeFail |
nTeFail number of temperature failures
Definition at line 203 of file conv.h.
Referenced by cdNwcns(), ConvFail(), IterStart(), PrtComment(), ShowMe(), and zero().
long int t_conv::nTotalFailures |
total number of all falures, used to trigger abort
Definition at line 200 of file conv.h.
Referenced by ConvFail(), IterStart(), and zero().
long int t_conv::nTotalIoniz |
counts the number of calls to conv base after iteration starts can be used to determine very first pass through an iteration reset to zero at start of each iteration in a simulation
Definition at line 159 of file conv.h.
Referenced by ChargTranEval(), ConvBase(), ConvInitSolution(), dBaseAbund(), dBaseTrim(), EdenChange(), find_solution(), diatomics::H2_LevelPops(), HomogeneousSource(), ion_trim(), IonHelium(), iso_collapsed_update(), iso_collide(), iso_continuum_lower(), iso_ionize_recombine(), iso_level(), iso_rad_rec_cooling_discrete(), iso_radiative_recomb(), iso_update_rates(), iter_end_check(), lgCheckMonitors(), map_do(), mole_h_reactions(), PresTotCurrent(), PrtFinal(), RT_DestProb(), tauff(), TempChange(), and zero().
long int t_conv::nTotalIoniz_start |
the same counter but set to zero after the initial solution is converged, so this is a measure of the number of calls within true zones
Definition at line 164 of file conv.h.
Referenced by ConvInitSolution(), lgCheckMonitors(), and PrtFinal().
realnum t_conv::PressureErrorAllowed |
this is relative error in the pressure, initialized to 0.02 in reset with set pressure error command
Definition at line 270 of file conv.h.
Referenced by advection_set_default(), lgTestPressureConvergence(), ParseSet(), PresTotCurrent(), and zero().
double t_conv::sigma_dCmHdT |
1-sigma uncertainty in numerical estimate of d(cooling-heating)/dT
Definition at line 289 of file conv.h.
Referenced by ConvTempEdenIoniz(), and lgConvTemp().