Changeset 1988

Show
Ignore:
Timestamp:
04/29/08 14:19:04 (2 weeks ago)
Author:
gary
Message:

assert_results.cpp - print dashes in individual Case B line assert to see relative error, as in final set of asserts

rt_line_one.cpp - when Case B in place do not assert that damping constant is greater than 0, only that it is not negative

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/source/assert_results.cpp

    r1970 r1988  
    19241924                        if( nISOCaseB == ipH_LIKE ) 
    19251925                        { 
    1926                                 fprintf(ioQQQ,"        Species  nHi nLo  Wl  Computed  Asserted       error\n"); 
     1926                                fprintf(ioQQQ,"                Species  nHi nLo  Wl  Computed  Asserted       error\n"); 
    19271927                                /* limit of 10 is because that is all we printed and saved in prt_lines_hydro */ 
    19281928                                for( long int ipLo=1+iCase; ipLo< MIN2(10,nHighestPrinted-1); ++ipLo ) 
     
    19461946                                                        absint = pow( 10., absint ); 
    19471947                                                        error = (CBabsint - absint)/MAX2(CBabsint , absint); 
    1948                                                         fprintf(ioQQQ,"ChkAssert %s %3li %3li ",  
     1948                                                        double RelativeError = fabs(error) / AssertError[i]; 
     1949                                                        /* start of line, flag problems */ 
     1950                                                        if( RelativeError < 1. ) 
     1951                                                        { 
     1952                                                                if( RelativeError < 0.25 ) 
     1953                                                                { 
     1954                                                                        fprintf( ioASSERT, " ChkAssert        "); 
     1955                                                                } 
     1956                                                                else if( RelativeError < 0.50 ) 
     1957                                                                { 
     1958                                                                        fprintf( ioASSERT, " ChkAssert -      "); 
     1959                                                                } 
     1960                                                                else if( RelativeError < 0.75 ) 
     1961                                                                { 
     1962                                                                        fprintf( ioASSERT, " ChkAssert --     "); 
     1963                                                                } 
     1964                                                                else if( RelativeError < 0.90 ) 
     1965                                                                { 
     1966                                                                        fprintf( ioASSERT, " ChkAssert ---    "); 
     1967                                                                } 
     1968                                                                else  if( RelativeError < 0.95 ) 
     1969                                                                { 
     1970                                                                        fprintf( ioASSERT, " ChkAssert ----   "); 
     1971                                                                } 
     1972                                                                else  if( RelativeError < 0.98 ) 
     1973                                                                { 
     1974                                                                        fprintf( ioASSERT, " ChkAssert -----  "); 
     1975                                                                } 
     1976                                                                else  
     1977                                                                { 
     1978                                                                        fprintf( ioASSERT, " ChkAssert ------ "); 
     1979                                                                } 
     1980 
     1981                                                        } 
     1982                                                        else 
     1983                                                        { 
     1984                                                                fprintf( ioASSERT, " ChkAssert botch>>"); 
     1985                                                        } 
     1986                                                        fprintf(ioQQQ," %s %3li %3li ",  
    19491987                                                                chElemLabelCaseB , ipHi , ipLo ); 
    19501988                                                        prt_wl(ioQQQ, wl ); 
     
    19732011                        else if( nISOCaseB == ipHE_LIKE ) 
    19742012                        { 
     2013                                if( !dense.lgElmtOn[ipHELIUM] ) 
     2014                                { 
     2015                                        fprintf(ioQQQ,"DISASTER assert case B for a He is requested but He is not " 
     2016                                                "included.\n"); 
     2017                                        fprintf(ioQQQ,"Do not turn off He is you want to assert its spectrum.\n"); 
     2018                                        cdEXIT(EXIT_FAILURE); 
     2019                                } 
    19752020#                               define N_CASEB_HEI      11 
    19762021                                realnum CaseBWlHeI[N_CASEB_HEI]= 
     
    19782023                                4026.f, 6678.f, 4922.f }; 
    19792024                                /* do He I as special case */ 
    1980                                 fprintf(ioQQQ,"        Species   Wl  Computed  Asserted       error\n"); 
     2025                                fprintf(ioQQQ,"                     Wl  Computed  Asserted       error\n"); 
    19812026                                for( long int ipLine=0; ipLine< N_CASEB_HEI ; ++ipLine ) 
    19822027                                { 
     
    19912036                                                absint = pow( 10., absint ); 
    19922037                                                error = (CBabsint - absint)/MAX2(CBabsint , absint); 
    1993                                                 fprintf(ioQQQ,"ChkAssert %s ",  
    1994                                                         chElemLabelCaseB ); 
     2038                                                double RelativeError = fabs(error) / AssertError[i]; 
     2039                                                /* start of line, flag problems */ 
     2040                                                if( RelativeError < 1. ) 
     2041                                                { 
     2042                                                        if( RelativeError < 0.25 ) 
     2043                                                        { 
     2044                                                                fprintf( ioASSERT, " ChkAssert        "); 
     2045                                                        } 
     2046                                                        else if( RelativeError < 0.50 ) 
     2047                                                        { 
     2048                                                                fprintf( ioASSERT, " ChkAssert -      "); 
     2049                                                        } 
     2050                                                        else if( RelativeError < 0.75 ) 
     2051                                                        { 
     2052                                                                fprintf( ioASSERT, " ChkAssert --     "); 
     2053                                                        } 
     2054                                                        else if( RelativeError < 0.90 ) 
     2055                                                        { 
     2056                                                                fprintf( ioASSERT, " ChkAssert ---    "); 
     2057                                                        } 
     2058                                                        else  if( RelativeError < 0.95 ) 
     2059                                                        { 
     2060                                                                fprintf( ioASSERT, " ChkAssert ----   "); 
     2061                                                        } 
     2062                                                        else  if( RelativeError < 0.98 ) 
     2063                                                        { 
     2064                                                                fprintf( ioASSERT, " ChkAssert -----  "); 
     2065                                                        } 
     2066                                                        else  
     2067                                                        { 
     2068                                                                fprintf( ioASSERT, " ChkAssert ------ "); 
     2069                                                        } 
     2070 
     2071                                                } 
     2072                                                else 
     2073                                                { 
     2074                                                        fprintf( ioASSERT, " ChkAssert botch>>"); 
     2075                                                } 
    19952076                                                prt_wl(ioQQQ, wl ); 
    19962077                                                fprintf(ioQQQ," %.2e %.2e %10.3f",  
  • trunk/source/rt_line_one.cpp

    r1987 r1988  
    294294                fprintf(ioQQQ,"DEBUG hit it \n"); 
    295295        }*/ 
    296         ASSERT( t->Emis->damp >= 0. ); 
     296        ASSERT( t->Emis->damp > 0. ||  
     297                        (opac.lgCaseB && t->Emis->damp >= 0.) ); 
    297298 
    298299        /* static solution - which type of line will determine