48 |
|
#define G_TAUBAROSTAT 27 |
49 |
|
#define G_ZCONSTIME 28 |
50 |
|
#define G_NZCONSTRAINTS 29 |
51 |
+ |
#define G_ZCONSTOL 30 |
52 |
+ |
#define G_ZCONSFORCEPOLICY 31 |
53 |
|
|
52 |
– |
|
54 |
|
Globals::Globals(){ |
55 |
|
|
56 |
|
int i; |
91 |
|
addHash( "tauBarostat", G_TAUBAROSTAT); |
92 |
|
addHash( "zconsTime", G_ZCONSTIME); |
93 |
|
addHash( "nZconstraints", G_NZCONSTRAINTS); |
94 |
< |
|
94 |
> |
addHash( "zconsTol", G_ZCONSTOL); |
95 |
> |
addHash( "zconsForcePolicy", G_ZCONSFORCEPOLICY); |
96 |
> |
|
97 |
> |
|
98 |
|
// define some default values |
99 |
|
|
100 |
|
strcpy( mixingRule,"standard"); //default mixing rules to standard. |
128 |
|
have_q_mass = 0; |
129 |
|
have_tau_thermostat = 0; |
130 |
|
have_tau_barostat = 0; |
131 |
< |
have_zcon_time = 0; |
131 |
> |
have_zcons_time = 0; |
132 |
|
have_n_zConstraints = 0; |
133 |
|
have_zConstraints = 0; |
134 |
< |
} |
134 |
> |
have_zcons_tol = 0; |
135 |
|
|
136 |
+ |
} |
137 |
+ |
|
138 |
|
Globals::~Globals(){ |
139 |
|
int i; |
140 |
|
|
252 |
|
|
253 |
|
case STRING: |
254 |
|
return current_zConstraint->assignString( the_event->evt.asmt.lhs, |
255 |
< |
the_event->evt.asmt.rhs.sval, |
256 |
< |
&(the_event->err_msg)); |
255 |
> |
the_event->evt.asmt.rhs.sval, |
256 |
> |
&(the_event->err_msg)); |
257 |
|
break; |
258 |
|
|
259 |
|
case DOUBLE: |
260 |
|
return current_zConstraint->assignDouble( the_event->evt.asmt.lhs, |
261 |
< |
the_event->evt.asmt.rhs.dval, |
262 |
< |
&(the_event->err_msg)); |
261 |
> |
the_event->evt.asmt.rhs.dval, |
262 |
> |
&(the_event->err_msg)); |
263 |
|
break; |
264 |
|
|
265 |
|
case INT: |
266 |
|
return current_zConstraint->assignInt( the_event->evt.asmt.lhs, |
267 |
< |
the_event->evt.asmt.rhs.ival, |
268 |
< |
&(the_event->err_msg)); |
267 |
> |
the_event->evt.asmt.rhs.ival, |
268 |
> |
&(the_event->err_msg)); |
269 |
|
break; |
270 |
|
|
271 |
|
default: |
723 |
|
} |
724 |
|
break; |
725 |
|
|
726 |
< |
case G_THERMALTIME: |
726 |
> |
case G_THERMALTIME: |
727 |
|
switch( the_type ){ |
728 |
|
|
729 |
|
case STRING: |
981 |
|
} |
982 |
|
break; |
983 |
|
|
984 |
< |
case G_ZCONSTIME: |
984 |
> |
case G_ZCONSTIME: |
985 |
|
switch( the_type ){ |
986 |
|
|
987 |
|
case STRING: |
992 |
|
|
993 |
|
case DOUBLE: |
994 |
|
zcons_time = the_event->evt.asmt.rhs.dval; |
995 |
+ |
have_zcons_time = 1; |
996 |
|
return 1; |
997 |
|
break; |
998 |
|
|
999 |
|
case INT: |
1000 |
|
zcons_time = (double)the_event->evt.asmt.rhs.ival; |
1001 |
< |
have_zcon_time = 1; |
1001 |
> |
have_zcons_time = 1; |
1002 |
|
return 1; |
1003 |
|
break; |
1004 |
|
|
1005 |
|
default: |
1006 |
|
the_event->err_msg = |
1007 |
|
strdup( "Global error. zcons_time unrecognized.\n" ); |
1008 |
+ |
return 0; |
1009 |
+ |
break; |
1010 |
+ |
} |
1011 |
+ |
break; |
1012 |
+ |
|
1013 |
+ |
case G_ZCONSTOL: |
1014 |
+ |
switch( the_type ){ |
1015 |
+ |
|
1016 |
+ |
case STRING: |
1017 |
+ |
the_event->err_msg = |
1018 |
+ |
strdup( "Global error. zcons_tol is not a double or int.\n" ); |
1019 |
+ |
return 0; |
1020 |
+ |
break; |
1021 |
+ |
|
1022 |
+ |
case DOUBLE: |
1023 |
+ |
zcons_tol = the_event->evt.asmt.rhs.dval; |
1024 |
+ |
have_zcons_tol = 1; |
1025 |
+ |
return 1; |
1026 |
+ |
break; |
1027 |
+ |
|
1028 |
+ |
case INT: |
1029 |
+ |
zcons_tol = (double)the_event->evt.asmt.rhs.ival; |
1030 |
+ |
have_zcons_tol = 1; |
1031 |
+ |
return 1; |
1032 |
+ |
break; |
1033 |
+ |
|
1034 |
+ |
default: |
1035 |
+ |
the_event->err_msg = |
1036 |
+ |
strdup( "Global error. zcons_ol unrecognized.\n" ); |
1037 |
|
return 0; |
1038 |
|
break; |
1039 |
|
} |
1040 |
|
break; |
1041 |
|
|
1042 |
+ |
case G_ZCONSFORCEPOLICY: |
1043 |
+ |
switch( the_type ){ |
1044 |
+ |
|
1045 |
+ |
case STRING: |
1046 |
+ |
strcpy(zconsForcePolicy, the_event->evt.asmt.rhs.sval); |
1047 |
|
|
1048 |
+ |
for(int i = 0; zconsForcePolicy[i] != '\0'; i++) |
1049 |
+ |
{ |
1050 |
+ |
zconsForcePolicy[i] = toupper(zconsForcePolicy[i]); |
1051 |
+ |
} |
1052 |
+ |
have_zcons_force_policy = 1; |
1053 |
+ |
return 1; |
1054 |
+ |
break; |
1055 |
+ |
|
1056 |
+ |
case DOUBLE: |
1057 |
+ |
the_event->err_msg = |
1058 |
+ |
strdup( "Global error. zconsForcePolicy is not a double or int.\n" ); |
1059 |
+ |
return 0; |
1060 |
+ |
break; |
1061 |
+ |
|
1062 |
+ |
case INT: |
1063 |
+ |
the_event->err_msg = |
1064 |
+ |
strdup( "Global error. zconsForcePolicy is not a double or int.\n" ); |
1065 |
+ |
return 0; |
1066 |
+ |
break; |
1067 |
+ |
|
1068 |
+ |
default: |
1069 |
+ |
the_event->err_msg = |
1070 |
+ |
strdup( "Global error. zconsForcePolicy unrecognized.\n" ); |
1071 |
+ |
return 0; |
1072 |
+ |
break; |
1073 |
+ |
} |
1074 |
+ |
break; |
1075 |
|
// add more token cases here. |
1076 |
|
|
1077 |
|
} |