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 173 by mmeineke, Mon Nov 11 17:25:15 2002 UTC vs.
Revision 282 by chuckv, Mon Feb 24 21:26:54 2003 UTC

# Line 4 | Line 4
4  
5   #include "Globals.hpp"
6   #include "simError.h"
7 + #ifdef IS_MPI
8 + #include "mpiBASS.h"
9 + #endif // is_mpi
10  
11   /*
12   * The following section lists all of the defined tokens for the
# Line 36 | 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 51 | 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 68 | 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 91 | 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 268 | Line 279 | int Globals::globalAssign( event* the_event ){
279        
280        the_event->err_msg =
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        
# Line 683 | Line 705 | int Globals::globalAssign( event* the_event ){
705            return 0;
706          }
707          have_tempSet = 1;
708 +        return 1;
709 +      }
710 +      
711 +      the_event->err_msg =
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        

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines