25 STATIC double iso_get_collision_strength_collapsed_to_collapsed(
long ipISO,
long nelem,
long ipCollider,
26 long nHi,
double IP_Ryd_Hi,
27 long nLo,
double IP_Ryd_Lo,
28 double Aul,
double tauLo,
double EnerWN,
double EnerErg );
31 long nHi,
double IP_Ryd_Hi,
32 long nLo,
long lLo,
long sLo,
long jLo,
long gLo,
double IP_Ryd_Lo,
33 double Aul,
double tauLo,
double EnerWN,
double EnerErg );
35 long nHi,
long lHi,
long sHi,
long jHi,
long gHi,
double IP_Ryd_Hi,
36 long nLo,
long lLo,
long sLo,
long jLo,
long gLo,
double IP_Ryd_Lo,
37 double Aul,
double tauLo,
double EnerWN,
double EnerErg,
const char **where );
40 long nHi,
long gHi,
double IP_Ryd_Hi,
41 long nLo,
double IP_Ryd_Lo,
42 double tauLo,
double EnerWN,
double EnerErg );
73 sp->
fb[ipHi].ColIoniz =
154 {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0},
155 {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0} };
174 " iso_collide called %s nelem %li - no reeval Boltz fac, LTE dens\n",
185 " iso_collide called %s nelem %li - will reeval Boltz fac, LTE dens\n",
231 sp->
fb[ipLo].PopLTE =
232 sp->
st[ipLo].g() / sp->
st[ipLo].
ConBoltz() * ConvLTEPOP;
237 sp->
fb[ipLo].PopLTE = 0.;
240 sp->
fb[ipLo].PopLTE =
MIN2( sp->
fb[ipLo].PopLTE, MAX_POP_LTE );
243 if( sp->
fb[ipLo].PopLTE <= 0. )
259 vector<double> ratefac(
ipALPHA+1);
264 ratefac[ipCollider] =
powpq(ELECTRON_MASS/reduced_mass_collider_system,3,2) * COLL_CONST/
phycon.
sqrte;
269 double overHig = 1./(double)sp->
st[ipHi].g();
270 for(
long ipLo=0; ipLo < ipHi; ipLo++ )
280 double rateCoef = cs_temp * ratefac[ipCollider] * overHig;
289 if(
N_(ipHi) <= 5 &&
N_(ipLo) <= 2 )
301 for(
long ipHi=1; ipHi < upper_limit; ipHi++ )
304 for(
long ipLo=0; ipLo < ipHi; ipLo++ )
313 for(
long ipHi=0; ipHi < upper_limit; ipHi++ )
320 for(
long ipHi=0; ipHi < upper_limit; ipHi++ )
327 for(
long ipHi=0; ipHi < upper_limit; ipHi++ )
343 sp->
fb[ipLo].ColIoniz = 0.;
348 if(
N_(ipLo)==2 &&
N_(ipHi)==2 )
379 long nHi = sp->
st[ipHi].n();
380 long lHi = sp->
st[ipHi].l();
381 long sHi = sp->
st[ipHi].S();
382 long jHi = sp->
st[ipHi].j();
383 long gHi = sp->
st[ipHi].g();
384 double IP_Ryd_Hi = sp->
fb[ipHi].xIsoLevNIonRyd;
385 long nLo = sp->
st[ipLo].n();
386 long lLo = sp->
st[ipLo].l();
387 long sLo = sp->
st[ipLo].S();
388 long jLo = sp->
st[ipLo].j();
389 long gLo = sp->
st[ipLo].g();
390 double IP_Ryd_Lo = sp->
fb[ipLo].xIsoLevNIonRyd;
393 double tauLo = sp->
st[ipHi].lifetime();
402 else if( nHi-nLo > 2 && ipCollider >
ipELECTRON )
411 tauLo, EnerWN, EnerErg );
413 cs = iso_get_collision_strength_collapsed_to_collapsed( ipISO, nelem, ipCollider,
416 Aul, tauLo, EnerWN, EnerErg );
424 nLo, lLo, sLo, jLo, gLo, IP_Ryd_Lo,
425 Aul, tauLo, EnerWN, EnerErg );
429 const char *where =
" ";
431 nHi, lHi, sHi, jHi, gHi, IP_Ryd_Hi,
432 nLo, lLo, sLo, jLo, gLo, IP_Ryd_Lo,
433 Aul, tauLo, EnerWN, EnerErg, &where );
442 (
GetGF(Aul_hydro, EnerWN, 2.*nHi*nHi)/(2.*nLo*nLo) );
448 double oHi=1./(double)gHi;
450 if ( nelem == 1 && ipISO == 1 && nHi == nLo+1 && nHi < 200 && (ipCollider ==
ipELECTRON ))
454 double ratef =
powpq(ELECTRON_MASS/reduced_mass_collider_system,3,2) * COLL_CONST/
phycon.
sqrte;
456 rate_test = cs*ratef*oHi;
458 fprintf(
ioQQQ,
"Rates for H %ld %ld %ld %ld %ld %ld %ld %ld %ld %g: %g %g \n",
459 nHi, nLo,lLo,lHi,sLo,sHi,jLo,jHi,nelem,
phycon.
te,rate_test,
dense.
eden);
469 long nHi,
long gHi,
double IP_Ryd_Hi,
470 long nLo,
double IP_Ryd_Lo,
471 double tauLo,
double EnerWN,
double EnerErg )
473 DEBUG_ENTRY(
"iso_get_collision_strength_collapsed_to_collapsed_fast()" );
480 double Aul_total = 0.;
482 for(
long lLo = 0; lLo < nLo; ++lLo )
494 g_nHi = (2*(lLo-1)+1)*sHi;
499 g_nHi = (2*(lLo+1)+1)*sHi;
511 g_nHi = (2*(lLo-1)+1)*sHi;
516 g_nHi = (2*(lLo+1)+1)*sHi;
525 g_nLo = (2 *
POW2(nLo));
526 factor = (nHi - 1) * g_nLo;
530 g_nLo = (4 *
POW2(nLo));
531 factor = (2 * nHi - 2) * g_nLo;
536 const char *where =
" ";
539 nHi, -1, -1, -1, 1, IP_Ryd_Hi,
540 nLo, -1, -1, -1, 1, IP_Ryd_Lo,
541 Aul_total/nAul, tauLo, EnerWN, EnerErg, &where );
545 nHi, -1, -1, -1, 1, IP_Ryd_Hi,
546 nLo, -1, -1, -1, 1, IP_Ryd_Lo,
547 Aul_total/nAul, tauLo, EnerWN, EnerErg, &where );
549 if ( strcmp(where,
"Vriens") == 0 || strcmp(where,
"PR78 ") == 0)
555 nHi, -1, -1, -1, 1, IP_Ryd_Hi,
556 nLo, -1, -1, -1, 1, IP_Ryd_Lo,
566 STATIC double iso_get_collision_strength_collapsed_to_collapsed(
long ipISO,
long nelem,
long ipCollider,
567 long nHi,
double IP_Ryd_Hi,
568 long nLo,
double IP_Ryd_Lo,
569 double Aul,
double tauLo,
double EnerWN,
double EnerErg )
571 DEBUG_ENTRY(
"iso_get_collision_strength_collapsed_to_collapsed()" );
576 vector<long> ang_mom_lo;
577 for(
long i = 0; i < nLo; ++i )
578 ang_mom_lo.push_back( i );
581 for( vector<long>::iterator itLo = ang_mom_lo.begin(); itLo != ang_mom_lo.end(); ++itLo )
590 long gLo = (2*lLo+1) * sLo;
593 nLo, lLo, sLo, jLo, gLo, IP_Ryd_Lo,
594 Aul, tauLo, EnerWN, EnerErg );
601 long gLo = (2*lLo+1) * sLo;
604 nLo, lLo, sLo, jLo, gLo, IP_Ryd_Lo,
605 Aul, tauLo, EnerWN, EnerErg );
615 long nHi,
double IP_Ryd_Hi,
616 long nLo,
long lLo,
long sLo,
long jLo,
long gLo,
double IP_Ryd_Lo,
617 double Aul,
double tauLo,
double EnerWN,
double EnerErg )
619 DEBUG_ENTRY(
"iso_get_collision_strength_collapsed_to_resolved()" );
630 ASSERT( lLo >= 0 && lLo < nLo );
634 if( (nLo==2) && (lLo==1) && (sLo==3) )
636 ASSERT( (jLo>=0) && (jLo<=2) );
637 ipLoRes -= (2 - jLo);
640 double cs_less_1 = 0.;
641 const char *where =
" ";
645 gHi = (2*lHi+1) * sHi;
648 nHi, lHi, sHi, jHi, gHi, IP_Ryd_Hi,
649 nLo, lLo, sLo, jLo, gLo, IP_Ryd_Lo,
650 Aul, tauLo, EnerWN, EnerErg, &where );
654 gHi = (2*lHi+1) * sHi;
657 nHi, lHi, sHi, jHi, gHi, IP_Ryd_Hi,
658 nLo, lLo, sLo, jLo, gLo, IP_Ryd_Lo,
659 Aul, tauLo, EnerWN, EnerErg, &where );
663 else if( lLo+2 < nHi )
672 nHi, lHi, sHi, jHi, gHi, IP_Ryd_Hi,
673 nLo, lLo, sLo, jLo, gLo, IP_Ryd_Lo,
674 Aul, tauLo, EnerWN, EnerErg, &where );
682 cs = cs_less_1 + cs_plus_1 + factor * cs_other;
688 long nHi,
long lHi,
long sHi,
long jHi,
long gHi,
double IP_Ryd_Hi,
689 long nLo,
long lLo,
long sLo,
long jLo,
long gLo,
double IP_Ryd_Lo,
690 double Aul,
double tauLo,
double EnerWN,
double EnerErg,
const char **where )
692 DEBUG_ENTRY(
"iso_get_collision_strength_resolved()" );
695 const char *wher =
" ";
700 nHi, lHi, sHi, gHi, IP_Ryd_Hi,
701 nLo, lLo, sLo, gLo, IP_Ryd_Lo,
702 tauLo, EnerErg, &wher );
708 nHi, lHi, sHi, jHi, gHi, IP_Ryd_Hi,
709 nLo, lLo, sLo, jLo, gLo, IP_Ryd_Lo,
710 Aul, tauLo, EnerWN, EnerErg, &wher );
STATIC double iso_get_collision_strength(long ipISO, long nelem, long ipCollider, long ipHi, long ipLo)
realnum EnergyErg() const
NORETURN void TotalInsanity(void)
multi_arr< realnum, 3 > CachedAs
bool lgIsoTraceFull[NISO]
double hydro_vs_ioniz(double ionization_energy_Ryd, double Te)
realnum GetHelikeCollisionStrength(long nelem, long Collider, long nHi, long lHi, long sHi, long jHi, long gHi, double IP_Ryd_Hi, long nLo, long lLo, long sLo, long jLo, long gLo, double IP_Ryd_Lo, double Aul, double tauLo, double EnerWN, double EnerErg, const char **where)
STATIC double iso_get_collision_strength_collapsed_to_resolved(long ipISO, long nelem, long ipCollider, long nHi, double IP_Ryd_Hi, long nLo, long lLo, long sLo, long jLo, long gLo, double IP_Ryd_Lo, double Aul, double tauLo, double EnerWN, double EnerErg)
void iso_suprathermal(long ipISO, long nelem)
double coll_ion_wrapper(long int z, long int n, double t)
long int ipIsoTrace[NISO]
bool lgColl_l_mixing[NISO]
void iso_put_error(long ipISO, long nelem, long ipHi, long ipLo, long whichData, realnum errorOpt, realnum errorPess)
double anu(size_t i) const
multi_arr< long, 3 > IndexIfAllResolved
double * rate_coef_ul_set() const
realnum GetHlikeCollisionStrength(long nelem, long ipCollider, long nHi, long lHi, long sHi, long gHi, double IP_Ryd_Hi, long nLo, long lLo, long sLo, long gLo, double IP_Ryd_Lo, double tauLo, double EnerErg, const char **where)
STATIC double iso_get_collision_strength_resolved(long ipISO, long nelem, long ipCollider, long nHi, long lHi, long sHi, long jHi, long gHi, double IP_Ryd_Hi, long nLo, long lLo, long sLo, long jLo, long gLo, double IP_Ryd_Lo, double Aul, double tauLo, double EnerWN, double EnerErg, const char **where)
t_iso_sp iso_sp[NISO][LIMELM]
void vexp(const double x[], double y[], long nlo, long nhi)
bool fp_equal(sys_float x, sys_float y, int n=3)
ColliderList colliders(dense)
long int n_HighestResolved_max
realnum & EnergyWN() const
EmissionList::reference Emis() const
void iso_collisional_ionization(long ipISO, long nelem)
TransitionProxy trans(const long ipHi, const long ipLo)
STATIC double iso_get_collision_strength_collapsed_to_collapsed_fast(long ipISO, long nelem, long ipCollider, long nHi, long gHi, double IP_Ryd_Hi, long nLo, double IP_Ryd_Lo, double tauLo, double EnerWN, double EnerErg)
double *** CollIonRate_Ground
realnum AtomicWeight[LIMELM]
double HydroEinstA(long int n1, long int n2)
double GetGF(double trans_prob, double enercm, double gup)
vector< t_collider > list
realnum & col_str() const
CollisionProxy Coll() const
#define DEBUG_ENTRY(funcname)
double powpq(double x, int p, int q)
realnum & rate_lu_nontherm_set() const
const double * rate_coef_ul() const
int fprintf(const Output &stream, const char *format,...)
t_secondaries secondaries
double Hion_coll_ioniz_ratecoef(long int ipISO, long int nelem, long int n, double ionization_energy_Ryd, double Te)
void iso_collide(long ipISO, long nelem)
bool lgCaseB_HummerStorey
double ColUL(const ColliderList &colls) const
long int ipHeavy[LIMELM][LIMELM]