Show
Ignore:
Timestamp:
03/09/08 16:59:05 (10 months ago)
Author:
rjrw
Message:

Minor changes to resulting from trying to chase down differences on
pdf_leiden_f1 --

ion_solver: allow molecule effects in first iteration,
iso_level: defensive programming for z[][]
mole_eval_balance: move some definitions for sp
mole_co_atom: add SDIV (aka fixit...) to prevent FPE in some circumstances

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/newmole/source/ion_solver.cpp

    r1835 r1838  
    378378         * matrix is singular */ 
    379379        totsrc = 0.; 
    380         /*>>chng 06 nov 28 only include source from molecules if we have an estimated first  
    381          * solution - first test is that we have called mole at least twice, 
    382          * second test is that we are on a later iteration */ 
    383         if( conv.nTotalIoniz > 1 || iteration > 1 ) 
    384         { 
    385  
    386                 for( i=0; i<ion_range;i++ ) 
    387                 { 
    388                         ion = i+ion_low; 
    389  
    390                         /* these are the external source and sink terms */ 
    391                         /* need negative sign to get positive pops */ 
    392                         source[i] -= mole.source[nelem][ion]; 
    393                         totsrc += mole.source[nelem][ion]; 
    394                         MAT( xmat, i, i ) -= mole.sink[nelem][ion]; 
    395                 } 
     380 
     381        for( i=0; i<ion_range;i++ ) 
     382        { 
     383                ion = i+ion_low; 
     384                 
     385                /* these are the external source and sink terms */ 
     386                /* need negative sign to get positive pops */ 
     387                source[i] -= mole.source[nelem][ion]; 
     388                totsrc += mole.source[nelem][ion]; 
     389                MAT( xmat, i, i ) -= mole.sink[nelem][ion]; 
    396390        } 
    397391 
     
    10301024                fprintf( ioQQQ, "\n" ); 
    10311025 
     1026                /* grain ionization - not total rate but should be dominant process */ 
     1027                fprintf( ioQQQ, " %s ion xfr mol "  ,elementnames.chElementSym[nelem]); 
     1028                for( ion=0; ion < dense.IonHigh[nelem]; ion++ ) 
     1029                { 
     1030                        fprintf( ioQQQ, " %9.2e", mole.xMoleChTrRate[nelem][ion][ion+1] ); 
     1031                } 
     1032                fprintf( ioQQQ, "\n" ); 
     1033 
    10321034                /* charge exchange ionization */ 
    10331035                fprintf( ioQQQ, " %s chr trn ion " ,elementnames.chElementSym[nelem] ); 
     
    10801082                { 
    10811083                        fprintf( ioQQQ, " %9.2e", gv.GrainChTrRate[nelem][ion+1][ion] ); 
     1084                } 
     1085                fprintf( ioQQQ, "\n" ); 
     1086 
     1087                fprintf( ioQQQ, " %s rec xfr mol "  ,elementnames.chElementSym[nelem]); 
     1088                for( ion=0; ion < dense.IonHigh[nelem]; ion++ ) 
     1089                { 
     1090                        fprintf( ioQQQ, " %9.2e", mole.xMoleChTrRate[nelem][ion+1][ion] ); 
    10821091                } 
    10831092                fprintf( ioQQQ, "\n" );