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 1137 by gezelter, Wed Apr 28 21:39:12 2004 UTC vs.
Revision 1252 by gezelter, Mon Jun 7 14:26:33 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
70 < #define G_USEMOLECULARCUTOFFS 49
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_SOLID_THERM_INT     48
70 > #define G_USE_LIQUID_THERM_INT    49
71 > #define G_THERM_INT_LAMBDA  50
72 > #define G_THERM_INT_K       51
73  
74   Globals::Globals(){
75    
# Line 100 | Line 102 | Globals::Globals(){
102    addHash( "sampleTime",    G_SAMPLETIME );
103    addHash( "resetTime",     G_RESETTIME );
104    addHash( "statusTime",    G_STATUSTIME );
105 <  addHash( "electrostaticCutoffRadius",            G_ECR );
105 >  addHash( "cutoffRadius",  G_RCUT );
106 >  addHash( "switchingRadius",  G_RSW );
107    addHash( "dielectric",    G_DIELECTRIC );
108    addHash( "tempSet",       G_TEMPSET );
109    addHash( "thermalTime",   G_THERMALTIME );
110    addHash( "mixingRule",    G_MIXINGRULE);
111    addHash( "usePeriodicBoundaryConditions",        G_USEPBC);
109  addHash( "electrostaticSkinThickness",           G_EST );
112    addHash( "useReactionField",                     G_USERF );
113    addHash( "targetPressure",                       G_TARGETPRESSURE);
114    addHash( "tauThermostat",                        G_TAUTHERMOSTAT);
# Line 119 | Line 121 | Globals::Globals(){
121    addHash( "useInitialTime",                       G_USEINITTIME);
122    addHash( "useInitialExtendedSystemState",        G_USEINIT_XS_STATE);
123    addHash( "orthoBoxTolerance",                    G_ORTHOBOXTOLERANCE);
124 <  addHash( "LJrcut",                               G_LJRCUT);
125 <  addHash( "minimizer", G_MINIMIZER);
126 <  addHash( "minMaxIter", G_MIN_MAXITER);
127 <  addHash( "minWriteFrq", G_MIN_WRITEFRQ);
128 <  addHash( "minStepSize", G_MIN_STEPSIZE);
129 <  addHash( "minFTol", G_MIN_FTOL);
130 <  addHash( "minGTol", G_MIN_GTOL);
131 <  addHash( "minLSTol", G_MIN_LSTOL);
132 <  addHash( "minLSMaxIter", G_MIN_LSMAXITER);
133 <  addHash( "zconsGap", G_ZCONSGAP);
134 <  addHash( "zconsFixtime", G_ZCONSFIXTIME);
135 <  addHash( "zconsUsingSMD", G_ZCONSUSINGSMD);
136 <  addHash( "useMolecularCutoffs", G_USEMOLECULARCUTOFFS);
124 >  addHash( "minimizer",                            G_MINIMIZER);
125 >  addHash( "minMaxIter",                           G_MIN_MAXITER);
126 >  addHash( "minWriteFrq",                          G_MIN_WRITEFRQ);
127 >  addHash( "minStepSize",                          G_MIN_STEPSIZE);
128 >  addHash( "minFTol",                              G_MIN_FTOL);
129 >  addHash( "minGTol",                              G_MIN_GTOL);
130 >  addHash( "minLSTol",                             G_MIN_LSTOL);
131 >  addHash( "minLSMaxIter",                         G_MIN_LSMAXITER);
132 >  addHash( "zconsGap",                             G_ZCONSGAP);
133 >  addHash( "zconsFixtime",                         G_ZCONSFIXTIME);
134 >  addHash( "zconsUsingSMD",                        G_ZCONSUSINGSMD);
135 >  addHash( "useSolidThermInt",                     G_USE_SOLID_THERM_INT);
136 >  addHash( "useLiquidThermInt",                    G_USE_LIQUID_THERM_INT);
137 >  addHash( "thermodynamicIntegrationLambda",       G_THERM_INT_LAMBDA);
138 >  addHash( "thermodynamicIntegrationK",            G_THERM_INT_K);
139  
140    strcpy( mixingRule,"standard");  //default mixing rules to standard.
141    usePBC = 1; //default  periodic boundry conditions to on
142    useRF  = 0;
139  useMolecularCutoffs = 0;
143    useInitTime = 0; // default to pull init time from the init file
144    useInitXSstate = 0; // default to pull the extended state from the init file
145    orthoBoxTolerance = 1E-6;
146 +  useSolidThermInt = 0; // default solid-state thermodynamic integration to off
147 +  useLiquidThermInt = 0; // default liquid thermodynamic integration to off
148  
149    have_force_field =  0;
150    have_n_components = 0;
# Line 161 | Line 166 | Globals::Globals(){
166    have_status_time =    0;
167    have_reset_time =     0;
168    have_thermal_time =   0;
169 <  have_ecr =            0;
169 >  have_rcut =           0;
170 >  have_rsw =            0;
171    have_dielectric =     0;
172    have_tempSet =        0;
167  have_est =            0;
173    have_target_pressure =0;
174    have_q_mass =         0;
175    have_tau_thermostat = 0;
# Line 177 | Line 182 | Globals::Globals(){
182    have_zcons_fixtime = 0;
183    have_zcons_using_smd = 0;  
184    have_seed = 0;
180  have_ljrcut = 0;
185    have_minimizer = 0;
186    have_minimizer_maxiteration = 0;
187    have_minimizer_writefrq = 0;
# Line 186 | Line 190 | Globals::Globals(){
190    have_minimizer_gtol = 0;
191    have_minimizer_ls_tol = 0;
192    have_minimizer_ls_maxiteration = 0;
193 <  have_use_molecular_cutoffs = 0;
193 >  have_thermodynamic_integration_lambda = 0;
194 >  have_thermodynamic_integration_k = 0;
195  
196   }
197  
# Line 864 | Line 869 | int Globals::globalAssign( event* the_event ){
869          break;
870        }
871        break;
867
868    case G_LJRCUT:
869      switch( the_type ){
870        
871      case STRING:
872        the_event->err_msg =
873          strdup( "Global error. LJrcut is not a double or int.\n" );
874        return 0;
875        break;
876        
877      case DOUBLE:
878        LJrcut = the_event->evt.asmt.rhs.dval;
879        have_ljrcut = 1;
880        return 1;
881        break;
882        
883      case INT:
884        LJrcut = (double)the_event->evt.asmt.rhs.ival;
885        have_ljrcut = 1;
886        return 1;
887        break;
888        
889      default:
890        the_event->err_msg =
891          strdup( "Global error. LJrcut unrecognized.\n" );
892        return 0;
893        break;
894      }
895      break;
872        
873 <    case G_ECR:
873 >    case G_RCUT:
874        switch( the_type ){
875          
876        case STRING:
877          the_event->err_msg =
878 <          strdup( "Global error. electrostaticCutoffRadius is not a double or int.\n" );
878 >          strdup( "Global error. cutoffRadius is not a double or int.\n" );
879          return 0;
880          break;
881          
882        case DOUBLE:
883 <        ecr = the_event->evt.asmt.rhs.dval;
884 <        have_ecr = 1;
883 >        rcut = the_event->evt.asmt.rhs.dval;
884 >        have_rcut = 1;
885          return 1;
886          break;
887          
888        case INT:
889 <        ecr = (double)the_event->evt.asmt.rhs.ival;
890 <        have_ecr = 1;
889 >        rcut = (double)the_event->evt.asmt.rhs.ival;
890 >        have_rcut = 1;
891          return 1;
892          break;
893          
894        default:
895          the_event->err_msg =
896 <          strdup( "Global error. electrostaticCutoffRadius unrecognized.\n" );
896 >          strdup( "Global error. cutoffRadius unrecognized.\n" );
897          return 0;
898          break;
899        }
900        break;
901  
902 <    case G_EST:
902 >    case G_RSW:
903        switch( the_type ){
904          
905        case STRING:
906          the_event->err_msg =
907 <          strdup( "Global error. electrostaticSkinThickness is not a double or int.\n" );
907 >          strdup( "Global error. switchingRadius is not a double or int.\n" );
908          return 0;
909          break;
910          
911        case DOUBLE:
912 <        est = the_event->evt.asmt.rhs.dval;
913 <        have_est = 1;
912 >        rsw = the_event->evt.asmt.rhs.dval;
913 >        have_rsw = 1;
914          return 1;
915          break;
916          
917        case INT:
918 <        est = (double)the_event->evt.asmt.rhs.ival;
919 <        have_est = 1;
918 >        rsw = (double)the_event->evt.asmt.rhs.ival;
919 >        have_rsw = 1;
920          return 1;
921          break;
922          
923        default:
924          the_event->err_msg =
925 <          strdup( "Global error. electrostaticSkinThickness unrecognized.\n" );
925 >          strdup( "Global error. switchingRadius unrecognized.\n" );
926          return 0;
927          break;
928        }
# Line 1071 | Line 1047 | int Globals::globalAssign( event* the_event ){
1047        
1048        the_event->err_msg =
1049          strdup( "Global error. useReactionField was not \"true\" or \"false\".\n" );
1074      return 0;
1075      break;
1076
1077    case G_USEMOLECULARCUTOFFS:
1078      if( the_type == STRING ){
1079        
1080        if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) useMolecularCutoffs = 1;
1081        else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) useMolecularCutoffs = 0;
1082        else{
1083          the_event->err_msg =
1084            strdup( "Global error. useMolecularCutoffs was not \"true\" or \"false\".\n" );
1085          return 0;
1086        }
1087        return 1;
1088      }
1089      
1090      the_event->err_msg =
1091        strdup( "Global error. useMolecularCutoffs was not \"true\" or \"false\".\n" );
1050        return 0;
1051        break;
1052  
# Line 1401 | Line 1359 | int Globals::globalAssign( event* the_event ){
1359          break;
1360          
1361        case DOUBLE:
1362 <        minimizer_maxiteration = the_event->evt.asmt.rhs.dval;
1362 >        minimizer_maxiteration = (int)the_event->evt.asmt.rhs.dval;
1363          have_minimizer_maxiteration = 1;
1364          return 1;
1365          break;
# Line 1622 | Line 1580 | int Globals::globalAssign( event* the_event ){
1580            strdup( "Global error. seed unrecognized.\n" );
1581          return 0;
1582          break;
1583 +      }
1584 +      break;
1585 +
1586 +    case G_USE_SOLID_THERM_INT:
1587 +      if( the_type == STRING ){
1588 +        
1589 +        if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) useSolidThermInt = 1;
1590 +        else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) useSolidThermInt = 0;
1591 +        else{
1592 +          the_event->err_msg =
1593 +            strdup( "Global error. useSolidThermInt was not \"true\" or \"false\".\n" );
1594 +          return 0;
1595 +        }
1596 +        return 1;
1597 +      }
1598 +      
1599 +      the_event->err_msg =
1600 +        strdup( "Global error. useSolidThermInt was not \"true\" or \"false\".\n" );
1601 +      return 0;
1602 +      break;
1603 +
1604 +    case G_USE_LIQUID_THERM_INT:
1605 +      if( the_type == STRING ){
1606 +        
1607 +        if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) useLiquidThermInt = 1;
1608 +        else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) useLiquidThermInt = 0;
1609 +        else{
1610 +          the_event->err_msg =
1611 +            strdup( "Global error. useLiquidThermInt was not \"true\" or \"false\".\n" );
1612 +          return 0;
1613 +        }
1614 +        return 1;
1615        }
1616 +      
1617 +      the_event->err_msg =
1618 +        strdup( "Global error. useLiquidThermInt was not \"true\" or \"false\".\n" );
1619 +      return 0;
1620        break;
1621 +
1622 +    case G_THERM_INT_LAMBDA:
1623 +      switch( the_type ){
1624 +        
1625 +      case STRING:
1626 +        the_event->err_msg =
1627 +          strdup( "Global error. thermodynamicIntegrationLambda is not a double or int.\n" );
1628 +        return 1;
1629 +        break;
1630 +        
1631 +      case DOUBLE:
1632 +        thermodynamic_integration_lambda = the_event->evt.asmt.rhs.dval;
1633 +        have_thermodynamic_integration_lambda = 1;
1634 +        return 1;
1635 +        break;
1636 +        
1637 +      case INT:
1638 +        thermodynamic_integration_lambda = (double)the_event->evt.asmt.rhs.dval;
1639 +        have_thermodynamic_integration_lambda = 1;
1640 +        return 1;
1641 +        break;
1642 +        
1643 +      default:
1644 +        the_event->err_msg =
1645 +          strdup( "Global error. thermodynamicIntegrationLambda unrecognized.\n" );
1646 +        return 0;
1647 +        break;
1648 +      }
1649 +      break;      
1650 +
1651 +    case G_THERM_INT_K:
1652 +      switch( the_type ){
1653 +        
1654 +      case STRING:
1655 +        the_event->err_msg =
1656 +          strdup( "Global error. thermodynamicIntegrationK is not a double or int.\n" );
1657 +        return 1;
1658 +        break;
1659 +        
1660 +      case DOUBLE:
1661 +        thermodynamic_integration_k = the_event->evt.asmt.rhs.dval;
1662 +        have_thermodynamic_integration_k = 1;
1663 +        return 1;
1664 +        break;
1665 +        
1666 +      case INT:
1667 +        thermodynamic_integration_k = (double)the_event->evt.asmt.rhs.dval;
1668 +        have_thermodynamic_integration_k = 1;
1669 +        return 1;
1670 +        break;
1671 +        
1672 +      default:
1673 +        the_event->err_msg =
1674 +          strdup( "Global error. thermodynamicIntegrationK unrecognized.\n" );
1675 +        return 0;
1676 +        break;
1677 +      }
1678 +      break;      
1679        // add more token cases here.
1680  
1681      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines