48 |
|
#define G_TAUBAROSTAT 27 |
49 |
|
#define G_ZCONSTIME 28 |
50 |
|
#define G_NZCONSTRAINTS 29 |
51 |
+ |
#define G_ZCONSTOL 30 |
52 |
|
|
52 |
– |
|
53 |
|
Globals::Globals(){ |
54 |
|
|
55 |
|
int i; |
90 |
|
addHash( "tauBarostat", G_TAUBAROSTAT); |
91 |
|
addHash( "zconsTime", G_ZCONSTIME); |
92 |
|
addHash( "nZconstraints", G_NZCONSTRAINTS); |
93 |
< |
|
93 |
> |
addHash( "zconsTol", G_ZCONSTOL); |
94 |
> |
|
95 |
|
// define some default values |
96 |
|
|
97 |
|
strcpy( mixingRule,"standard"); //default mixing rules to standard. |
125 |
|
have_q_mass = 0; |
126 |
|
have_tau_thermostat = 0; |
127 |
|
have_tau_barostat = 0; |
128 |
< |
have_zcon_time = 0; |
128 |
> |
have_zcons_time = 0; |
129 |
|
have_n_zConstraints = 0; |
130 |
|
have_zConstraints = 0; |
131 |
< |
} |
131 |
> |
have_zcons_tol = 0; |
132 |
|
|
133 |
+ |
} |
134 |
+ |
|
135 |
|
Globals::~Globals(){ |
136 |
|
int i; |
137 |
|
|
249 |
|
|
250 |
|
case STRING: |
251 |
|
return current_zConstraint->assignString( the_event->evt.asmt.lhs, |
252 |
< |
the_event->evt.asmt.rhs.sval, |
253 |
< |
&(the_event->err_msg)); |
252 |
> |
the_event->evt.asmt.rhs.sval, |
253 |
> |
&(the_event->err_msg)); |
254 |
|
break; |
255 |
|
|
256 |
|
case DOUBLE: |
257 |
|
return current_zConstraint->assignDouble( the_event->evt.asmt.lhs, |
258 |
< |
the_event->evt.asmt.rhs.dval, |
259 |
< |
&(the_event->err_msg)); |
258 |
> |
the_event->evt.asmt.rhs.dval, |
259 |
> |
&(the_event->err_msg)); |
260 |
|
break; |
261 |
|
|
262 |
|
case INT: |
263 |
|
return current_zConstraint->assignInt( the_event->evt.asmt.lhs, |
264 |
< |
the_event->evt.asmt.rhs.ival, |
265 |
< |
&(the_event->err_msg)); |
264 |
> |
the_event->evt.asmt.rhs.ival, |
265 |
> |
&(the_event->err_msg)); |
266 |
|
break; |
267 |
|
|
268 |
|
default: |
720 |
|
} |
721 |
|
break; |
722 |
|
|
723 |
< |
case G_THERMALTIME: |
723 |
> |
case G_THERMALTIME: |
724 |
|
switch( the_type ){ |
725 |
|
|
726 |
|
case STRING: |
978 |
|
} |
979 |
|
break; |
980 |
|
|
981 |
< |
case G_ZCONSTIME: |
981 |
> |
case G_ZCONSTIME: |
982 |
|
switch( the_type ){ |
983 |
|
|
984 |
|
case STRING: |
989 |
|
|
990 |
|
case DOUBLE: |
991 |
|
zcons_time = the_event->evt.asmt.rhs.dval; |
992 |
+ |
have_zcons_time = 1; |
993 |
|
return 1; |
994 |
|
break; |
995 |
|
|
996 |
|
case INT: |
997 |
|
zcons_time = (double)the_event->evt.asmt.rhs.ival; |
998 |
< |
have_zcon_time = 1; |
998 |
> |
have_zcons_time = 1; |
999 |
|
return 1; |
1000 |
|
break; |
1001 |
|
|
1006 |
|
break; |
1007 |
|
} |
1008 |
|
break; |
1009 |
+ |
|
1010 |
+ |
case G_ZCONSTOL: |
1011 |
+ |
switch( the_type ){ |
1012 |
+ |
|
1013 |
+ |
case STRING: |
1014 |
+ |
the_event->err_msg = |
1015 |
+ |
strdup( "Global error. zcons_tol is not a double or int.\n" ); |
1016 |
+ |
return 0; |
1017 |
+ |
break; |
1018 |
+ |
|
1019 |
+ |
case DOUBLE: |
1020 |
+ |
zcons_tol = the_event->evt.asmt.rhs.dval; |
1021 |
+ |
have_zcons_tol = 1; |
1022 |
+ |
return 1; |
1023 |
+ |
break; |
1024 |
+ |
|
1025 |
+ |
case INT: |
1026 |
+ |
zcons_tol = (double)the_event->evt.asmt.rhs.ival; |
1027 |
+ |
have_zcons_tol = 1; |
1028 |
+ |
return 1; |
1029 |
+ |
break; |
1030 |
+ |
|
1031 |
+ |
default: |
1032 |
+ |
the_event->err_msg = |
1033 |
+ |
strdup( "Global error. zcons_ol unrecognized.\n" ); |
1034 |
+ |
return 0; |
1035 |
+ |
break; |
1036 |
+ |
} |
1037 |
+ |
break; |
1038 |
|
|
1039 |
|
|
1040 |
|
// add more token cases here. |