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_SURFACETENSION 57 |
120 |
+ |
#define G_PRINTPREESURETENSOR 58 |
121 |
+ |
#define G_USE_UNDAMPED_WOLF 59 |
122 |
+ |
#define G_USE_DAMPED_WOLF 60 |
123 |
|
|
124 |
|
Globals::Globals(){ |
125 |
|
initalize(); |
194 |
|
command_table.insert(CommandMapType::value_type("thermIntDistSpringConst", G_THERM_INT_DIST_SPRING)); |
195 |
|
command_table.insert(CommandMapType::value_type("thermIntThetaSpringConst", G_THERM_INT_THETA_SPRING)); |
196 |
|
command_table.insert(CommandMapType::value_type("thermIntOmegaSpringConst", G_THERM_INT_OMEGA_SPRING)); |
197 |
< |
|
197 |
> |
command_table.insert(CommandMapType::value_type("surfaceTension", G_SURFACETENSION)); |
198 |
> |
command_table.insert(CommandMapType::value_type("printPressureTensor", G_PRINTPREESURETENSOR)); |
199 |
> |
command_table.insert(CommandMapType::value_type("useUndampedWolf", G_USE_UNDAMPED_WOLF)); |
200 |
> |
command_table.insert(CommandMapType::value_type("useDampedWolf", G_USE_DAMPED_WOLF)); |
201 |
|
|
202 |
|
strcpy( mixingRule,"standard"); //default mixing rules to standard. |
203 |
|
usePBC = 1; //default periodic boundry conditions to on |
259 |
|
have_dist_spring_constant = 0; |
260 |
|
have_theta_spring_constant = 0; |
261 |
|
have_omega_spring_constant = 0; |
262 |
+ |
have_surface_tension = 0; |
263 |
+ |
have_print_pressure_tensor = 0; |
264 |
|
} |
265 |
|
|
266 |
|
int Globals::newComponent( event* the_event ){ |
1258 |
|
switch( the_type ){ |
1259 |
|
|
1260 |
|
case STRING: |
1261 |
< |
strcpy(zconsForcePolicy, the_event->evt.asmt.rhs.sval); |
1261 |
> |
strcpy(zconsForcePolicy, the_event->evt.asmt.rhs.sval); |
1262 |
|
|
1263 |
< |
for(int i = 0; zconsForcePolicy[i] != '\0'; i++) |
1264 |
< |
{ |
1265 |
< |
zconsForcePolicy[i] = toupper(zconsForcePolicy[i]); |
1266 |
< |
} |
1263 |
> |
for(int i = 0; zconsForcePolicy[i] != '\0'; i++) |
1264 |
> |
{ |
1265 |
> |
zconsForcePolicy[i] = toupper(zconsForcePolicy[i]); |
1266 |
> |
} |
1267 |
|
have_zcons_force_policy = 1; |
1268 |
< |
return 1; |
1268 |
> |
return 1; |
1269 |
|
break; |
1270 |
|
|
1271 |
|
case DOUBLE: |
1616 |
|
switch( the_type ){ |
1617 |
|
|
1618 |
|
case STRING: |
1619 |
< |
the_event->err_msg = |
1619 |
> |
the_event->err_msg = |
1620 |
|
strdup( "Error in parsing meta-data file!\n\tseed is not a string.\n" ); |
1621 |
|
return 0; |
1622 |
< |
return 0; |
1622 |
> |
return 0; |
1623 |
|
break; |
1624 |
|
|
1625 |
|
case DOUBLE: |
1626 |
< |
have_seed = 1; |
1627 |
< |
seed = (int)the_event->evt.asmt.rhs.dval; |
1626 |
> |
have_seed = 1; |
1627 |
> |
seed = (int)the_event->evt.asmt.rhs.dval; |
1628 |
|
return 1; |
1629 |
|
break; |
1630 |
|
|
1631 |
|
case INT: |
1632 |
< |
have_seed = 1; |
1633 |
< |
seed = the_event->evt.asmt.rhs.ival ; |
1632 |
> |
have_seed = 1; |
1633 |
> |
seed = the_event->evt.asmt.rhs.ival ; |
1634 |
|
return 1; |
1635 |
|
break; |
1636 |
|
|
1819 |
|
} |
1820 |
|
break; |
1821 |
|
|
1822 |
< |
case G_THERM_INT_OMEGA_SPRING: |
1822 |
> |
case G_THERM_INT_OMEGA_SPRING: |
1823 |
|
switch( the_type ){ |
1824 |
|
|
1825 |
|
case STRING: |
1847 |
|
break; |
1848 |
|
} |
1849 |
|
break; |
1850 |
+ |
|
1851 |
+ |
case G_SURFACETENSION: |
1852 |
+ |
switch( the_type ){ |
1853 |
+ |
|
1854 |
+ |
case STRING: |
1855 |
+ |
the_event->err_msg = |
1856 |
+ |
strdup( "Error in parsing meta-data file!\n\tsurfaceTension is not a double or int.\n" ); |
1857 |
+ |
return 1; |
1858 |
+ |
break; |
1859 |
+ |
|
1860 |
+ |
case DOUBLE: |
1861 |
+ |
surface_tension= the_event->evt.asmt.rhs.dval; |
1862 |
+ |
have_surface_tension = 1; |
1863 |
+ |
return 1; |
1864 |
+ |
break; |
1865 |
+ |
|
1866 |
+ |
case INT: |
1867 |
+ |
surface_tension = (double)the_event->evt.asmt.rhs.dval; |
1868 |
+ |
have_surface_tension = 1; |
1869 |
+ |
return 1; |
1870 |
+ |
break; |
1871 |
+ |
|
1872 |
+ |
default: |
1873 |
+ |
the_event->err_msg = |
1874 |
+ |
strdup( "Error in parsing meta-data file!\n\tsurfaceTension unrecognized.\n" ); |
1875 |
+ |
return 0; |
1876 |
+ |
break; |
1877 |
+ |
} |
1878 |
+ |
break; |
1879 |
+ |
|
1880 |
+ |
case G_PRINTPREESURETENSOR: |
1881 |
+ |
if( the_type == STRING ){ |
1882 |
+ |
|
1883 |
+ |
if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) { |
1884 |
+ |
have_print_pressure_tensor= 1; |
1885 |
+ |
print_pressure_tensor = 1; |
1886 |
+ |
} else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) { |
1887 |
+ |
have_print_pressure_tensor= 1; |
1888 |
+ |
print_pressure_tensor = 0; |
1889 |
+ |
} else{ |
1890 |
+ |
the_event->err_msg = |
1891 |
+ |
strdup( "Error in parsing meta-data file!\n\tprintPressureTensor was not \"true\" or \"false\".\n" ); |
1892 |
+ |
return 0; |
1893 |
+ |
} |
1894 |
+ |
return 1; |
1895 |
+ |
} |
1896 |
+ |
|
1897 |
+ |
the_event->err_msg = |
1898 |
+ |
strdup( "Error in parsing meta-data file!\n\tprintPressureTensor was not \"true\" or \"false\".\n" ); |
1899 |
+ |
return 0; |
1900 |
+ |
break; |
1901 |
+ |
|
1902 |
+ |
case G_USE_UNDAMPED_WOLF: |
1903 |
+ |
if( the_type == STRING ){ |
1904 |
+ |
|
1905 |
+ |
if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) useUndampedWolf = 1; |
1906 |
+ |
else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) useUndampedWolf = 0; |
1907 |
+ |
else{ |
1908 |
+ |
the_event->err_msg = |
1909 |
+ |
strdup( "Error in parsing meta-data file!\n\tuseUndampedWolf was not \"true\" or \"false\".\n" ); |
1910 |
+ |
return 0; |
1911 |
+ |
} |
1912 |
+ |
return 1; |
1913 |
+ |
} |
1914 |
+ |
|
1915 |
+ |
the_event->err_msg = |
1916 |
+ |
strdup( "Error in parsing meta-data file!\n\tuseUndampedWolf was not \"true\" or \"false\".\n" ); |
1917 |
+ |
return 0; |
1918 |
+ |
break; |
1919 |
+ |
|
1920 |
+ |
case G_USE_DAMPED_WOLF: |
1921 |
+ |
if( the_type == STRING ){ |
1922 |
+ |
|
1923 |
+ |
if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) useDampedWolf = 1; |
1924 |
+ |
else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) useDampedWolf = 0; |
1925 |
+ |
else{ |
1926 |
+ |
the_event->err_msg = |
1927 |
+ |
strdup( "Error in parsing meta-data file!\n\tuseDampedWolf was not \"true\" or \"false\".\n" ); |
1928 |
+ |
return 0; |
1929 |
+ |
} |
1930 |
+ |
return 1; |
1931 |
+ |
} |
1932 |
+ |
|
1933 |
+ |
the_event->err_msg = |
1934 |
+ |
strdup( "Error in parsing meta-data file!\n\tuseDampedWolf was not \"true\" or \"false\".\n" ); |
1935 |
+ |
return 0; |
1936 |
+ |
break; |
1937 |
+ |
|
1938 |
+ |
|
1939 |
|
// add more token cases here. |
1940 |
|
} |
1941 |
|
} |