Changeset 2089 for branches/newmole/source
- Timestamp:
- 05/20/08 15:56:57 (6 months ago)
- Location:
- branches/newmole/source
- Files:
-
- 3 modified
-
conv_base.cpp (modified) (1 diff)
-
iso_level.cpp (modified) (5 diffs)
-
radius_increment.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/newmole/source/conv_base.cpp
r2023 r2089 608 608 conv.BadConvIoniz[1] = dense.EdenTrue; 609 609 } 610 611 for(long ipISO=ipH_LIKE; ipISO<NISO; ++ipISO ) 612 { 613 for( nelem=ipISO; nelem<LIMELM; ++nelem ) 614 { 615 if( dense.lgElmtOn[nelem] && 616 dense.xIonDense[nelem][nelem-ipISO]/dense.eden>conv.EdenErrorAllowed / 10. && 617 !(iso.chTypeAtomUsed[ipISO][nelem][0]=='L' && 618 iso.xIonSimple[ipISO][nelem]<1e-10) ) 619 { 620 const realnum err_tol = 1e-2; 621 realnum abund = 0.; 622 for (long n=0; n<iso.numLevels_local[ipISO][nelem]; ++n) 623 { 624 abund += StatesElem[ipISO][nelem][n].Pop; 625 } 626 if( conv.lgConvIoniz && iso.pop_ion_ov_neut[ipISO][nelem] > 1e-15 && 627 ! fp_equal_tol(abund*dense.xIonDense[nelem][nelem+1-ipISO],dense.xIonDense[nelem][nelem-ipISO], 628 err_tol*dense.xIonDense[nelem][nelem-ipISO])) 629 { 630 //fprintf(ioQQQ,"Inconsistent iso %ld %ld %ld %g\n",loop_ion,nelem,ipISO, 631 // abund*dense.xIonDense[nelem][nelem+1-ipISO]/SDIV(dense.xIonDense[nelem][nelem-ipISO])-1); 632 conv.lgConvIoniz = false; 633 sprintf( conv.chConvIoniz , "Iso!=ion" ); 634 conv.BadConvIoniz[0] = abund*dense.xIonDense[nelem][nelem+1-ipISO]; 635 conv.BadConvIoniz[1] = dense.xIonDense[nelem][nelem-ipISO]; 636 } 637 } 638 } 639 } 640 610 641 ++loop_ion; 611 642 } -
branches/newmole/source/iso_level.cpp
r2086 r2089 11 11 #include "grainvar.h" 12 12 #include "he.h" 13 #include "heavy.h" 13 14 #include "helike.h" 14 15 #include "hydrogenic.h" … … 23 24 #include "thirdparty.h" 24 25 #include "trace.h" 26 #include "yield.h" 25 27 26 28 /* solve for level populations */ … … 334 336 } 335 337 338 #if 0 336 339 for( long ion=0; ion<=nelem+1; ++ion ) 337 340 { … … 364 367 } 365 368 369 for(long ion=dense.IonHigh[nelem]; ion < nelem-NISO; ion++ ) 370 { 371 for(long ns=0; ns < Heavy.nsShells[nelem][ion]; ns++ ) 372 { 373 for(long nej=1; nej <= t_yield::Inst().nelec_eject(nelem,ion,ns); nej++ ) 374 { 375 long IonProduced = MIN2(ion+nej,dense.IonHigh[nelem]); 376 if (nelem-NISO == IonProduced) 377 { 378 source += ionbal.PhotoRate_Shell[nelem][ion][ns][0]* 379 t_yield::Inst().elec_eject_frac(nelem,ion,ns,nej-1); 380 } 381 } 382 } 383 } 384 385 #endif 386 366 387 if( nelem-ipISO >= 1 && ionbal.RateIonizTot[nelem][nelem-ipISO-1] > 0.) 367 388 { … … 373 394 sink += ionbal.RateRecomTot[nelem][nelem-ipISO-1]; 374 395 } 375 396 376 397 creation[0] += source/SDIV(dense.xIonDense[nelem][nelem+1-ipISO]); 377 398 for( level=0; level < numlevels_local; level++ ) -
branches/newmole/source/radius_increment.cpp
r2086 r2089 105 105 * change is to only do this branch if abundance is large enough to be detected by 106 106 * the ionization convergence solvers */ 107 const realnum err_tol = 1e- 3;107 const realnum err_tol = 1e-2; 108 108 /* >>chng 05 sep 02, when low-T solver used solution is approximate, 109 109 * and it must not matter (lot-T solver should not be used if it … … 116 116 abund += StatesElem[ipISO][nelem][n].Pop; 117 117 } 118 //fprintf(ioQQQ,"%.2f %ld %ld %11.4g %11.4g\n",fnzone,ipISO,nelem, 119 // abund*dense.xIonDense[nelem][nelem+1-ipISO]/SDIV(dense.xIonDense[nelem][nelem-ipISO])-1, 120 // dense.xIonDense[nelem][nelem-ipISO]); 118 121 /* make sure that populations are valid, first check Pop2Ion */ 119 122 if( iso.pop_ion_ov_neut[ipISO][nelem] > 1e-15 &&
