ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-2.0/src/io/Globals.cpp
(Generate patch)

Comparing trunk/OOPSE-2.0/src/io/Globals.cpp (file contents):
Revision 2235 by tim, Thu May 19 21:31:23 2005 UTC vs.
Revision 2285 by gezelter, Wed Sep 7 20:46:46 2005 UTC

# Line 117 | Line 117
117   #define G_THERM_INT_THETA_SPRING 55
118   #define G_THERM_INT_OMEGA_SPRING 56
119   #define G_SURFACETENSION 57
120 + #define G_PRINTPREESURETENSOR   58
121 + #define G_USE_UNDAMPED_WOLF 59
122 + #define G_USE_DAMPED_WOLF   60
123 + #define G_CUTOFFPOLICY      61
124  
125   Globals::Globals(){
126    initalize();
# Line 191 | Line 195 | void Globals::initalize(){
195    command_table.insert(CommandMapType::value_type("thermIntDistSpringConst", G_THERM_INT_DIST_SPRING));
196    command_table.insert(CommandMapType::value_type("thermIntThetaSpringConst", G_THERM_INT_THETA_SPRING));
197    command_table.insert(CommandMapType::value_type("thermIntOmegaSpringConst", G_THERM_INT_OMEGA_SPRING));
198 <  command_table.insert(CommandMapType::value_type("targetStress", G_SURFACETENSION));
199 <
198 >  command_table.insert(CommandMapType::value_type("surfaceTension", G_SURFACETENSION));
199 >  command_table.insert(CommandMapType::value_type("printPressureTensor", G_PRINTPREESURETENSOR));
200 >  command_table.insert(CommandMapType::value_type("useUndampedWolf", G_USE_UNDAMPED_WOLF));
201 >  command_table.insert(CommandMapType::value_type("useDampedWolf", G_USE_DAMPED_WOLF));
202 >  command_table.insert(CommandMapType::value_type("cutoffPolicy", G_CUTOFFPOLICY));
203  
204    strcpy( mixingRule,"standard");  //default mixing rules to standard.
205    usePBC = 1; //default  periodic boundry conditions to on
# Line 255 | Line 262 | void Globals::initalize(){
262    have_theta_spring_constant = 0;
263    have_omega_spring_constant = 0;
264    have_surface_tension = 0;
265 +  have_print_pressure_tensor = 0;
266 +  have_cutoff_policy = 0;
267   }
268  
269   int Globals::newComponent( event* the_event ){
# Line 1870 | Line 1879 | int Globals::globalAssign( event* the_event ){
1879            break;
1880          }
1881          break;
1882 +
1883 +    case G_PRINTPREESURETENSOR:
1884 +          if( the_type == STRING ){
1885 +        
1886 +        if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) {
1887 +            have_print_pressure_tensor= 1;
1888 +            print_pressure_tensor = 1;
1889 +        } else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) {
1890 +            have_print_pressure_tensor= 1;
1891 +            print_pressure_tensor = 0;
1892 +        } else{
1893 +          the_event->err_msg =
1894 +            strdup( "Error in parsing meta-data file!\n\tprintPressureTensor was not \"true\" or \"false\".\n" );
1895 +          return 0;
1896 +        }
1897 +        return 1;
1898 +          }
1899 +          
1900 +          the_event->err_msg =
1901 +        strdup( "Error in parsing meta-data file!\n\tprintPressureTensor was not \"true\" or \"false\".\n" );
1902 +          return 0;
1903 +          break;
1904 +
1905 +    case G_USE_UNDAMPED_WOLF:
1906 +      if( the_type == STRING ){
1907 +        
1908 +        if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) useUndampedWolf = 1;
1909 +        else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) useUndampedWolf = 0;
1910 +        else{
1911 +          the_event->err_msg =
1912 +          strdup( "Error in parsing meta-data file!\n\tuseUndampedWolf was not \"true\" or \"false\".\n" );
1913 +          return 0;
1914 +        }
1915 +        return 1;
1916 +      }
1917 +      
1918 +      the_event->err_msg =
1919 +      strdup( "Error in parsing meta-data file!\n\tuseUndampedWolf was not \"true\" or \"false\".\n" );
1920 +      return 0;
1921 +      break;
1922 +      
1923 +    case G_USE_DAMPED_WOLF:
1924 +      if( the_type == STRING ){
1925          
1926 +        if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) useDampedWolf = 1;
1927 +        else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) useDampedWolf = 0;
1928 +        else{
1929 +          the_event->err_msg =
1930 +          strdup( "Error in parsing meta-data file!\n\tuseDampedWolf was not \"true\" or \"false\".\n" );
1931 +          return 0;
1932 +        }
1933 +        return 1;
1934 +      }
1935 +      
1936 +      the_event->err_msg =
1937 +      strdup( "Error in parsing meta-data file!\n\tuseDampedWolf was not \"true\" or \"false\".\n" );
1938 +      return 0;
1939 +      break;
1940 +      
1941 +    case G_CUTOFFPOLICY:
1942 +      switch( the_type ){
1943 +        
1944 +      case STRING:
1945 +        strcpy(cutoffPolicy, the_event->evt.asmt.rhs.sval);
1946  
1947 +        for(int i = 0; cutoffPolicy[i] != '\0'; i++)
1948 +          {
1949 +            cutoffPolicy[i] = toupper(cutoffPolicy[i]);
1950 +          }
1951 +        have_cutoff_policy = 1;
1952 +        return 1;
1953 +        break;
1954 +        
1955 +      case DOUBLE:
1956 +        the_event->err_msg =
1957 +          strdup( "Error in parsing meta-data file!\n\tcutoffPolicy should be a string!\n" );
1958 +        return 0;
1959 +        break;
1960 +        
1961 +      case INT:
1962 +        the_event->err_msg =
1963 +          strdup( "Error in parsing meta-data file!\n\tcutoffPolicy should be a string!\n" );
1964 +        return 0;
1965 +        break;
1966 +        
1967 +      default:
1968 +        the_event->err_msg =
1969 +          strdup( "Error in parsing meta-data file!\n\tcutoffPolicy unrecognized.\n" );
1970 +        return 0;
1971 +        break;
1972 +      }
1973 +      break;
1974 +
1975        
1976        // add more token cases here.      
1977      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines