--- trunk/src/io/Globals.cpp 2005/05/22 21:05:15 541 +++ trunk/src/io/Globals.cpp 2005/09/07 20:46:46 586 @@ -118,6 +118,9 @@ #define G_THERM_INT_OMEGA_SPRING 56 #define G_SURFACETENSION 57 #define G_PRINTPREESURETENSOR 58 +#define G_USE_UNDAMPED_WOLF 59 +#define G_USE_DAMPED_WOLF 60 +#define G_CUTOFFPOLICY 61 Globals::Globals(){ initalize(); @@ -194,7 +197,9 @@ void Globals::initalize(){ command_table.insert(CommandMapType::value_type("thermIntOmegaSpringConst", G_THERM_INT_OMEGA_SPRING)); command_table.insert(CommandMapType::value_type("surfaceTension", G_SURFACETENSION)); command_table.insert(CommandMapType::value_type("printPressureTensor", G_PRINTPREESURETENSOR)); - + command_table.insert(CommandMapType::value_type("useUndampedWolf", G_USE_UNDAMPED_WOLF)); + command_table.insert(CommandMapType::value_type("useDampedWolf", G_USE_DAMPED_WOLF)); + command_table.insert(CommandMapType::value_type("cutoffPolicy", G_CUTOFFPOLICY)); strcpy( mixingRule,"standard"); //default mixing rules to standard. usePBC = 1; //default periodic boundry conditions to on @@ -258,6 +263,7 @@ void Globals::initalize(){ have_omega_spring_constant = 0; have_surface_tension = 0; have_print_pressure_tensor = 0; + have_cutoff_policy = 0; } int Globals::newComponent( event* the_event ){ @@ -1896,8 +1902,76 @@ int Globals::globalAssign( event* the_event ){ return 0; break; + case G_USE_UNDAMPED_WOLF: + if( the_type == STRING ){ + + if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) useUndampedWolf = 1; + else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) useUndampedWolf = 0; + else{ + the_event->err_msg = + strdup( "Error in parsing meta-data file!\n\tuseUndampedWolf was not \"true\" or \"false\".\n" ); + return 0; + } + return 1; + } + + the_event->err_msg = + strdup( "Error in parsing meta-data file!\n\tuseUndampedWolf was not \"true\" or \"false\".\n" ); + return 0; + break; + + case G_USE_DAMPED_WOLF: + if( the_type == STRING ){ + if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) useDampedWolf = 1; + else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) useDampedWolf = 0; + else{ + the_event->err_msg = + strdup( "Error in parsing meta-data file!\n\tuseDampedWolf was not \"true\" or \"false\".\n" ); + return 0; + } + return 1; + } + + the_event->err_msg = + strdup( "Error in parsing meta-data file!\n\tuseDampedWolf was not \"true\" or \"false\".\n" ); + return 0; + break; + + case G_CUTOFFPOLICY: + switch( the_type ){ + + case STRING: + strcpy(cutoffPolicy, the_event->evt.asmt.rhs.sval); + for(int i = 0; cutoffPolicy[i] != '\0'; i++) + { + cutoffPolicy[i] = toupper(cutoffPolicy[i]); + } + have_cutoff_policy = 1; + return 1; + break; + + case DOUBLE: + the_event->err_msg = + strdup( "Error in parsing meta-data file!\n\tcutoffPolicy should be a string!\n" ); + return 0; + break; + + case INT: + the_event->err_msg = + strdup( "Error in parsing meta-data file!\n\tcutoffPolicy should be a string!\n" ); + return 0; + break; + + default: + the_event->err_msg = + strdup( "Error in parsing meta-data file!\n\tcutoffPolicy unrecognized.\n" ); + return 0; + break; + } + break; + // add more token cases here. }