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 2234 by tim, Thu May 19 15:49:53 2005 UTC vs.
Revision 2297 by chrisfen, Thu Sep 15 00:14:35 2005 UTC

# Line 116 | Line 116
116   #define G_THERM_INT_DIST_SPRING  54
117   #define G_THERM_INT_THETA_SPRING 55
118   #define G_THERM_INT_OMEGA_SPRING 56
119 < #define G_TARGETSTRESS 57
119 > #define G_SURFACETENSION 57
120 > #define G_PRINTPRESSURETENSOR   58
121 > #define G_COULOMBIC_CORRECTION  59
122 > #define G_DAMPING_ALPHA     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_TARGETSTRESS));
199 <
198 >  command_table.insert(CommandMapType::value_type("surfaceTension", G_SURFACETENSION));
199 >  command_table.insert(CommandMapType::value_type("printPressureTensor", G_PRINTPRESSURETENSOR));
200 >  command_table.insert(CommandMapType::value_type("coulombicCorrection", G_COULOMBIC_CORRECTION));
201 >  command_table.insert(CommandMapType::value_type("dampingAlpha", G_DAMPING_ALPHA));
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 202 | Line 209 | void Globals::initalize(){
209    orthoBoxTolerance = 1E-6;
210    useSolidThermInt = 0; // default solid-state thermodynamic integration to off
211    useLiquidThermInt = 0; // default liquid thermodynamic integration to off
212 +  dampingAlpha = 1.5; // default damping parameter in Wolf Electrostatics
213  
214    have_force_field =  0;
215    have_n_components = 0;
# Line 254 | Line 262 | void Globals::initalize(){
262    have_dist_spring_constant =  0;
263    have_theta_spring_constant = 0;
264    have_omega_spring_constant = 0;
265 <  have_targetstress = 0;
265 >  have_surface_tension = 0;
266 >  have_print_pressure_tensor = 0;
267 >  have_coulombic_correction = 0;
268 >  have_damping_alpha = 0;
269 >  have_cutoff_policy = 0;
270   }
271  
272   int Globals::newComponent( event* the_event ){
# Line 1842 | Line 1854 | int Globals::globalAssign( event* the_event ){
1854        }
1855        break;  
1856  
1857 <    case G_TARGETSTRESS:
1857 >    case G_SURFACETENSION:
1858          switch( the_type ){
1859        
1860          case STRING:
1861            the_event->err_msg =
1862 <            strdup( "Error in parsing meta-data file!\n\ttargetStress is not a double or int.\n" );
1862 >            strdup( "Error in parsing meta-data file!\n\tsurfaceTension is not a double or int.\n" );
1863            return 1;
1864            break;
1865            
1866          case DOUBLE:
1867 <          target_stress= the_event->evt.asmt.rhs.dval;
1868 <          have_targetstress = 1;
1867 >          surface_tension= the_event->evt.asmt.rhs.dval;
1868 >          have_surface_tension = 1;
1869            return 1;
1870            break;
1871            
1872          case INT:
1873 <          target_stress = (double)the_event->evt.asmt.rhs.dval;
1874 <          have_targetstress = 1;
1873 >          surface_tension = (double)the_event->evt.asmt.rhs.dval;
1874 >          have_surface_tension = 1;
1875            return 1;
1876            break;
1877            
1878          default:
1879            the_event->err_msg =
1880 <            strdup( "Error in parsing meta-data file!\n\tttargetStress unrecognized.\n" );
1880 >            strdup( "Error in parsing meta-data file!\n\tsurfaceTension unrecognized.\n" );
1881            return 0;
1882            break;
1883 +        }
1884 +        break;
1885 +
1886 +    case G_PRINTPRESSURETENSOR:
1887 +      if( the_type == STRING ){
1888 +        
1889 +        if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) {
1890 +            have_print_pressure_tensor= 1;
1891 +            print_pressure_tensor = 1;
1892 +        } else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) {
1893 +            have_print_pressure_tensor= 1;
1894 +            print_pressure_tensor = 0;
1895 +        } else{
1896 +          the_event->err_msg =
1897 +            strdup( "Error in parsing meta-data file!\n\tprintPressureTensor was not \"true\" or \"false\".\n" );
1898 +          return 0;
1899          }
1900 +        return 1;
1901 +          }
1902 +          
1903 +          the_event->err_msg =
1904 +        strdup( "Error in parsing meta-data file!\n\tprintPressureTensor was not \"true\" or \"false\".\n" );
1905 +          return 0;
1906 +          break;
1907 +
1908 +    case G_COULOMBIC_CORRECTION:
1909 +      switch( the_type ){
1910 +        
1911 +      case STRING:
1912 +        strcpy(coulombicCorrection, the_event->evt.asmt.rhs.sval);
1913 +
1914 +        for(int i = 0; coulombicCorrection[i] != '\0'; i++)
1915 +          {
1916 +            coulombicCorrection[i] = toupper(coulombicCorrection[i]);
1917 +          }
1918 +        have_coulombic_correction = 1;
1919 +        return 1;
1920 +        break;
1921 +        
1922 +      case DOUBLE:
1923 +        the_event->err_msg =
1924 +          strdup( "Error in parsing meta-data file!\n\tcoulombicCorrection should be a string!\n" );
1925 +        return 0;
1926 +        break;
1927 +        
1928 +      case INT:
1929 +        the_event->err_msg =
1930 +          strdup( "Error in parsing meta-data file!\n\tcoulombicCorrection should be a string!\n" );
1931 +        return 0;
1932 +        break;
1933 +        
1934 +      default:
1935 +        the_event->err_msg =
1936 +          strdup( "Error in parsing meta-data file!\n\tcoulombicCorrection unrecognized.\n" );
1937 +        return 0;
1938 +        break;
1939 +      }
1940 +      break;
1941 +
1942 +    case G_DAMPING_ALPHA:
1943 +      switch( the_type ){
1944 +        
1945 +      case STRING:
1946 +        the_event->err_msg =
1947 +          strdup( "Error in parsing meta-data file!\n\tdampingAlpha is not a double or int.\n" );
1948 +        return 1;
1949          break;
1950          
1951 +      case DOUBLE:
1952 +        dampingAlpha = the_event->evt.asmt.rhs.dval;
1953 +        have_damping_alpha = 1;
1954 +        return 1;
1955 +        break;
1956 +        
1957 +      case INT:
1958 +        dampingAlpha = (double)the_event->evt.asmt.rhs.dval;
1959 +        have_damping_alpha = 1;
1960 +        return 1;
1961 +        break;
1962 +        
1963 +      default:
1964 +        the_event->err_msg =
1965 +          strdup( "Error in parsing meta-data file!\n\tdampingAlpha unrecognized.\n" );
1966 +        return 0;
1967 +        break;
1968 +      }
1969 +      break;  
1970  
1971 +    case G_CUTOFFPOLICY:
1972 +      switch( the_type ){
1973 +        
1974 +      case STRING:
1975 +        strcpy(cutoffPolicy, the_event->evt.asmt.rhs.sval);
1976 +
1977 +        for(int i = 0; cutoffPolicy[i] != '\0'; i++)
1978 +          {
1979 +            cutoffPolicy[i] = toupper(cutoffPolicy[i]);
1980 +          }
1981 +        have_cutoff_policy = 1;
1982 +        return 1;
1983 +        break;
1984 +        
1985 +      case DOUBLE:
1986 +        the_event->err_msg =
1987 +          strdup( "Error in parsing meta-data file!\n\tcutoffPolicy should be a string!\n" );
1988 +        return 0;
1989 +        break;
1990 +        
1991 +      case INT:
1992 +        the_event->err_msg =
1993 +          strdup( "Error in parsing meta-data file!\n\tcutoffPolicy should be a string!\n" );
1994 +        return 0;
1995 +        break;
1996 +        
1997 +      default:
1998 +        the_event->err_msg =
1999 +          strdup( "Error in parsing meta-data file!\n\tcutoffPolicy unrecognized.\n" );
2000 +        return 0;
2001 +        break;
2002 +      }
2003 +      break;
2004 +
2005        
2006        // add more token cases here.      
2007      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines