Changeset 2133

Show
Ignore:
Timestamp:
06/27/08 06:20:29 (2 months ago)
Author:
gary
Message:

these implement two additional command line options for time dependent simulations

print lines cumulative - will print time-integrated spectrum in addition to spectrum for every time step

stop temperature xxx time
iterations/time steps will stop then the temperature of the last zone falls below the number. intended for stopping cals of single cell of cooling gas.

Location:
trunk/source
Files:
13 modified

Legend:

Unmodified
Added
Removed
  • trunk/source/abundances.cpp

    r2127 r2133  
    263263        /* if stop temp set below default then we are going into cold and possibly  
    264264         * molecular gas - check some parameters in this case */ 
    265         if( called.lgTalk && (StopCalc.tend < phycon.TEMP_STOP_DEFAULT ||  
     265        if( called.lgTalk && (StopCalc.TempLoStopZone < phycon.TEMP_STOP_DEFAULT ||  
    266266                /* thermal.ConstTemp def is zero, set pos when used */ 
    267267                (thermal.ConstTemp > 0. && thermal.ConstTemp < phycon.TEMP_STOP_DEFAULT ) ) ) 
  • trunk/source/conv_itercheck.cpp

    r1732 r2133  
    210210                /* >>chng 96 dec 20, moved following to within if on lgAutoIt 
    211211                 * this is test for stopping on first zone */ 
    212                 if( phycon.te < StopCalc.tend && nzone == 1 ) 
     212                if( phycon.te < StopCalc.TempLoStopZone && nzone == 1 ) 
    213213                { 
    214214                        lgConverged = true; 
  • trunk/source/dynamics.cpp

    r2119 r2133  
    2323#include "radius.h" 
    2424#include "thirdparty.h" 
     25#include "stopcalc.h" 
    2526#include "hextra.h" 
    2627#include "rfield.h" 
     
    13641365                        } 
    13651366 
     1367                        /* stop lowest temperature time command */ 
     1368                        if( (phycon.te < StopCalc.TempLoStopIteration) || 
     1369                                (phycon.te > StopCalc.TempHiStopIteration ) ) 
     1370                                dynamics.lgStatic_completed = true; 
     1371 
    13661372                        if( dynamics.time_elapsed < time_elapsed_time[0] ) 
    13671373                        { 
  • trunk/source/init_defaults_preparse.cpp

    r2062 r2133  
    317317        prt.lgSurfaceBrightness = false; 
    318318        prt.lgSurfaceBrightness_SR = true; 
     319 
     320        /* print line cumulative sets true, print integrated line intensity over 
     321         * time in temp dependent simulation */ 
     322        prt.lgPrintLineCumulative = false; 
    319323 
    320324        prt.nzdump = -100; 
     
    384388        StopCalc.AV_point = 1e30f; 
    385389        /* highest allowed temperature */ 
    386         StopCalc.T2High = (realnum)phycon.TEMP_LIMIT_HIGH; 
     390        StopCalc.TempHiStopZone = (realnum)phycon.TEMP_LIMIT_HIGH; 
     391        StopCalc.TempHiStopIteration = (realnum)phycon.TEMP_LIMIT_HIGH; 
    387392 
    388393        /* the floor sets a limit to the temperature in the calculation - 
     
    391396        StopCalc.TeFloor = 0.; 
    392397 
    393         /* this is in cddefines.h and is 4000 */ 
    394         StopCalc.tend = (realnum)phycon.TEMP_STOP_DEFAULT; 
     398        /* stop zone calculations when Te falls below this, 
     399         * TEMP_STOP_DEFAULT in cddefines.h and is 4000 */ 
     400        StopCalc.TempLoStopZone = (realnum)phycon.TEMP_STOP_DEFAULT; 
     401        /* stop iterations, used to stop time dependent command */ 
     402        StopCalc.TempLoStopIteration = -1.; 
     403 
    395404        /* ending column densities */ 
    396405        StopCalc.HColStop = COLUMN_INIT; 
  • trunk/source/iter_end_chk.cpp

    r2121 r2133  
    336336        } 
    337337 
    338         else if( phycon.te > StopCalc.T2High ) 
     338        else if( phycon.te > StopCalc.TempHiStopZone ) 
    339339        { 
    340340                lgDone = true; 
     
    342342        } 
    343343 
    344         else if( phycon.te < StopCalc.tend ) 
     344        else if( phycon.te < StopCalc.TempLoStopZone ) 
    345345        { 
    346346                lgDone = true; 
  • trunk/source/parse_commands.cpp

    r2062 r2133  
    20072007        /* if stop temp set below default then we are going into cold and possibly molecular 
    20082008         * gas - check some parameters in this case */ 
    2009         if( called.lgTalk && (StopCalc.tend < phycon.TEMP_STOP_DEFAULT ||  
     2009        if( called.lgTalk && (StopCalc.TempLoStopZone < phycon.TEMP_STOP_DEFAULT ||  
    20102010                /* thermal.ConstTemp def is zero, set pos when constant temperature is set */ 
    20112011                (thermal.ConstTemp > 0. && thermal.ConstTemp < phycon.TEMP_STOP_DEFAULT ) ) ) 
  • trunk/source/parse_print.cpp

    r1925 r2133  
    428428                        } 
    429429                } 
     430 
     431                else if( nMatch("CUMU",chCARD_CAPS) ) 
     432                { 
     433                        /* print lines cumulative - integral of line emission over time */ 
     434                        prt.lgPrintLineCumulative = true; 
     435                } 
     436 
    430437                else 
    431438                { 
  • trunk/source/parse_stop.cpp

    r1771 r2133  
    3131        a = FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL); 
    3232 
    33         /* >>chng 04 nov 09, introduce off option */ 
     33        /* off option to turn off one of the stopping criteria, only used if 
     34         * no number was tnered*/ 
    3435        if( lgEOL && !nMatch(" OFF",chCard) ) 
    3536        { 
     
    3738        } 
    3839 
     40        /* time option, for stopping time dependent calculations, used to stop 
     41         * iterations rather than zones.  Only some stop commands have this option */ 
     42        bool lgStopZone = true; 
     43        if( nMatch("TIME",chCard) ) 
     44                lgStopZone = false; 
     45 
    3946        if( nMatch("TEMP",chCard) ) 
    4047        { 
    41                 /* >>chng 04 nov 09, introduce off option to disable this stopping criterion */ 
     48                /* off option disables this stopping criterion */ 
    4249                if( lgEOL && nMatch(" OFF",chCard) ) 
    4350                { 
     
    4552                         * but will still stop if Te falls below TeLowest, the lowest 
    4653                         * possible temperature */ 
    47                         StopCalc.tend = -1.f; 
     54                        if( lgStopZone ) 
     55                                StopCalc.TempLoStopZone = -1.f; 
     56                        else 
     57                                StopCalc.TempLoStopIteration = -1.f; 
    4858                } 
    4959                else 
     
    8595                                /* option for this to be highest allowed temperature, 
    8696                                 * stop temperate exceeds */ 
    87                                 StopCalc.T2High = (realnum)tread; 
     97                                if( lgStopZone ) 
     98                                        StopCalc.TempHiStopZone = (realnum)tread; 
     99                                else 
     100                                        StopCalc.TempHiStopIteration = (realnum)tread; 
    88101                        } 
    89102                        else 
     
    91104                                /* this is ending temperature - we stop if kinetic temperature 
    92105                                 * falls below this */ 
    93                                 StopCalc.tend = (realnum)tread; 
     106                                if( lgStopZone ) 
     107                                        StopCalc.TempLoStopZone = (realnum)tread; 
     108                                else 
     109                                        StopCalc.TempLoStopIteration = (realnum)tread; 
    94110                        } 
    95111                } 
  • trunk/source/prt.h

    r1732 r2133  
    217217         * in exponential format */ 
    218218        bool lgPrtLineLog; 
     219 
     220        /** flag set by print line cumulative command, also print large set of 
     221         * emission line integrated intensities over time depend model */ 
     222        bool lgPrintLineCumulative; 
    219223 
    220224        /** quantities to do with radiation field and printed in header */ 
  • trunk/source/prt_comment.cpp

    r2019 r2133  
    492492 
    493493        /* comment if cosmic rays are not included and stop temp has been lowered to go into neutral gas */ 
    494         if( hextra.cryden== 0. && StopCalc.tend < phycon.TEMP_STOP_DEFAULT) 
     494        if( hextra.cryden== 0. && StopCalc.TempLoStopZone < phycon.TEMP_STOP_DEFAULT) 
    495495        { 
    496496                sprintf( chLine,  
  • trunk/source/prt_lines_hydro.cpp

    r1940 r2133  
    270270                                                Transitions[ipH_LIKE][nelem][index_of_nHi_P][index_of_nLo_S].Emis->xIntensity += 
    271271                                                        Transitions[ipH_LIKE][nelem][ipHi][ipLo].Emis->xIntensity; 
    272                                                 /* kill the resolved line */ 
    273                                                 Transitions[ipH_LIKE][nelem][ipHi][ipLo].Emis->xIntensity = 0.; 
     272                                                /* kill the resolved line - negative means will not be printed */ 
     273                                                Transitions[ipH_LIKE][nelem][ipHi][ipLo].Emis->xIntensity = -1; 
    274274                                                //ASSERT( Transitions[ipH_LIKE][nelem][index_of_nHi_P][index_of_nLo_S].Emis->xIntensity > 0. ); 
    275275                                        } 
  • trunk/source/rt_ots.cpp

    r1822 r2133  
    7171        /************************************************************************** 
    7272         * 
    73          * the bowen HeII - OIII fluorescense problem 
     73         * the bowen HeII - OIII fluorescence problem 
    7474         * 
    7575         **************************************************************************/ 
     
    100100                { 
    101101                        /* debugging code for line oscillation problems  
    102                                 * most often Lya OTS oscillations*/ 
    103                         /*@-redef@*/ 
     102                         * most often Lya OTS oscillations*/ 
    104103                        enum {DEBUG_LOC=false}; 
    105                         /*@+redef@*/ 
    106104                        if( DEBUG_LOC ) 
    107105                        { 
     
    268266        /* more debugging code for rec continua */ 
    269267        { 
    270                 /*@-redef@*/ 
    271268                enum {DEBUG_LOC=false}; 
    272                 /*@+redef@*/ 
    273269                if( DEBUG_LOC ) 
    274270                { 
     
    286282        } 
    287283 
    288         /* now reset Lya dest prob in case is was clobbered */ 
     284        /* now reset Lya dest prob in case is was clobbered by rfield.lgHeIIOTS */ 
    289285        Transitions[ipH_LIKE][ipHYDROGEN][ipH2p][ipH1s].Emis->Pdest = (realnum)save_lya_dest; 
    290286        Transitions[ipH_LIKE][ipHELIUM][ipH2p][ipH1s].Emis->Pdest = (realnum)save_he2lya_dest; 
  • trunk/source/stopcalc.h

    r1732 r2133  
    2525        long int iptnu; 
    2626 
    27         /** highest allowed temperature, set with stop temperature exceeds command */ 
    28         realnum T2High; 
    29  
    3027        /** this provides a "floor" for the temperature - when the temperature 
    3128         * falls to this limit, go to constant temperature solution */ 
    3229        double TeFloor; 
    3330 
    34         /** tend is lowest temperature, set with stop temperature command */ 
    35         realnum tend; 
     31        /** highest allowed zone temperature, set with stop temperature exceeds command */ 
     32        realnum TempHiStopZone; 
     33        /** highest allowed iteration temperature, set with stop time temperature exceeds command */ 
     34        realnum TempHiStopIteration; 
     35 
     36        /** TempLoStopZone is lowest temperature to allow in radial zone integrations,  
     37         * set with stop temperature command */ 
     38        realnum TempLoStopZone; 
     39        /** TempLoStopIteration is lowest temperature to allow in iterations,  
     40         * set with stop time temperature command, used to stop time dependent sims */ 
     41        realnum TempLoStopIteration; 
    3642 
    3743        /** STOP EFRAC sets this limiting ratio of electron to H densities */