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

Comparing trunk/mdtools/interface_implementation/Globals.cpp (file contents):
Revision 178 by mmeineke, Mon Nov 18 21:24:02 2002 UTC vs.
Revision 282 by chuckv, Mon Feb 24 21:26:54 2003 UTC

# Line 39 | Line 39
39   #define G_DIELECTRIC    18
40   #define G_TEMPSET       19
41   #define G_THERMALTIME   20
42 + #define G_USEPBC 21
43 + #define G_MIXINGRULE 22
44  
45  
46   Globals::Globals(){
# Line 54 | Line 56 | Globals::Globals(){
56    addHash( "nComponents",   G_NCOMPONENTS );
57    addHash( "targetTemp",    G_TARGETTEMP );
58    addHash( "ensemble",      G_ENSEMBLE );
59 +
60    addHash( "dt",            G_DT );
61    addHash( "runTime",       G_RUNTIME );
62  
# Line 71 | Line 74 | Globals::Globals(){
74    addHash( "dielectric",    G_DIELECTRIC );
75    addHash( "tempSet",       G_TEMPSET );
76    addHash( "thermalTime",   G_THERMALTIME );
77 +  addHash("mixingRule", G_MIXINGRULE);
78 +  mixingRule = "standard"; //default mixing rules to standard.
79 +  addHash("periodicBoundryConditions", G_USEPBC);
80 +  usePBC = 1; //default  periodic boundry conditions to on
81 +  
82  
83    have_force_field =  0;
84    have_n_components = 0;
# Line 94 | Line 102 | Globals::Globals(){
102    have_rrf =            0;
103    have_dielectric =     0;
104    have_tempSet =        0;
105 < }
105 > }
106  
107   Globals::~Globals(){
108    int i;
# Line 273 | Line 281 | int Globals::globalAssign( event* the_event ){
281          strdup( "Global error. ensemble was not assigned to a string\n" );
282        return 0;
283        break;      
284 +
285 +    case G_MIXINGRULE:
286 +      if( the_type == STRING ){
287 +        strcpy( mixingRule, the_event->evt.asmt.rhs.sval );
288 +        return 1;
289 +      }
290        
291 +      the_event->err_msg =
292 +        strdup( "Global error. mixing rule was not assigned to a string\n" );
293 +      return 0;
294 +      break;      
295 +      
296      case G_DT:
297        switch( the_type ){
298          
# Line 693 | Line 712 | int Globals::globalAssign( event* the_event ){
712          strdup( "Global error. tempSet was not \"true\" or \"false\".\n" );
713        return 0;
714        break;
715 +      
716 +    case G_USEPBC:
717 +      if( the_type == STRING ){
718 +        
719 +        if( !strcmp( "true", the_event->evt.asmt.rhs.sval )) usePBC = 1;
720 +        else if( !strcmp( "false", the_event->evt.asmt.rhs.sval )) usePBC = 0;
721 +        else{
722 +          the_event->err_msg =
723 +            strdup( "Global error. periodicBoundryConditions was not \"true\" or \"false\".\n" );
724 +          return 0;
725 +        }
726 +        return 1;
727 +      }
728 +      
729 +      the_event->err_msg =
730 +        strdup( "Global error. tempSet was not \"true\" or \"false\".\n" );
731 +      return 0;
732 +      break;
733      }
734    }
735    

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines