ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libBASS/Globals.cpp
(Generate patch)

Comparing trunk/OOPSE/libBASS/Globals.cpp (file contents):
Revision 704 by tim, Wed Aug 20 19:11:51 2003 UTC vs.
Revision 828 by gezelter, Tue Oct 28 16:03:06 2003 UTC

# Line 1 | Line 1
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"
# Line 48 | Line 48
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
53 > #define G_SEED           32
54 > #define G_RESETTIME      33
55 > #define G_USEINITTIME    34
56  
57   Globals::Globals(){
58    
59    int i;
60 +
61 +  hash_size = 23;
62 +  hash_shift = 4;
63    
64    components = NULL;
65    
# Line 78 | Line 83 | Globals::Globals(){
83    addHash( "boxY",          G_BOXY );
84    addHash( "boxZ",          G_BOXZ );
85    addHash( "sampleTime",    G_SAMPLETIME );
86 +  addHash( "resetTime",     G_RESETTIME );
87    addHash( "statusTime",    G_STATUSTIME );
88    addHash( "electrostaticCutoffRadius",            G_ECR );
89    addHash( "dielectric",    G_DIELECTRIC );
# Line 92 | Line 98 | Globals::Globals(){
98    addHash( "tauBarostat",                          G_TAUBAROSTAT);
99    addHash( "zconsTime",                            G_ZCONSTIME);
100    addHash( "nZconstraints",                        G_NZCONSTRAINTS);
101 <  addHash( "zconsTol",                               G_ZCONSTOL);
102 <  addHash( "zconsForcePolicy",                    G_ZCONSFORCEPOLICY);
103 <  addHash( "seed",                                     G_SEED);
101 >  addHash( "zconsTol",                             G_ZCONSTOL);
102 >  addHash( "zconsForcePolicy",                     G_ZCONSFORCEPOLICY);
103 >  addHash( "seed",                                 G_SEED);
104 >  addHash( "useInitTime",                          G_USEINITTIME),
105          
106          
107    // define some default values
# Line 102 | Line 109 | Globals::Globals(){
109    strcpy( mixingRule,"standard");  //default mixing rules to standard.
110    usePBC = 1; //default  periodic boundry conditions to on
111    useRF  = 0;
112 +  useInitTime = 1; // default to pull init time from the init file
113    
114    have_force_field =  0;
115    have_n_components = 0;
# Line 121 | Line 129 | Globals::Globals(){
129    have_box_z =          0;
130    have_sample_time =    0;
131    have_status_time =    0;
132 +  have_reset_time =     0;
133    have_thermal_time =   0;
134    have_ecr =            0;
135    have_dielectric =     0;
# Line 721 | Line 730 | int Globals::globalAssign( event* the_event ){
730        default:
731          the_event->err_msg =
732            strdup( "Global error. statusTime unrecognized.\n" );
733 +        return 0;
734 +        break;
735 +      }
736 +      break;
737 +
738 +    case G_RESETTIME:
739 +      switch( the_type ){
740 +        
741 +      case STRING:
742 +        the_event->err_msg =
743 +          strdup( "Global error. resetTime is not a double or int.\n" );
744 +        return 0;
745 +        break;
746 +        
747 +      case DOUBLE:
748 +        resetTime = the_event->evt.asmt.rhs.dval;
749 +        have_reset_time = 1;
750 +        return 1;
751 +        break;
752 +        
753 +      case INT:
754 +        resetTime = (double)the_event->evt.asmt.rhs.ival;
755 +        have_reset_time = 1;
756 +        return 1;
757 +        break;
758 +        
759 +      default:
760 +        the_event->err_msg =
761 +          strdup( "Global error. resetTime unrecognized.\n" );
762          return 0;
763          break;
764        }
# Line 860 | Line 898 | int Globals::globalAssign( event* the_event ){
898          strdup( "Global error. tempSet was not \"true\" or \"false\".\n" );
899        return 0;
900        break;
901 +
902 +    case G_USEINITTIME:
903 +      if( the_type == STRING ){
904 +        
905 +        if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) useInitTime = 1;
906 +        else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) useInitTime = 0;
907 +        else{
908 +          the_event->err_msg =
909 +            strdup( "Global error. useInitTime was not \"true\" or \"false\".\n" );
910 +          return 0;
911 +        }
912 +        return 1;
913 +      }
914 +      
915 +      the_event->err_msg =
916 +        strdup( "Global error. useInitTime was not \"true\" or \"false\".\n" );
917 +      return 0;
918 +      break;
919        
920      case G_USEPBC:
921        if( the_type == STRING ){

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines