1 |
< |
#include <cstdlib> |
2 |
< |
#include <cstdio> |
3 |
< |
#include <cstring> |
1 |
> |
#include <stdlib.h> |
2 |
> |
#include <stdio.h> |
3 |
> |
#include <string.h> |
4 |
|
|
5 |
|
#include "Globals.hpp" |
6 |
|
#include "simError.h" |
53 |
|
#define G_SEED 32 |
54 |
|
#define G_RESETTIME 33 |
55 |
|
#define G_USEINITTIME 34 |
56 |
+ |
#define G_USEINIT_XS_STATE 35 |
57 |
+ |
#define G_ORTHOBOXTOLERANCE 36 |
58 |
|
|
59 |
+ |
|
60 |
|
Globals::Globals(){ |
61 |
|
|
62 |
|
int i; |
104 |
|
addHash( "zconsTol", G_ZCONSTOL); |
105 |
|
addHash( "zconsForcePolicy", G_ZCONSFORCEPOLICY); |
106 |
|
addHash( "seed", G_SEED); |
107 |
< |
addHash( "useInitTime", G_USEINITTIME), |
107 |
> |
addHash( "useInitialTime", G_USEINITTIME); |
108 |
> |
addHash( "useInitialExtendedSystemState", G_USEINIT_XS_STATE); |
109 |
> |
addHash( "orthoBoxTolerance", G_ORTHOBOXTOLERANCE); |
110 |
|
|
111 |
|
|
112 |
|
// define some default values |
115 |
|
usePBC = 1; //default periodic boundry conditions to on |
116 |
|
useRF = 0; |
117 |
|
useInitTime = 1; // default to pull init time from the init file |
118 |
< |
|
118 |
> |
useInitXSstate = 1; // default to pull the extended state from the init file |
119 |
> |
orthoBoxTolerance = 1E-6; |
120 |
> |
|
121 |
|
have_force_field = 0; |
122 |
|
have_n_components = 0; |
123 |
|
have_target_temp = 0; |
400 |
|
default: |
401 |
|
the_event->err_msg = |
402 |
|
strdup( "Global error. targetTemp unrecognized.\n" ); |
403 |
+ |
return 0; |
404 |
+ |
break; |
405 |
+ |
} |
406 |
+ |
break; |
407 |
+ |
|
408 |
+ |
case G_ORTHOBOXTOLERANCE: |
409 |
+ |
switch( the_type ){ |
410 |
+ |
|
411 |
+ |
case STRING: |
412 |
+ |
the_event->err_msg = |
413 |
+ |
strdup( "Global error. orthoBoxTolerance is not a double or int.\n" ); |
414 |
+ |
return 0; |
415 |
+ |
break; |
416 |
+ |
|
417 |
+ |
case DOUBLE: |
418 |
+ |
orthoBoxTolerance = the_event->evt.asmt.rhs.dval; |
419 |
+ |
have_target_temp = 1; |
420 |
+ |
return 1; |
421 |
+ |
break; |
422 |
+ |
|
423 |
+ |
case INT: |
424 |
+ |
orthoBoxTolerance = (double)the_event->evt.asmt.rhs.ival; |
425 |
+ |
have_target_temp = 1; |
426 |
+ |
return 1; |
427 |
+ |
break; |
428 |
+ |
|
429 |
+ |
default: |
430 |
+ |
the_event->err_msg = |
431 |
+ |
strdup( "Global error.orthoBoxTolerance unrecognized.\n" ); |
432 |
|
return 0; |
433 |
|
break; |
434 |
|
} |
950 |
|
|
951 |
|
the_event->err_msg = |
952 |
|
strdup( "Global error. useInitTime was not \"true\" or \"false\".\n" ); |
953 |
+ |
return 0; |
954 |
+ |
break; |
955 |
+ |
|
956 |
+ |
case G_USEINIT_XS_STATE: |
957 |
+ |
if( the_type == STRING ){ |
958 |
+ |
|
959 |
+ |
if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) |
960 |
+ |
useInitXSstate = 1; |
961 |
+ |
else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) |
962 |
+ |
useInitXSstate = 0; |
963 |
+ |
else{ |
964 |
+ |
the_event->err_msg = |
965 |
+ |
strdup( "Global error. useInitExtendedSystemState was not \"true\" or \"false\".\n" ); |
966 |
+ |
return 0; |
967 |
+ |
} |
968 |
+ |
return 1; |
969 |
+ |
} |
970 |
+ |
|
971 |
+ |
the_event->err_msg = |
972 |
+ |
strdup( "Global error. useInitExtendedSystemState was not \"true\" or \"false\".\n" ); |
973 |
|
return 0; |
974 |
|
break; |
975 |
|
|