48 |
|
#define G_TAUBAROSTAT 27 |
49 |
|
#define G_ZCONSTIME 28 |
50 |
|
#define G_NZCONSTRAINTS 29 |
51 |
< |
#define G_ZCONSTOL 30 |
51 |
> |
#define G_ZCONSTOL 30 |
52 |
|
#define G_ZCONSFORCEPOLICY 31 |
53 |
+ |
#define G_SEED 32 |
54 |
+ |
#define G_RESETTIME 33 |
55 |
|
|
56 |
|
Globals::Globals(){ |
57 |
|
|
58 |
|
int i; |
59 |
+ |
|
60 |
+ |
hash_size = 23; |
61 |
+ |
hash_shift = 4; |
62 |
|
|
63 |
|
components = NULL; |
64 |
|
|
82 |
|
addHash( "boxY", G_BOXY ); |
83 |
|
addHash( "boxZ", G_BOXZ ); |
84 |
|
addHash( "sampleTime", G_SAMPLETIME ); |
85 |
+ |
addHash( "resetTime", G_RESETTIME ); |
86 |
|
addHash( "statusTime", G_STATUSTIME ); |
87 |
|
addHash( "electrostaticCutoffRadius", G_ECR ); |
88 |
|
addHash( "dielectric", G_DIELECTRIC ); |
97 |
|
addHash( "tauBarostat", G_TAUBAROSTAT); |
98 |
|
addHash( "zconsTime", G_ZCONSTIME); |
99 |
|
addHash( "nZconstraints", G_NZCONSTRAINTS); |
100 |
< |
addHash( "zconsTol", G_ZCONSTOL); |
101 |
< |
addHash( "zconsForcePolicy", G_ZCONSFORCEPOLICY); |
100 |
> |
addHash( "zconsTol", G_ZCONSTOL); |
101 |
> |
addHash( "zconsForcePolicy", G_ZCONSFORCEPOLICY); |
102 |
> |
addHash( "seed", G_SEED); |
103 |
|
|
104 |
|
|
105 |
|
// define some default values |
126 |
|
have_box_z = 0; |
127 |
|
have_sample_time = 0; |
128 |
|
have_status_time = 0; |
129 |
+ |
have_reset_time = 0; |
130 |
|
have_thermal_time = 0; |
131 |
|
have_ecr = 0; |
132 |
|
have_dielectric = 0; |
140 |
|
have_n_zConstraints = 0; |
141 |
|
have_zConstraints = 0; |
142 |
|
have_zcons_tol = 0; |
143 |
+ |
have_seed = 0; |
144 |
|
|
145 |
|
} |
146 |
|
|
727 |
|
default: |
728 |
|
the_event->err_msg = |
729 |
|
strdup( "Global error. statusTime unrecognized.\n" ); |
730 |
+ |
return 0; |
731 |
+ |
break; |
732 |
+ |
} |
733 |
+ |
break; |
734 |
+ |
|
735 |
+ |
case G_RESETTIME: |
736 |
+ |
switch( the_type ){ |
737 |
+ |
|
738 |
+ |
case STRING: |
739 |
+ |
the_event->err_msg = |
740 |
+ |
strdup( "Global error. resetTime is not a double or int.\n" ); |
741 |
+ |
return 0; |
742 |
+ |
break; |
743 |
+ |
|
744 |
+ |
case DOUBLE: |
745 |
+ |
resetTime = the_event->evt.asmt.rhs.dval; |
746 |
+ |
have_reset_time = 1; |
747 |
+ |
return 1; |
748 |
+ |
break; |
749 |
+ |
|
750 |
+ |
case INT: |
751 |
+ |
resetTime = (double)the_event->evt.asmt.rhs.ival; |
752 |
+ |
have_reset_time = 1; |
753 |
+ |
return 1; |
754 |
+ |
break; |
755 |
+ |
|
756 |
+ |
default: |
757 |
+ |
the_event->err_msg = |
758 |
+ |
strdup( "Global error. resetTime unrecognized.\n" ); |
759 |
|
return 0; |
760 |
|
break; |
761 |
|
} |
1106 |
|
default: |
1107 |
|
the_event->err_msg = |
1108 |
|
strdup( "Global error. zconsForcePolicy unrecognized.\n" ); |
1109 |
+ |
return 0; |
1110 |
+ |
break; |
1111 |
+ |
} |
1112 |
+ |
break; |
1113 |
+ |
// add more token cases here. |
1114 |
+ |
case G_SEED: |
1115 |
+ |
switch( the_type ){ |
1116 |
+ |
|
1117 |
+ |
case STRING: |
1118 |
+ |
the_event->err_msg = |
1119 |
+ |
strdup( "Global error. seed is not a string.\n" ); |
1120 |
+ |
return 0; |
1121 |
+ |
return 0; |
1122 |
+ |
break; |
1123 |
+ |
|
1124 |
+ |
case DOUBLE: |
1125 |
+ |
have_seed = 1; |
1126 |
+ |
seed = (int)the_event->evt.asmt.rhs.dval; |
1127 |
+ |
return 1; |
1128 |
+ |
break; |
1129 |
+ |
|
1130 |
+ |
case INT: |
1131 |
+ |
have_seed = 1; |
1132 |
+ |
seed = the_event->evt.asmt.rhs.ival ; |
1133 |
+ |
return 1; |
1134 |
+ |
break; |
1135 |
+ |
|
1136 |
+ |
default: |
1137 |
+ |
the_event->err_msg = |
1138 |
+ |
strdup( "Global error. seed unrecognized.\n" ); |
1139 |
|
return 0; |
1140 |
|
break; |
1141 |
|
} |