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 1099 by gezelter, Mon Apr 12 20:33:12 2004 UTC vs.
Revision 1188 by chrisfen, Sat May 22 18:17:05 2004 UTC

# Line 35 | Line 35
35   #define G_BOXZ              14
36   #define G_SAMPLETIME        15
37   #define G_STATUSTIME        16
38 < #define G_ECR               17
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 < #define G_EST               23
38 > #define G_RCUT              17
39 > #define G_RSW               18
40 > #define G_DIELECTRIC        19
41 > #define G_TEMPSET           20
42 > #define G_THERMALTIME       21
43 > #define G_USEPBC            22
44 > #define G_MIXINGRULE        23
45   #define G_USERF             24
46   #define G_TARGETPRESSURE    25
47   #define G_TAUTHERMOSTAT     26
# Line 55 | Line 55
55   #define G_USEINITTIME       34
56   #define G_USEINIT_XS_STATE  35
57   #define G_ORTHOBOXTOLERANCE 36
58 < #define G_LJRCUT            37
59 < #define G_MINIMIZER 38
60 < #define G_MIN_MAXITER 39
61 < #define G_MIN_WRITEFRQ 40
62 < #define G_MIN_STEPSIZE 41
63 < #define G_MIN_FTOL 42
64 < #define G_MIN_GTOL 43
65 < #define G_MIN_LSTOL 44
66 < #define G_MIN_LSMAXITER 45
67 < #define G_ZCONSGAP 46
68 < #define G_ZCONSFIXTIME 47
69 < #define G_ZCONSUSINGSMD 48
58 > #define G_MINIMIZER         37
59 > #define G_MIN_MAXITER       38
60 > #define G_MIN_WRITEFRQ      39
61 > #define G_MIN_STEPSIZE      40
62 > #define G_MIN_FTOL          41
63 > #define G_MIN_GTOL          42
64 > #define G_MIN_LSTOL         43
65 > #define G_MIN_LSMAXITER     44
66 > #define G_ZCONSGAP          45
67 > #define G_ZCONSFIXTIME      46
68 > #define G_ZCONSUSINGSMD     47
69 > #define G_USE_THERM_INT     48
70 > #define G_THERM_INT_LAMBDA  49
71 > #define G_THERM_INT_K       50
72  
73   Globals::Globals(){
74    
# Line 99 | Line 101 | Globals::Globals(){
101    addHash( "sampleTime",    G_SAMPLETIME );
102    addHash( "resetTime",     G_RESETTIME );
103    addHash( "statusTime",    G_STATUSTIME );
104 <  addHash( "electrostaticCutoffRadius",            G_ECR );
104 >  addHash( "cutoffRadius",  G_RCUT );
105 >  addHash( "switchingRadius",  G_RSW );
106    addHash( "dielectric",    G_DIELECTRIC );
107    addHash( "tempSet",       G_TEMPSET );
108    addHash( "thermalTime",   G_THERMALTIME );
109    addHash( "mixingRule",    G_MIXINGRULE);
110    addHash( "usePeriodicBoundaryConditions",        G_USEPBC);
108  addHash( "electrostaticSkinThickness",           G_EST );
111    addHash( "useReactionField",                     G_USERF );
112    addHash( "targetPressure",                       G_TARGETPRESSURE);
113    addHash( "tauThermostat",                        G_TAUTHERMOSTAT);
# Line 118 | Line 120 | Globals::Globals(){
120    addHash( "useInitialTime",                       G_USEINITTIME);
121    addHash( "useInitialExtendedSystemState",        G_USEINIT_XS_STATE);
122    addHash( "orthoBoxTolerance",                    G_ORTHOBOXTOLERANCE);
121  addHash( "LJrcut",                               G_LJRCUT);
123    addHash( "minimizer", G_MINIMIZER);
124    addHash( "minMaxIter", G_MIN_MAXITER);
125    addHash( "minWriteFrq", G_MIN_WRITEFRQ);
# Line 129 | Line 130 | Globals::Globals(){
130    addHash( "minLSMaxIter", G_MIN_LSMAXITER);
131    addHash( "zconsGap", G_ZCONSGAP);
132    addHash( "zconsFixtime", G_ZCONSFIXTIME);
133 <    addHash( "zconsUsingSMD", G_ZCONSUSINGSMD);
133 >  addHash( "zconsUsingSMD", G_ZCONSUSINGSMD);
134 >  addHash( "useThermInt",                    G_USE_THERM_INT);
135 >  addHash( "thermodynamicIntegrationLambda", G_THERM_INT_LAMBDA);
136 >  addHash( "thermodynamicIntegrationK",      G_THERM_INT_K);
137  
138    strcpy( mixingRule,"standard");  //default mixing rules to standard.
139    usePBC = 1; //default  periodic boundry conditions to on
140    useRF  = 0;
141 <  useInitTime = 1; // default to pull init time from the init file
142 <  useInitXSstate = 1; // default to pull the extended state from the init file
141 >  useInitTime = 0; // default to pull init time from the init file
142 >  useInitXSstate = 0; // default to pull the extended state from the init file
143    orthoBoxTolerance = 1E-6;
144 +  useThermInt = 0; // default thermodynamic integration to off
145  
146    have_force_field =  0;
147    have_n_components = 0;
# Line 158 | Line 163 | Globals::Globals(){
163    have_status_time =    0;
164    have_reset_time =     0;
165    have_thermal_time =   0;
166 <  have_ecr =            0;
166 >  have_rcut =           0;
167 >  have_rsw =            0;
168    have_dielectric =     0;
169    have_tempSet =        0;
164  have_est =            0;
170    have_target_pressure =0;
171    have_q_mass =         0;
172    have_tau_thermostat = 0;
# Line 174 | Line 179 | Globals::Globals(){
179    have_zcons_fixtime = 0;
180    have_zcons_using_smd = 0;  
181    have_seed = 0;
177  have_ljrcut = 0;
182    have_minimizer = 0;
183    have_minimizer_maxiteration = 0;
184    have_minimizer_writefrq = 0;
# Line 183 | Line 187 | Globals::Globals(){
187    have_minimizer_gtol = 0;
188    have_minimizer_ls_tol = 0;
189    have_minimizer_ls_maxiteration = 0;
190 <
190 >  have_thermodynamic_integration_lambda = 0;
191 >  have_thermodynamic_integration_k = 0;
192  
193   }
194  
# Line 857 | Line 862 | int Globals::globalAssign( event* the_event ){
862        default:
863          the_event->err_msg =
864            strdup( "Global error. thermalTime unrecognized.\n" );
860        return 0;
861        break;
862      }
863      break;
864
865    case G_LJRCUT:
866      switch( the_type ){
867        
868      case STRING:
869        the_event->err_msg =
870          strdup( "Global error. LJrcut is not a double or int.\n" );
871        return 0;
872        break;
873        
874      case DOUBLE:
875        LJrcut = the_event->evt.asmt.rhs.dval;
876        have_ljrcut = 1;
877        return 1;
878        break;
879        
880      case INT:
881        LJrcut = (double)the_event->evt.asmt.rhs.ival;
882        have_ljrcut = 1;
883        return 1;
884        break;
885        
886      default:
887        the_event->err_msg =
888          strdup( "Global error. LJrcut unrecognized.\n" );
865          return 0;
866          break;
867        }
868        break;
869        
870 <    case G_ECR:
870 >    case G_RCUT:
871        switch( the_type ){
872          
873        case STRING:
874          the_event->err_msg =
875 <          strdup( "Global error. electrostaticCutoffRadius is not a double or int.\n" );
875 >          strdup( "Global error. cutoffRadius is not a double or int.\n" );
876          return 0;
877          break;
878          
879        case DOUBLE:
880 <        ecr = the_event->evt.asmt.rhs.dval;
881 <        have_ecr = 1;
880 >        rcut = the_event->evt.asmt.rhs.dval;
881 >        have_rcut = 1;
882          return 1;
883          break;
884          
885        case INT:
886 <        ecr = (double)the_event->evt.asmt.rhs.ival;
887 <        have_ecr = 1;
886 >        rcut = (double)the_event->evt.asmt.rhs.ival;
887 >        have_rcut = 1;
888          return 1;
889          break;
890          
891        default:
892          the_event->err_msg =
893 <          strdup( "Global error. electrostaticCutoffRadius unrecognized.\n" );
893 >          strdup( "Global error. cutoffRadius unrecognized.\n" );
894          return 0;
895          break;
896        }
897        break;
898  
899 <    case G_EST:
899 >    case G_RSW:
900        switch( the_type ){
901          
902        case STRING:
903          the_event->err_msg =
904 <          strdup( "Global error. electrostaticSkinThickness is not a double or int.\n" );
904 >          strdup( "Global error. switchingRadius is not a double or int.\n" );
905          return 0;
906          break;
907          
908        case DOUBLE:
909 <        est = the_event->evt.asmt.rhs.dval;
910 <        have_est = 1;
909 >        rsw = the_event->evt.asmt.rhs.dval;
910 >        have_rsw = 1;
911          return 1;
912          break;
913          
914        case INT:
915 <        est = (double)the_event->evt.asmt.rhs.ival;
916 <        have_est = 1;
915 >        rsw = (double)the_event->evt.asmt.rhs.ival;
916 >        have_rsw = 1;
917          return 1;
918          break;
919          
920        default:
921          the_event->err_msg =
922 <          strdup( "Global error. electrostaticSkinThickness unrecognized.\n" );
922 >          strdup( "Global error. switchingRadius unrecognized.\n" );
923          return 0;
924          break;
925        }
# Line 1601 | Line 1577 | int Globals::globalAssign( event* the_event ){
1577            strdup( "Global error. seed unrecognized.\n" );
1578          return 0;
1579          break;
1580 +      }
1581 +      break;
1582 +
1583 +    case G_USE_THERM_INT:
1584 +      if( the_type == STRING ){
1585 +        
1586 +        if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) useThermInt = 1;
1587 +        else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) useThermInt = 0;
1588 +        else{
1589 +          the_event->err_msg =
1590 +            strdup( "Global error. useThermInt was not \"true\" or \"false\".\n" );
1591 +          return 0;
1592 +        }
1593 +        return 1;
1594        }
1595 +      
1596 +      the_event->err_msg =
1597 +        strdup( "Global error. useThermInt was not \"true\" or \"false\".\n" );
1598 +      return 0;
1599        break;
1600 +
1601 +    case G_THERM_INT_LAMBDA:
1602 +      switch( the_type ){
1603 +        
1604 +      case STRING:
1605 +        the_event->err_msg =
1606 +          strdup( "Global error. thermodynamicIntegrationLambda is not a double or int.\n" );
1607 +        return 1;
1608 +        break;
1609 +        
1610 +      case DOUBLE:
1611 +        thermodynamic_integration_lambda = the_event->evt.asmt.rhs.dval;
1612 +        have_thermodynamic_integration_lambda = 1;
1613 +        return 1;
1614 +        break;
1615 +        
1616 +      case INT:
1617 +        thermodynamic_integration_lambda = (double)the_event->evt.asmt.rhs.dval;
1618 +        have_thermodynamic_integration_lambda = 1;
1619 +        return 1;
1620 +        break;
1621 +        
1622 +      default:
1623 +        the_event->err_msg =
1624 +          strdup( "Global error. thermodynamicIntegrationLambda unrecognized.\n" );
1625 +        return 0;
1626 +        break;
1627 +      }
1628 +      break;      
1629 +
1630 +    case G_THERM_INT_K:
1631 +      switch( the_type ){
1632 +        
1633 +      case STRING:
1634 +        the_event->err_msg =
1635 +          strdup( "Global error. thermodynamicIntegrationK is not a double or int.\n" );
1636 +        return 1;
1637 +        break;
1638 +        
1639 +      case DOUBLE:
1640 +        thermodynamic_integration_k = the_event->evt.asmt.rhs.dval;
1641 +        have_thermodynamic_integration_k = 1;
1642 +        return 1;
1643 +        break;
1644 +        
1645 +      case INT:
1646 +        thermodynamic_integration_k = (double)the_event->evt.asmt.rhs.dval;
1647 +        have_thermodynamic_integration_k = 1;
1648 +        return 1;
1649 +        break;
1650 +        
1651 +      default:
1652 +        the_event->err_msg =
1653 +          strdup( "Global error. thermodynamicIntegrationK unrecognized.\n" );
1654 +        return 0;
1655 +        break;
1656 +      }
1657 +      break;      
1658        // add more token cases here.
1659  
1660      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines