Show
Ignore:
Timestamp:
05/10/08 09:03:02 (2 months ago)
Author:
peter
Message:

Merging all changes from mainline upto r2033, except r1902.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/c08_branch/source/iso_continuum_lower.cpp

    r1751 r2034  
    2121        ASSERT( ipISO <= 1 ); 
    2222 
    23         if( ipISO == ipH_LIKE ) 
    24                 eff_charge = nelem + 1; 
    25         else 
    26                 eff_charge = nelem; 
     23        eff_charge = nelem + 1 - ipISO; 
    2724 
    2825        /* Particle packing - the density here should be density of all nuclei in the plasma */ 
     
    8380                iso.n_HighestResolved_local[ipISO][nelem] = nc; 
    8481                iso.nCollapsed_local[ipISO][nelem] = 0; 
    85                 if( ipISO == ipH_LIKE ) 
    86                         iso.numLevels_local[ipISO][nelem] = (long)( 0.5 * nc * ( nc + 1 ) ); 
    87                 else if( ipISO ==ipHE_LIKE ) 
    88                         iso.numLevels_local[ipISO][nelem] = nc*nc + nc + 1; 
    89                 else 
    90                         TotalInsanity(); 
     82                iso.numLevels_local[ipISO][nelem] = iso_get_total_num_levels( ipISO, nc, 0 ); 
    9183        } 
    9284        /* Here is the case where the critical n lies among the one or more collapsed levels */ 
     
    9991                iso.n_HighestResolved_local[ipISO][nelem] = iso.n_HighestResolved_max[ipISO][nelem]; 
    10092                iso.nCollapsed_local[ipISO][nelem] = nc - iso.n_HighestResolved_local[ipISO][nelem]; 
    101                 if( ipISO == ipH_LIKE ) 
    102                 { 
    103                         iso.numLevels_local[ipISO][nelem] = (long)(  
    104                                 iso.n_HighestResolved_max[ipISO][nelem] * 0.5 * 
    105                                 ( iso.n_HighestResolved_max[ipISO][nelem] + 1 ) ) + iso.nCollapsed_local[ipISO][nelem]; 
    106                 } 
    107                 else if( ipISO ==ipHE_LIKE ) 
    108                 { 
    109                         iso.numLevels_local[ipISO][nelem] = iso.n_HighestResolved_local[ipISO][nelem]*iso.n_HighestResolved_local[ipISO][nelem] + 
    110                                 iso.n_HighestResolved_local[ipISO][nelem] + 1 + iso.nCollapsed_local[ipISO][nelem]; 
    111                 } 
    112                 else 
    113                         TotalInsanity(); 
     93                iso.numLevels_local[ipISO][nelem] =  
     94                        iso_get_total_num_levels( ipISO, iso.n_HighestResolved_max[ipISO][nelem], iso.nCollapsed_local[ipISO][nelem] ); 
    11495        } 
    11596        /* This is usually where control will flow, because in most conditions the continuum will not be lowered. 
     
    121102                iso.n_HighestResolved_local[ipISO][nelem] = iso.n_HighestResolved_max[ipISO][nelem]; 
    122103                 
    123                 /* if levels were lowered on last past but are not now, must reeval */ 
     104                /* if levels were lowered on last pass but are not now, must reeval */ 
    124105                if( iso.lgLevelsLowered[ipISO][nelem] ) 
    125106                {