--- trunk/OOPSE/libBASS/Globals.cpp 2004/05/11 04:21:52 1153 +++ trunk/OOPSE/libBASS/Globals.cpp 2004/06/01 14:27:28 1210 @@ -66,6 +66,10 @@ #define G_ZCONSGAP 45 #define G_ZCONSFIXTIME 46 #define G_ZCONSUSINGSMD 47 +#define G_USE_SOLID_THERM_INT 48 +#define G_USE_LIQUID_THERM_INT 49 +#define G_THERM_INT_LAMBDA 50 +#define G_THERM_INT_K 51 Globals::Globals(){ @@ -117,17 +121,21 @@ Globals::Globals(){ addHash( "useInitialTime", G_USEINITTIME); addHash( "useInitialExtendedSystemState", G_USEINIT_XS_STATE); addHash( "orthoBoxTolerance", G_ORTHOBOXTOLERANCE); - addHash( "minimizer", G_MINIMIZER); - addHash( "minMaxIter", G_MIN_MAXITER); - addHash( "minWriteFrq", G_MIN_WRITEFRQ); - addHash( "minStepSize", G_MIN_STEPSIZE); - addHash( "minFTol", G_MIN_FTOL); - addHash( "minGTol", G_MIN_GTOL); - addHash( "minLSTol", G_MIN_LSTOL); - addHash( "minLSMaxIter", G_MIN_LSMAXITER); - addHash( "zconsGap", G_ZCONSGAP); - addHash( "zconsFixtime", G_ZCONSFIXTIME); - addHash( "zconsUsingSMD", G_ZCONSUSINGSMD); + addHash( "minimizer", G_MINIMIZER); + addHash( "minMaxIter", G_MIN_MAXITER); + addHash( "minWriteFrq", G_MIN_WRITEFRQ); + addHash( "minStepSize", G_MIN_STEPSIZE); + addHash( "minFTol", G_MIN_FTOL); + addHash( "minGTol", G_MIN_GTOL); + addHash( "minLSTol", G_MIN_LSTOL); + addHash( "minLSMaxIter", G_MIN_LSMAXITER); + addHash( "zconsGap", G_ZCONSGAP); + addHash( "zconsFixtime", G_ZCONSFIXTIME); + addHash( "zconsUsingSMD", G_ZCONSUSINGSMD); + addHash( "useSolidThermInt", G_USE_SOLID_THERM_INT); + addHash( "useLiquidThermInt", G_USE_LIQUID_THERM_INT); + addHash( "thermodynamicIntegrationLambda", G_THERM_INT_LAMBDA); + addHash( "thermodynamicIntegrationK", G_THERM_INT_K); strcpy( mixingRule,"standard"); //default mixing rules to standard. usePBC = 1; //default periodic boundry conditions to on @@ -135,6 +143,8 @@ Globals::Globals(){ useInitTime = 0; // default to pull init time from the init file useInitXSstate = 0; // default to pull the extended state from the init file orthoBoxTolerance = 1E-6; + useSolidThermInt = 0; // default solid-state thermodynamic integration to off + useLiquidThermInt = 0; // default liquid thermodynamic integration to off have_force_field = 0; have_n_components = 0; @@ -180,6 +190,8 @@ Globals::Globals(){ have_minimizer_gtol = 0; have_minimizer_ls_tol = 0; have_minimizer_ls_maxiteration = 0; + have_thermodynamic_integration_lambda = 0; + have_thermodynamic_integration_k = 0; } @@ -1568,8 +1580,102 @@ int Globals::globalAssign( event* the_event ){ strdup( "Global error. seed unrecognized.\n" ); return 0; break; + } + break; + + case G_USE_SOLID_THERM_INT: + if( the_type == STRING ){ + + if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) useSolidThermInt = 1; + else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) useSolidThermInt = 0; + else{ + the_event->err_msg = + strdup( "Global error. useSolidThermInt was not \"true\" or \"false\".\n" ); + return 0; + } + return 1; + } + + the_event->err_msg = + strdup( "Global error. useSolidThermInt was not \"true\" or \"false\".\n" ); + return 0; + break; + + case G_USE_LIQUID_THERM_INT: + if( the_type == STRING ){ + + if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) useLiquidThermInt = 1; + else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) useLiquidThermInt = 0; + else{ + the_event->err_msg = + strdup( "Global error. useLiquidThermInt was not \"true\" or \"false\".\n" ); + return 0; + } + return 1; } + + the_event->err_msg = + strdup( "Global error. useLiquidThermInt was not \"true\" or \"false\".\n" ); + return 0; break; + + case G_THERM_INT_LAMBDA: + switch( the_type ){ + + case STRING: + the_event->err_msg = + strdup( "Global error. thermodynamicIntegrationLambda is not a double or int.\n" ); + return 1; + break; + + case DOUBLE: + thermodynamic_integration_lambda = the_event->evt.asmt.rhs.dval; + have_thermodynamic_integration_lambda = 1; + return 1; + break; + + case INT: + thermodynamic_integration_lambda = (double)the_event->evt.asmt.rhs.dval; + have_thermodynamic_integration_lambda = 1; + return 1; + break; + + default: + the_event->err_msg = + strdup( "Global error. thermodynamicIntegrationLambda unrecognized.\n" ); + return 0; + break; + } + break; + + case G_THERM_INT_K: + switch( the_type ){ + + case STRING: + the_event->err_msg = + strdup( "Global error. thermodynamicIntegrationK is not a double or int.\n" ); + return 1; + break; + + case DOUBLE: + thermodynamic_integration_k = the_event->evt.asmt.rhs.dval; + have_thermodynamic_integration_k = 1; + return 1; + break; + + case INT: + thermodynamic_integration_k = (double)the_event->evt.asmt.rhs.dval; + have_thermodynamic_integration_k = 1; + return 1; + break; + + default: + the_event->err_msg = + strdup( "Global error. thermodynamicIntegrationK unrecognized.\n" ); + return 0; + break; + } + break; // add more token cases here. }