| 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 |
|
|
| 122 |
|
Globals::Globals(){ |
| 123 |
|
initalize(); |
| 192 |
|
command_table.insert(CommandMapType::value_type("thermIntDistSpringConst", G_THERM_INT_DIST_SPRING)); |
| 193 |
|
command_table.insert(CommandMapType::value_type("thermIntThetaSpringConst", G_THERM_INT_THETA_SPRING)); |
| 194 |
|
command_table.insert(CommandMapType::value_type("thermIntOmegaSpringConst", G_THERM_INT_OMEGA_SPRING)); |
| 195 |
+ |
command_table.insert(CommandMapType::value_type("surfaceTension", G_SURFACETENSION)); |
| 196 |
+ |
command_table.insert(CommandMapType::value_type("printPressureTensor", G_PRINTPREESURETENSOR)); |
| 197 |
|
|
| 198 |
|
|
| 199 |
|
strcpy( mixingRule,"standard"); //default mixing rules to standard. |
| 256 |
|
have_dist_spring_constant = 0; |
| 257 |
|
have_theta_spring_constant = 0; |
| 258 |
|
have_omega_spring_constant = 0; |
| 259 |
+ |
have_surface_tension = 0; |
| 260 |
+ |
have_print_pressure_tensor = 0; |
| 261 |
|
} |
| 262 |
|
|
| 263 |
|
int Globals::newComponent( event* the_event ){ |
| 1255 |
|
switch( the_type ){ |
| 1256 |
|
|
| 1257 |
|
case STRING: |
| 1258 |
< |
strcpy(zconsForcePolicy, the_event->evt.asmt.rhs.sval); |
| 1258 |
> |
strcpy(zconsForcePolicy, the_event->evt.asmt.rhs.sval); |
| 1259 |
|
|
| 1260 |
< |
for(int i = 0; zconsForcePolicy[i] != '\0'; i++) |
| 1261 |
< |
{ |
| 1262 |
< |
zconsForcePolicy[i] = toupper(zconsForcePolicy[i]); |
| 1263 |
< |
} |
| 1260 |
> |
for(int i = 0; zconsForcePolicy[i] != '\0'; i++) |
| 1261 |
> |
{ |
| 1262 |
> |
zconsForcePolicy[i] = toupper(zconsForcePolicy[i]); |
| 1263 |
> |
} |
| 1264 |
|
have_zcons_force_policy = 1; |
| 1265 |
< |
return 1; |
| 1265 |
> |
return 1; |
| 1266 |
|
break; |
| 1267 |
|
|
| 1268 |
|
case DOUBLE: |
| 1613 |
|
switch( the_type ){ |
| 1614 |
|
|
| 1615 |
|
case STRING: |
| 1616 |
< |
the_event->err_msg = |
| 1616 |
> |
the_event->err_msg = |
| 1617 |
|
strdup( "Error in parsing meta-data file!\n\tseed is not a string.\n" ); |
| 1618 |
|
return 0; |
| 1619 |
< |
return 0; |
| 1619 |
> |
return 0; |
| 1620 |
|
break; |
| 1621 |
|
|
| 1622 |
|
case DOUBLE: |
| 1623 |
< |
have_seed = 1; |
| 1624 |
< |
seed = (int)the_event->evt.asmt.rhs.dval; |
| 1623 |
> |
have_seed = 1; |
| 1624 |
> |
seed = (int)the_event->evt.asmt.rhs.dval; |
| 1625 |
|
return 1; |
| 1626 |
|
break; |
| 1627 |
|
|
| 1628 |
|
case INT: |
| 1629 |
< |
have_seed = 1; |
| 1630 |
< |
seed = the_event->evt.asmt.rhs.ival ; |
| 1629 |
> |
have_seed = 1; |
| 1630 |
> |
seed = the_event->evt.asmt.rhs.ival ; |
| 1631 |
|
return 1; |
| 1632 |
|
break; |
| 1633 |
|
|
| 1816 |
|
} |
| 1817 |
|
break; |
| 1818 |
|
|
| 1819 |
< |
case G_THERM_INT_OMEGA_SPRING: |
| 1819 |
> |
case G_THERM_INT_OMEGA_SPRING: |
| 1820 |
|
switch( the_type ){ |
| 1821 |
|
|
| 1822 |
|
case STRING: |
| 1844 |
|
break; |
| 1845 |
|
} |
| 1846 |
|
break; |
| 1847 |
+ |
|
| 1848 |
+ |
case G_SURFACETENSION: |
| 1849 |
+ |
switch( the_type ){ |
| 1850 |
+ |
|
| 1851 |
+ |
case STRING: |
| 1852 |
+ |
the_event->err_msg = |
| 1853 |
+ |
strdup( "Error in parsing meta-data file!\n\tsurfaceTension is not a double or int.\n" ); |
| 1854 |
+ |
return 1; |
| 1855 |
+ |
break; |
| 1856 |
+ |
|
| 1857 |
+ |
case DOUBLE: |
| 1858 |
+ |
surface_tension= the_event->evt.asmt.rhs.dval; |
| 1859 |
+ |
have_surface_tension = 1; |
| 1860 |
+ |
return 1; |
| 1861 |
+ |
break; |
| 1862 |
+ |
|
| 1863 |
+ |
case INT: |
| 1864 |
+ |
surface_tension = (double)the_event->evt.asmt.rhs.dval; |
| 1865 |
+ |
have_surface_tension = 1; |
| 1866 |
+ |
return 1; |
| 1867 |
+ |
break; |
| 1868 |
+ |
|
| 1869 |
+ |
default: |
| 1870 |
+ |
the_event->err_msg = |
| 1871 |
+ |
strdup( "Error in parsing meta-data file!\n\tsurfaceTension unrecognized.\n" ); |
| 1872 |
+ |
return 0; |
| 1873 |
+ |
break; |
| 1874 |
+ |
} |
| 1875 |
+ |
break; |
| 1876 |
+ |
|
| 1877 |
+ |
case G_PRINTPREESURETENSOR: |
| 1878 |
+ |
if( the_type == STRING ){ |
| 1879 |
+ |
|
| 1880 |
+ |
if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) { |
| 1881 |
+ |
have_print_pressure_tensor= 1; |
| 1882 |
+ |
print_pressure_tensor = 1; |
| 1883 |
+ |
} else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) { |
| 1884 |
+ |
have_print_pressure_tensor= 1; |
| 1885 |
+ |
print_pressure_tensor = 0; |
| 1886 |
+ |
} else{ |
| 1887 |
+ |
the_event->err_msg = |
| 1888 |
+ |
strdup( "Error in parsing meta-data file!\n\tprintPressureTensor was not \"true\" or \"false\".\n" ); |
| 1889 |
+ |
return 0; |
| 1890 |
+ |
} |
| 1891 |
+ |
return 1; |
| 1892 |
+ |
} |
| 1893 |
+ |
|
| 1894 |
+ |
the_event->err_msg = |
| 1895 |
+ |
strdup( "Error in parsing meta-data file!\n\tprintPressureTensor was not \"true\" or \"false\".\n" ); |
| 1896 |
+ |
return 0; |
| 1897 |
+ |
break; |
| 1898 |
+ |
|
| 1899 |
+ |
|
| 1900 |
+ |
|
| 1901 |
+ |
|
| 1902 |
|
// add more token cases here. |
| 1903 |
|
} |
| 1904 |
|
} |