cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
iso_solve.cpp
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2022 by Gary J. Ferland and
2  * others. For conditions of distribution and use see copyright notice in license.txt */
3 /* iso_solve main routine to call iso_level and determine iso level balances */
4 /* iso_renorm - renormalize iso sequences so that they agree with the ionization balance */
5 /* AGN_He1_CS routine to save table needed for AGN3 - collision strengths of HeI */
6 #include "cddefines.h"
7 #include "atmdat.h"
8 #include "conv.h"
9 #include "elementnames.h"
10 #include "helike_cs.h"
11 #include "hmi.h"
12 #include "hydrogenic.h"
13 #include "ionbal.h"
14 #include "iso.h"
15 #include "helike.h"
16 #include "phycon.h"
17 #include "rfield.h"
18 #include "secondaries.h"
19 #include "thermal.h"
20 #include "trace.h"
21 #include "mole.h"
22 #include "freebound.h"
23 #include "two_photon.h"
24 #include "dense.h"
25 
27 {
28  for( long nelem=ipHYDROGEN; nelem<=ipHELIUM; nelem++ )
29  {
30  if (dense.lgElmtOn[nelem])
31  {
32  for( long ipISO=ipH_LIKE; ipISO<MIN2(NISO,nelem+1); ipISO++ )
33  {
34  if ((dense.IonHigh[nelem] >= nelem - ipISO &&
35  dense.IonLow[nelem] <= nelem - ipISO) || !conv.nTotalIoniz)
36  {
37  iso_collapsed_Aul_update( ipISO, nelem );
38 
39  iso_collapsed_lifetimes_update( ipISO, nelem );
40 
41  iso_cascade( ipISO, nelem );
42  }
43  }
44  }
45  }
46 }
47 
48 void iso_update_rates( void )
49 {
50  for( long nelem=ipHYDROGEN; nelem<LIMELM; nelem++ )
51  {
52  if (!dense.lgElmtOn[nelem])
53  continue;
54  for( long ipISO=ipH_LIKE; ipISO<MIN2(NISO,nelem+1); ipISO++ )
55  {
56  if ((dense.IonHigh[nelem] >= nelem - ipISO &&
57  dense.IonLow[nelem] <= nelem - ipISO) || !conv.nTotalIoniz)
58  {
59 
60  /* evaluate collisional rates */
61  iso_collide( ipISO, nelem );
62 
63  /* truncate atom if physical conditions limit the maximum principal quantum number of a
64  * bound electron to a number less than the malloc'd size */
66  iso_continuum_lower( ipISO, nelem );
67 
68  /* evaluate recombination rates -- needs to precede iso_photo because of topoff fix */
69  iso_radiative_recomb( ipISO , nelem );
70 
71  /* evaluate photoionization rates */
72  iso_photo( ipISO , nelem );
73 
74  /* Generate Gaussian errors if turned on. */
75  if( iso_ctrl.lgRandErrGen[ipISO] && nzone==0 && !iso_sp[ipISO][nelem].lgErrGenDone )
76  {
77  iso_error_generation(ipISO, nelem );
78  }
79 
80  iso_radiative_recomb_effective( ipISO, nelem );
81 
82  iso_ionize_recombine( ipISO , nelem );
83 
84  ionbal.RateRecomTot[nelem][nelem-ipISO] = ionbal.RateRecomIso[nelem][ipISO];
85  }
86 
88  ASSERT( ipISO <= ipHE_LIKE );
89  // two-photon processes
90  t_iso_sp* sp = &iso_sp[ipISO][nelem];
91  for( vector<two_photon>::iterator tnu = sp->TwoNu.begin(); tnu != sp->TwoNu.end(); ++tnu )
92  {
94  }
95  }
96  }
97 }
98 
99 void iso_solve(long ipISO, long nelem, double &maxerr)
100 {
101  DEBUG_ENTRY( "iso_solve()" );
102 
103  maxerr = 0.;
104  /* do not consider elements that have been turned off */
105  if( dense.lgElmtOn[nelem] )
106  {
107  /* note that nelem scale is totally on c not physical scale, so 0 is h */
108  /* evaluate balance if ionization reaches this high */
109  if( (dense.IonHigh[nelem] >= nelem - ipISO) &&
110  (dense.IonLow[nelem] <= nelem - ipISO) )
111  {
112  /* solve for the level populations */
113  double renorm;
114  iso_level( ipISO , nelem, renorm, iso_sp[ipISO][nelem].lgPrtMatrix );
115  if (fabs(renorm-1.0) > maxerr)
116  maxerr = fabs(renorm-1.0);
117 
118  /* this just contains a bunch of trace statements. */
119  HydroLevel(ipISO, nelem);
120  }
121  else
122  {
123  /* zero it out since no population*/
124  iso_sp[ipISO][nelem].st[0].Pop() = 0.;
125  for( long ipHi=1; ipHi < iso_sp[ipISO][nelem].numLevels_max; ipHi++ )
126  {
127  iso_sp[ipISO][nelem].st[ipHi].Pop() = 0.;
128  for( long ipLo=0; ipLo < ipHi; ipLo++ )
129  {
130  if( iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().Aul() <= iso_ctrl.SmallA )
131  continue;
132 
133  /* population of lower level rel to ion, corrected for stim em */
134  iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().PopOpc() = 0.;
135  iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().mult_opac() = 0.;
136  }
137  }
138  }
139 
140  ASSERT( (*iso_sp[ipISO][nelem].trans(iso_ctrl.nLyaLevel[ipISO],0).Lo()).Pop() == iso_sp[ipISO][nelem].st[0].Pop() );
141 
142  if( 0 )
143  {
144  /*Print effective recombination coefficients to 2s level for H */
145  if ( nelem == 0 && ipISO == 0 )
146  {
147  double alphaeff2s=0., pop, alphaeff2p = 0;
148  long numLevs = iso_sp[ipISO][nelem].numLevels_max - iso_sp[ipISO][nelem].nCollapsed_max;
149  fprintf( ioQQQ,"Effective recombination 2S/2P, ipISO=%li, nelem=%li, Te = %e, dens=%e\t%e, numlevels=%li\n", ipISO, nelem, phycon.te,
150  dense.eden, dense.xIonDense[nelem][ipISO+1],numLevs );
151  fprintf( ioQQQ, "N\tL\tS\tAlphaEffec\n" );
152 
153  for( long ipHi=3; ipHi < iso_sp[ipISO][nelem].numLevels_max; ipHi++ )
154  {
155  //if (iso_sp[ipISO][nelem].st[ipHi].l()==1)
156  pop = iso_sp[ipISO][nelem].st[ipHi].Pop();
157  if (ipHi > numLevs )
158  pop /=(2.*pow2((double)iso_sp[ipISO][nelem].st[ipHi].n()));
159 
160  alphaeff2s += pop*iso_sp[ipISO][nelem].trans(ipHi,1).Emis().Aul();
161 
162  alphaeff2p += pop*iso_sp[ipISO][nelem].trans(ipHi,2).Emis().Aul();
163 
164  }
165 
166  alphaeff2s /= (dense.eden*dense.xIonDense[nelem][ipISO+1]);
167  alphaeff2s += iso_sp[ipISO][nelem].fb[1].RadRecomb[ipRecRad];
168 
169  alphaeff2p /= (dense.eden*dense.xIonDense[nelem][ipISO+1]);
170  alphaeff2p += iso_sp[ipISO][nelem].fb[2].RadRecomb[ipRecRad];
171 
172 
173  fprintf( ioQQQ, "%li\t%li\t%li\t%e\t\n", iso_sp[ipISO][nelem].st[1].n(),iso_sp[ipISO][nelem].st[1].l() ,
174  iso_sp[ipISO][nelem].st[1].S(),alphaeff2s );
175  fprintf( ioQQQ, "%li\t%li\t%li\t%e\t\n", iso_sp[ipISO][nelem].st[2].n(),iso_sp[ipISO][nelem].st[2].l() ,
176  iso_sp[ipISO][nelem].st[2].S(),alphaeff2p );
177  fprintf( ioQQQ, "\n" );
178  }
179  }
180 
181 
182  }
183 
184  return;
185 }
186 
187 void IonHydro( void )
188 {
189  DEBUG_ENTRY( "IonHydro()" );
190 
191  /* ============================================================================== */
192  /* rest is for hydrogen only */
193 
194  {
195  /*@-redef@*/
196  /* often the H- route is the most efficient formation mechanism for H2,
197  * will be through rate called ratach
198  * this debug print statement is to trace h2 oscillations */
199  enum {DEBUG_LOC=false};
200  /*@+redef@*/
201  if(DEBUG_LOC )
202  {
203  fprintf(ioQQQ,"DEBUG \t%.2f\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\n",
204  fnzone,
205  hmi.H2_total ,
206  findspecieslocal("H2")->den,
212  }
213  }
214 #if 0
215  /* >>chng 01 may 09, add option to force abundance, with element name ioniz cmmnd */
217  {
219  dense.xIonDense[ipHYDROGEN][1] = dense.SetIoniz[ipHYDROGEN][1]*dense_ation;
220  dense.xIonDense[ipHYDROGEN][0] = dense.SetIoniz[ipHYDROGEN][0]*dense_ation;
221 
222  /* initialize ground state pop too */
224  }
225  else
226  {
227  /*
228  * >> chng 03 jan 15 rjrw:- terms are now in ion_solver, to allow for
229  * molecular sources and sinks of H and H+. ion_solver renormalizes
230  * to keep the total H abundance correct -- only the molecular
231  * network is allowed to change this.
232  */
233  ion_solver( ipHYDROGEN , false );
234  }
235 
236  fixit(); /* this is called in HydroLevel above, is it needed in both places? */
237  /* >>hcng 05 mar 24,
238  * renormalize the populations and emission of H atom to agree with chemistry */
239  double renorm;
240  iso_renorm( ipHYDROGEN, ipH_LIKE, renorm );
241 #endif
242  ion_solver( ipHYDROGEN , false );
243 
244  /* remember the ratio of pops of 2p to 1s for possible printout in prtComment
245  * and to obtain Lya excitation temps. the pop of ground is not defined if
246  * NO ionization at all since these pops are relative to ion */
247  /* >>chng 99 jun 03, added MAX2 to protect against totally neutral gas */
248  if( iso_sp[ipH_LIKE][ipHYDROGEN].st[ipH2p].Pop()/MAX2(SMALLDOUBLE,iso_sp[ipH_LIKE][ipHYDROGEN].st[ipH1s].Pop()) > 0.1 &&
249  iso_sp[ipH_LIKE][ipHYDROGEN].st[ipH1s].Pop() > SMALLDOUBLE )
250  {
251  hydro.lgHiPop2 = true;
253  hydro.pop2mx);
254  }
255 
256  double gamtot = iso_sp[ipH_LIKE][ipHYDROGEN].fb[ipH1s].gamnc + secondaries.csupra[ipHYDROGEN][0];
257 
258  double coltot = iso_sp[ipH_LIKE][ipHYDROGEN].fb[ipH1s].ColIoniz +
261 
262  /* if ground state destruction rate is significant, recall different dest procceses */
263  if( iso_sp[ipH_LIKE][ipHYDROGEN].fb[ipH1s].RateLevel2Cont > SMALLFLOAT )
264  {
266  (realnum)(iso_sp[ipH_LIKE][ipHYDROGEN].fb[ipH1s].gamnc/iso_sp[ipH_LIKE][ipHYDROGEN].fb[ipH1s].RateLevel2Cont );
267 
268  /* fraction of ionizations of H from ground, due to thermal collisions */
270  (realnum)(iso_sp[ipH_LIKE][ipHYDROGEN].fb[ipH1s].ColIoniz*dense.eden/iso_sp[ipH_LIKE][ipHYDROGEN].fb[ipH1s].RateLevel2Cont);
271 
272  /* this flag is used in ConvBase to decide whether we
273  * really need to converge the secondary ionization rates */
275  (realnum)(secondaries.csupra[ipHYDROGEN][0] / iso_sp[ipH_LIKE][ipHYDROGEN].fb[ipH1s].RateLevel2Cont);
276 
277  /* frac of ionizations due to ct */
279  }
280  else
281  {
283  hydro.H_ion_frac_photo = 0.;
284  secondaries.sec2total = 0.;
285  atmdat.HIonFrac = 0.;
286  }
287 
288  if( trace.lgTrace )
289  {
290  fprintf( ioQQQ, " Hydrogenic return %.2f ",fnzone);
291  fprintf(ioQQQ,"H0:%.3e ", dense.xIonDense[ipHYDROGEN][0]);
292  fprintf(ioQQQ,"H+:%.3e ", dense.xIonDense[ipHYDROGEN][1]);
293  fprintf(ioQQQ,"H2:%.3e ", hmi.H2_total);
294  fprintf(ioQQQ,"H-:%.3e ", findspecieslocal("H-")->den);
295  fprintf(ioQQQ,"ne:%.3e ", dense.eden);
296  fprintf( ioQQQ, " REC, COL, GAMT= ");
297  /* recomb rate coef, cm^3 s-1 */
298  fprintf(ioQQQ,"%.2e ", iso_sp[ipH_LIKE][ipHYDROGEN].RadRec_effec );
299  fprintf(ioQQQ,"%.2e ", coltot);
300  fprintf(ioQQQ,"%.2e ", gamtot);
301  fprintf( ioQQQ, " CSUP=");
303  fprintf( ioQQQ, "\n");
304  }
305 
306  return;
307 }
308 
309 /* iso_renorm - renormalize iso sequences so that they agree with the ionization balance */
310 void iso_renorm( long nelem, long ipISO, double &renorm )
311 {
312  DEBUG_ENTRY( "iso_renorm()" );
313 
314  const bool lgJustAssert = false, lgJustTest = true;
315  double sum_atom_iso;
316 
317  renorm = 1.0;
318 
319  if (ipISO > nelem)
320  return;
321 
322  /*>>chng 04 mar 23, add this renorm */
323  /* renormalize the state specific populations, so that they
324  * add up to the results that came from ion_solver
325  * units at first is sum div by H+ density, since Pop2Ion defn this way */
326  sum_atom_iso = 0.;
327  /* >> chng 06 aug 31, from numLevels_max to _local */
328  for( long level=0; level < iso_sp[ipISO][nelem].numLevels_local; level++ )
329  {
330  /* cm-3 - total population in iso solved model */
331  sum_atom_iso += iso_sp[ipISO][nelem].st[level].Pop();
332  }
333 
334  // If total iso population is tiny, populate ground state (probably due to
335  // e.g. ++dense.IonHigh[nelem] somewhere)
336  if (sum_atom_iso <= SMALLFLOAT)
337  {
338  // Ensure this is different from the ion density, so it is signalled as non-convergence
339  if (dense.xIonDense[nelem][nelem-ipISO] > 2.0*SMALLFLOAT)
340  sum_atom_iso = 0.5*dense.xIonDense[nelem][nelem-ipISO];
341  else
342  sum_atom_iso = 1.0;
343  if ( !lgJustTest )
344  iso_sp[ipISO][nelem].st[0].Pop() = sum_atom_iso;
345  }
346 
347  /* >>chng 04 may 25, humunculus sum_atom_iso is zero */
348  renorm = dense.xIonDense[nelem][nelem-ipISO] / sum_atom_iso;
349 
350  if (lgJustTest)
351  return;
352 
353  if (0)
354  fprintf (ioQQQ, "Iso_Renorm %ld %ld %g %g %g[%g]\n",
355  ipISO,nelem,renorm-1.,
356  dense.xIonDense[nelem][nelem-ipISO], sum_atom_iso,
357  iso_sp[ipISO][nelem].st[0].Pop());
358  if (lgJustAssert)
359  {
360  ASSERT(fp_equal(renorm,1.0));
361  return;
362  }
363  if (conv.lgConvIoniz() && dense.xIonDense[nelem][nelem-ipISO] > SMALLFLOAT &&
364  fabs(renorm - 1.0) > conv.IonizErrorAllowed)
365  {
366  conv.setConvIonizFail( "Iso vs. ion",
367  dense.xIonDense[nelem][nelem-ipISO],
368  sum_atom_iso);
369  //fprintf(ioQQQ,"%g %g %g\n",renorm-1.0,sum_atom_iso,dense.xIonDense[nelem][nelem-ipISO]);
370  }
371 
372  /*fprintf(ioQQQ,"DEBUG renorm\t%.2f\t%.3e\n",fnzone, renorm);*/
373 
374  //ASSERT( renorm < BIGFLOAT );
375  /* renormalize populations from iso-model atom so that they agree with ion solver & chemistry */
376  /*fprintf(ioQQQ,"DEBUG h \t%.3e hydrogenic renorm %.3e\n",
377  iso_sp[ipH_LIKE][nelem].st[ipH1s].Pop ,
378  iso_sp[ipH_LIKE][nelem].st[ipH1s].Pop/renorm );*/
379 
380  for( long ipHi=0; ipHi < iso_sp[ipISO][nelem].numLevels_local; ipHi++ )
381  {
382  iso_sp[ipISO][nelem].st[ipHi].Pop() *= renorm;
383  }
384 
385  /* >> chng 06 aug 31, from numLevels_max to _local */
386  for( long ipHi=0; ipHi < iso_sp[ipISO][nelem].numLevels_local; ipHi++ )
387  {
388  for( long ipLo=0; ipLo < ipHi; ipLo++ )
389  {
390  if( iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().Aul() <= iso_ctrl.SmallA )
391  continue;
392 
393  /* population of lower level rel to ion, corrected for stim em */
394  iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().PopOpc() *= renorm;
395  }
396  }
397 
398  return;
399 }
400 
401 void iso_departure_coefficients( long ipISO, long nelem )
402 {
403  DEBUG_ENTRY( "iso_departure_coefficients()" );
404 
405  for( long level=0; level < iso_sp[ipISO][nelem].numLevels_local; level++ )
406  {
407  double denom = dense.xIonDense[nelem][nelem+1-ipISO]*
408  iso_sp[ipISO][nelem].fb[level].PopLTE*dense.eden;
409 
410  if( iso_sp[ipISO][nelem].fb[level].PopLTE > 0. && denom > SMALLFLOAT )
411  iso_sp[ipISO][nelem].st[level].DepartCoef() = safe_div(
412  iso_sp[ipISO][nelem].st[level].Pop(), denom );
413  else
414  iso_sp[ipISO][nelem].st[level].DepartCoef() = 0.;
415  }
416 
417  // These are levels above the lowered continuum. They are in equilibrium with the electron bath.
418  for( long level=iso_sp[ipISO][nelem].numLevels_local; level < iso_sp[ipISO][nelem].numLevels_max; level++ )
419  iso_sp[ipISO][nelem].st[level].DepartCoef() = 1.;
420 
421  return;
422 }
423 
424 /*iso_prt_pops print out iso sequence populations or departure coefficients */
425 void iso_prt_pops( long ipISO, long nelem, bool lgPrtDeparCoef )
426 {
427  long int in, il, is, i, ipLo, nResolved, ipFirstCollapsed=LONG_MIN;
428  char chPrtType[2][12]={"populations","departure"};
429  /* first dimension is multiplicity */
430  char chSpin[3][9]= {"singlets", "doublets", "triplets"};
431 
432 #define ITEM_TO_PRINT(A_) ( lgPrtDeparCoef ? iso_sp[ipISO][nelem].st[A_].DepartCoef() : iso_sp[ipISO][nelem].st[A_].Pop() )
433 
434  DEBUG_ENTRY( "iso_prt_pops()" );
435 
436  ASSERT( ipISO < NISO );
437 
438  for( is = 1; is<=3; ++is)
439  {
440  if( ipISO == ipH_LIKE && is != 2 )
441  continue;
442  else if( ipISO == ipHE_LIKE && is != 1 && is != 3 )
443  continue;
444 
445  ipFirstCollapsed= iso_sp[ipISO][nelem].numLevels_local-iso_sp[ipISO][nelem].nCollapsed_local;
446  nResolved = iso_sp[ipISO][nelem].st[ipFirstCollapsed-1].n();
447  ASSERT( nResolved == iso_sp[ipISO][nelem].n_HighestResolved_local );
448  ASSERT(nResolved > 0 );
449 
450  /* give element number and spin */
451  fprintf(ioQQQ," %s %s %s %s\n",
452  iso_ctrl.chISO[ipISO],
453  elementnames.chElementSym[nelem],
454  chSpin[is-1],
455  chPrtType[lgPrtDeparCoef]);
456 
457  /* header with the l states */
458  fprintf(ioQQQ," n\\l=> ");
459  for( i =0; i < nResolved; ++i)
460  {
461  fprintf(ioQQQ,"%2ld ",i);
462  }
463  fprintf(ioQQQ,"\n");
464 
465  /* loop over prin quant numbers, one per line, with l across */
466  for( in = 1; in <= nResolved; ++in)
467  {
468  if( is==3 && in==1 )
469  continue;
470 
471  fprintf(ioQQQ," %2ld ",in);
472 
473  for( il = 0; il < in; ++il)
474  {
475  if( ipISO==ipHE_LIKE && (in==2) && (il==1) && (is==3) )
476  {
477  fprintf( ioQQQ, "%9.3e ", ITEM_TO_PRINT(ipHe2p3P0) );
478  fprintf( ioQQQ, "%9.3e ", ITEM_TO_PRINT(ipHe2p3P1) );
479  fprintf( ioQQQ, "%9.3e ", ITEM_TO_PRINT(ipHe2p3P2) );
480  }
481  else
482  {
483  ipLo = iso_sp[ipISO][nelem].QuantumNumbers2Index[in][il][is];
484  fprintf( ioQQQ, "%9.3e ", ITEM_TO_PRINT(ipLo) );
485  }
486  }
487  fprintf(ioQQQ,"\n");
488  }
489  }
490  /* above loop was over spin, now do collapsed levels, no spin or ang momen */
491  for( il = ipFirstCollapsed; il < iso_sp[ipISO][nelem].numLevels_local; ++il)
492  {
493  in = iso_sp[ipISO][nelem].st[il].n();
494  /* prin quan number of collapsed levels */
495  fprintf(ioQQQ," %2ld ",in);
496  fprintf( ioQQQ, "%9.3e ", ITEM_TO_PRINT(il) );
497  fprintf(ioQQQ,"\n");
498  }
499  return;
500 }
501 
502 /* routine to save table needed for AGN3 - collision strengths of HeI */
503 void AGN_He1_CS( FILE *ioPun )
504 {
505 
506  long int i;
507 
508  /* list of temperatures where cs will be printed */
509  const int NTE = 5;
510  double TeList[NTE] = {6000.,10000.,15000.,20000.,25000.};
511  double TempSave;
512 
513  DEBUG_ENTRY( "AGN_He1_CS()" );
514 
515  /* put on a header */
516  fprintf(ioPun, "Te\t2 3s 33s\n");
517 
518  /* Restore the original temp when this routine done. */
519  TempSave = phycon.te;
520 
521  for( i=0; i<NTE; ++i )
522  {
523  TempChange(TeList[i] , false);
524 
525  fprintf(ioPun , "%.0f\t",
526  TeList[i] );
527  fprintf(ioPun , "%.2f\t",
529  fprintf(ioPun , "%.2f\t",
531  fprintf(ioPun , "%.2f\t",
533  fprintf(ioPun , "%.3f\t",
535  /*fprintf(ioPun , "%.1f\t%.1f\t%.1f\n", */
536  fprintf(ioPun , "%.1f\n",
540  }
541 
542  /* no need to force update since didn't do above */
543  TempChange(TempSave , false);
544  return;
545 }
void AGN_He1_CS(FILE *ioPun)
Definition: iso_solve.cpp:503
double H2_Solomon_dissoc_rate_used_H2g
Definition: hmi.h:103
t_atmdat atmdat
Definition: atmdat.cpp:6
bool lgContinuumLoweringEnabled[NISO]
Definition: iso.h:378
qList st
Definition: iso.h:482
const int ipHE_LIKE
Definition: iso.h:65
void iso_continuum_lower(long ipISO, long nelem)
realnum H_ion_frac_collis
Definition: hydrogenic.h:126
double EdenHCorr
Definition: dense.h:227
realnum pop2mx
Definition: hydrogenic.h:89
const realnum SMALLFLOAT
Definition: cpu.h:246
t_isoCTRL iso_ctrl
Definition: iso.cpp:9
realnum SetIoniz[LIMELM][LIMELM+1]
Definition: dense.h:172
const int NISO
Definition: cddefines.h:311
const int ipHe2p3P1
Definition: iso.h:49
const int ipHe3d3D
Definition: iso.h:57
const int ipHe2p3P0
Definition: iso.h:48
long int IonHigh[LIMELM+1]
Definition: dense.h:130
const int ipHe2s3S
Definition: iso.h:46
const double SMALLDOUBLE
Definition: cpu.h:250
long int nCollapsed_max
Definition: iso.h:518
void ion_solver(long int nelem, bool lgPrintIt)
Definition: ion_solver.cpp:59
t_conv conv
Definition: conv.cpp:5
t_phycon phycon
Definition: phycon.cpp:6
double H2_Solomon_dissoc_rate_BD96_H2g
Definition: hmi.h:106
const int ipHe3p3P
Definition: iso.h:56
bool lgSetIoniz[LIMELM]
Definition: dense.h:167
FILE * ioQQQ
Definition: cddefines.cpp:7
molezone * findspecieslocal(const char buf[])
long int nzone
Definition: cddefines.cpp:14
void iso_radiative_recomb_effective(long ipISO, long nelem)
bool lgRandErrGen[NISO]
Definition: iso.h:430
bool lgConvIoniz() const
Definition: conv.h:108
void iso_photo(long ipISO, long nelem)
vector< freeBound > fb
Definition: iso.h:481
#define MIN2(a, b)
Definition: cddefines.h:803
void TempChange(double TempNew, bool lgForceUpdate)
Definition: temp_change.cpp:32
realnum HeCSInterp(long nelem, long ipHi, long ipLo, long Collider)
Definition: helike_cs.cpp:390
double H2_Solomon_dissoc_rate_TH85_H2g
Definition: hmi.h:104
t_dense dense
Definition: global.cpp:15
double ** RateRecomIso
Definition: ionbal.h:197
t_elementnames elementnames
Definition: elementnames.cpp:5
t_iso_sp iso_sp[NISO][LIMELM]
Definition: iso.cpp:11
realnum SmallA
Definition: iso.h:391
void iso_collapsed_lifetimes_update(long ipISO, long nelem)
double ** RateRecomTot
Definition: ionbal.h:194
double xIonDense[LIMELM][LIMELM+1]
Definition: dense.h:135
double CharExcIonTotal[NCX]
Definition: atmdat.h:310
t_trace trace
Definition: trace.cpp:5
bool fp_equal(sys_float x, sys_float y, int n=3)
Definition: cddefines.h:854
void iso_collapsed_update(void)
Definition: iso_solve.cpp:26
t_ionbal ionbal
Definition: ionbal.cpp:8
ColliderList colliders(dense)
vector< two_photon > TwoNu
Definition: iso.h:598
long int IonLow[LIMELM+1]
Definition: dense.h:129
double * Boltzmann()
Definition: quantumstate.h:149
const int ipH1s
Definition: iso.h:29
long int nPres2Ioniz
Definition: conv.h:145
realnum sec2total
Definition: secondaries.h:39
bool lgTrace
Definition: trace.h:12
void iso_departure_coefficients(long ipISO, long nelem)
Definition: iso_solve.cpp:401
EmissionList::reference Emis() const
Definition: transition.h:447
void iso_error_generation(long ipISO, long nelem)
Definition: iso_error.cpp:39
const char * chISO[NISO]
Definition: iso.h:348
t_rfield rfield
Definition: rfield.cpp:9
float realnum
Definition: cddefines.h:124
realnum IonizErrorAllowed
Definition: conv.h:276
t_hydro hydro
Definition: hydrogenic.cpp:5
const int ipHe3s3S
Definition: iso.h:54
const int ipRecRad
Definition: cddefines.h:333
void iso_radiative_recomb(long ipISO, long nelem)
void iso_collapsed_Aul_update(long ipISO, long nelem)
sys_float safe_div(sys_float x, sys_float y, sys_float res_0by0)
Definition: cddefines.h:1011
realnum H_ion_frac_photo
Definition: hydrogenic.h:120
void CalcTwoPhotonRates(two_photon &tnu, bool lgDoInduced)
Definition: two_photon.cpp:84
void iso_solve(long ipISO, long nelem, double &maxerr)
Definition: iso_solve.cpp:99
multi_arr< long, 3 > QuantumNumbers2Index
Definition: iso.h:490
void iso_update_rates(void)
Definition: iso_solve.cpp:48
long int nTotalIoniz
Definition: conv.h:159
bool lgElmtOn[LIMELM]
Definition: dense.h:160
TransitionProxy trans(const long ipHi, const long ipLo)
Definition: iso.h:473
Definition: iso.h:470
char chElementSym[LIMELM][CHARS_ELEMENT_SYM]
Definition: elementnames.h:25
int nLyaLevel[NISO]
Definition: iso.h:397
bool lgInd2nu_On
Definition: iso.h:375
const int ipH2p
Definition: iso.h:31
#define ASSERT(exp)
Definition: cddefines.h:613
const int ipH_LIKE
Definition: iso.h:64
const int LIMELM
Definition: cddefines.h:308
T pow2(T a)
Definition: cddefines.h:981
const int ipHe2p3P2
Definition: iso.h:50
CollisionProxy Coll() const
Definition: transition.h:463
double & mult_opac() const
Definition: emission.h:660
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:723
double & PopOpc() const
Definition: emission.h:670
const int ipHELIUM
Definition: cddefines.h:350
void iso_cascade(long ipISO, long nelem)
double H2_total
Definition: hmi.h:25
#define ITEM_TO_PRINT(A_)
double eden
Definition: dense.h:201
double HIonFrac
Definition: atmdat.h:314
void iso_renorm(long nelem, long ipISO, double &renorm)
Definition: iso_solve.cpp:310
void IonHydro()
Definition: iso_solve.cpp:187
bool lgHiPop2
Definition: hydrogenic.h:88
#define MAX2(a, b)
Definition: cddefines.h:824
bool lgInducProcess
Definition: rfield.h:233
int fprintf(const Output &stream, const char *format,...)
Definition: service.cpp:1121
realnum ** csupra
Definition: secondaries.h:33
void setConvIonizFail(const char *reason, double oldval, double newval)
Definition: conv.h:100
#define S(I_, J_)
long int numLevels_max
Definition: iso.h:524
void HydroLevel(long ipISO, long int ipZ)
void iso_prt_pops(long ipISO, long nelem, bool lgPrtDeparCoef)
Definition: iso_solve.cpp:425
#define fixit(a)
Definition: cddefines.h:417
t_secondaries secondaries
Definition: secondaries.cpp:5
t_hmi hmi
Definition: hmi.cpp:5
double fnzone
Definition: cddefines.cpp:15
void PrintE82(FILE *, double)
Definition: service.cpp:824
double te
Definition: phycon.h:21
const int ipHe3d1D
Definition: iso.h:58
const int ipHYDROGEN
Definition: cddefines.h:349
realnum & Aul() const
Definition: emission.h:690
void iso_ionize_recombine(long ipISO, long nelem)
void iso_collide(long ipISO, long nelem)
long int numLevels_local
Definition: iso.h:529
long int nCollapsed_local
Definition: iso.h:519
double ColUL(const ColliderList &colls) const
Definition: collision.h:106
void iso_level(const long ipISO, const long nelem, double &renorm, bool lgPrtMatrix)
bool lgErrGenDone
Definition: iso.h:591