--- trunk/OOPSE/libBASS/Globals.cpp 2003/09/04 21:48:07 745 +++ trunk/OOPSE/libBASS/Globals.cpp 2003/11/06 22:01:37 855 @@ -1,6 +1,6 @@ -#include -#include -#include +#include +#include +#include #include "Globals.hpp" #include "simError.h" @@ -52,10 +52,17 @@ #define G_ZCONSFORCEPOLICY 31 #define G_SEED 32 #define G_RESETTIME 33 +#define G_USEINITTIME 34 +#define G_USEINIT_XS_STATE 35 +#define G_ORTHOBOXTOLERANCE 36 + Globals::Globals(){ int i; + + hash_size = 23; + hash_shift = 4; components = NULL; @@ -97,6 +104,9 @@ Globals::Globals(){ addHash( "zconsTol", G_ZCONSTOL); addHash( "zconsForcePolicy", G_ZCONSFORCEPOLICY); addHash( "seed", G_SEED); + addHash( "useInitialTime", G_USEINITTIME); + addHash( "useInitialExtendedSystemState", G_USEINIT_XS_STATE); + addHash( "orthoBoxTolerance", G_ORTHOBOXTOLERANCE); // define some default values @@ -104,7 +114,10 @@ Globals::Globals(){ strcpy( mixingRule,"standard"); //default mixing rules to standard. usePBC = 1; //default periodic boundry conditions to on useRF = 0; - + useInitTime = 1; // default to pull init time from the init file + useInitXSstate = 1; // default to pull the extended state from the init file + orthoBoxTolerance = 1E-6; + have_force_field = 0; have_n_components = 0; have_target_temp = 0; @@ -387,6 +400,35 @@ int Globals::globalAssign( event* the_event ){ default: the_event->err_msg = strdup( "Global error. targetTemp unrecognized.\n" ); + return 0; + break; + } + break; + + case G_ORTHOBOXTOLERANCE: + switch( the_type ){ + + case STRING: + the_event->err_msg = + strdup( "Global error. orthoBoxTolerance is not a double or int.\n" ); + return 0; + break; + + case DOUBLE: + orthoBoxTolerance = the_event->evt.asmt.rhs.dval; + have_target_temp = 1; + return 1; + break; + + case INT: + orthoBoxTolerance = (double)the_event->evt.asmt.rhs.ival; + have_target_temp = 1; + return 1; + break; + + default: + the_event->err_msg = + strdup( "Global error.orthoBoxTolerance unrecognized.\n" ); return 0; break; } @@ -892,7 +934,45 @@ int Globals::globalAssign( event* the_event ){ strdup( "Global error. tempSet was not \"true\" or \"false\".\n" ); return 0; break; + + case G_USEINITTIME: + if( the_type == STRING ){ + + if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) useInitTime = 1; + else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) useInitTime = 0; + else{ + the_event->err_msg = + strdup( "Global error. useInitTime was not \"true\" or \"false\".\n" ); + return 0; + } + return 1; + } + the_event->err_msg = + strdup( "Global error. useInitTime was not \"true\" or \"false\".\n" ); + return 0; + break; + + case G_USEINIT_XS_STATE: + if( the_type == STRING ){ + + if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) + useInitXSstate = 1; + else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) + useInitXSstate = 0; + else{ + the_event->err_msg = + strdup( "Global error. useInitExtendedSystemState was not \"true\" or \"false\".\n" ); + return 0; + } + return 1; + } + + the_event->err_msg = + strdup( "Global error. useInitExtendedSystemState was not \"true\" or \"false\".\n" ); + return 0; + break; + case G_USEPBC: if( the_type == STRING ){