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 |
+ |
#define G_FORCEFIELD_VARIANT 52 |
74 |
|
|
75 |
|
Globals::Globals(){ |
76 |
|
|
122 |
|
addHash( "useInitialTime", G_USEINITTIME); |
123 |
|
addHash( "useInitialExtendedSystemState", G_USEINIT_XS_STATE); |
124 |
|
addHash( "orthoBoxTolerance", G_ORTHOBOXTOLERANCE); |
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); |
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( "useSolidThermInt", G_USE_SOLID_THERM_INT); |
137 |
> |
addHash( "useLiquidThermInt", G_USE_LIQUID_THERM_INT); |
138 |
> |
addHash( "thermodynamicIntegrationLambda", G_THERM_INT_LAMBDA); |
139 |
> |
addHash( "thermodynamicIntegrationK", G_THERM_INT_K); |
140 |
> |
addHash( "forceFieldVariant", G_FORCEFIELD_VARIANT); |
141 |
|
|
142 |
|
strcpy( mixingRule,"standard"); //default mixing rules to standard. |
143 |
|
usePBC = 1; //default periodic boundry conditions to on |
145 |
|
useInitTime = 0; // default to pull init time from the init file |
146 |
|
useInitXSstate = 0; // default to pull the extended state from the init file |
147 |
|
orthoBoxTolerance = 1E-6; |
148 |
+ |
useSolidThermInt = 0; // default solid-state thermodynamic integration to off |
149 |
+ |
useLiquidThermInt = 0; // default liquid thermodynamic integration to off |
150 |
|
|
151 |
|
have_force_field = 0; |
152 |
|
have_n_components = 0; |
192 |
|
have_minimizer_gtol = 0; |
193 |
|
have_minimizer_ls_tol = 0; |
194 |
|
have_minimizer_ls_maxiteration = 0; |
195 |
+ |
have_thermodynamic_integration_lambda = 0; |
196 |
+ |
have_thermodynamic_integration_k = 0; |
197 |
+ |
have_forcefield_variant = 0; |
198 |
|
|
199 |
|
} |
200 |
|
|
1362 |
|
break; |
1363 |
|
|
1364 |
|
case DOUBLE: |
1365 |
< |
minimizer_maxiteration = the_event->evt.asmt.rhs.dval; |
1365 |
> |
minimizer_maxiteration = (int)the_event->evt.asmt.rhs.dval; |
1366 |
|
have_minimizer_maxiteration = 1; |
1367 |
|
return 1; |
1368 |
|
break; |
1585 |
|
break; |
1586 |
|
} |
1587 |
|
break; |
1573 |
– |
// add more token cases here. |
1588 |
|
|
1589 |
+ |
case G_USE_SOLID_THERM_INT: |
1590 |
+ |
if( the_type == STRING ){ |
1591 |
+ |
|
1592 |
+ |
if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) useSolidThermInt = 1; |
1593 |
+ |
else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) useSolidThermInt = 0; |
1594 |
+ |
else{ |
1595 |
+ |
the_event->err_msg = |
1596 |
+ |
strdup( "Global error. useSolidThermInt was not \"true\" or \"false\".\n" ); |
1597 |
+ |
return 0; |
1598 |
+ |
} |
1599 |
+ |
return 1; |
1600 |
+ |
} |
1601 |
+ |
|
1602 |
+ |
the_event->err_msg = |
1603 |
+ |
strdup( "Global error. useSolidThermInt was not \"true\" or \"false\".\n" ); |
1604 |
+ |
return 0; |
1605 |
+ |
break; |
1606 |
+ |
|
1607 |
+ |
case G_USE_LIQUID_THERM_INT: |
1608 |
+ |
if( the_type == STRING ){ |
1609 |
+ |
|
1610 |
+ |
if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) useLiquidThermInt = 1; |
1611 |
+ |
else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) useLiquidThermInt = 0; |
1612 |
+ |
else{ |
1613 |
+ |
the_event->err_msg = |
1614 |
+ |
strdup( "Global error. useLiquidThermInt was not \"true\" or \"false\".\n" ); |
1615 |
+ |
return 0; |
1616 |
+ |
} |
1617 |
+ |
return 1; |
1618 |
+ |
} |
1619 |
+ |
|
1620 |
+ |
the_event->err_msg = |
1621 |
+ |
strdup( "Global error. useLiquidThermInt was not \"true\" or \"false\".\n" ); |
1622 |
+ |
return 0; |
1623 |
+ |
break; |
1624 |
+ |
|
1625 |
+ |
case G_THERM_INT_LAMBDA: |
1626 |
+ |
switch( the_type ){ |
1627 |
+ |
|
1628 |
+ |
case STRING: |
1629 |
+ |
the_event->err_msg = |
1630 |
+ |
strdup( "Global error. thermodynamicIntegrationLambda is not a double or int.\n" ); |
1631 |
+ |
return 1; |
1632 |
+ |
break; |
1633 |
+ |
|
1634 |
+ |
case DOUBLE: |
1635 |
+ |
thermodynamic_integration_lambda = the_event->evt.asmt.rhs.dval; |
1636 |
+ |
have_thermodynamic_integration_lambda = 1; |
1637 |
+ |
return 1; |
1638 |
+ |
break; |
1639 |
+ |
|
1640 |
+ |
case INT: |
1641 |
+ |
thermodynamic_integration_lambda = (double)the_event->evt.asmt.rhs.dval; |
1642 |
+ |
have_thermodynamic_integration_lambda = 1; |
1643 |
+ |
return 1; |
1644 |
+ |
break; |
1645 |
+ |
|
1646 |
+ |
default: |
1647 |
+ |
the_event->err_msg = |
1648 |
+ |
strdup( "Global error. thermodynamicIntegrationLambda unrecognized.\n" ); |
1649 |
+ |
return 0; |
1650 |
+ |
break; |
1651 |
+ |
} |
1652 |
+ |
break; |
1653 |
+ |
|
1654 |
+ |
case G_THERM_INT_K: |
1655 |
+ |
switch( the_type ){ |
1656 |
+ |
|
1657 |
+ |
case STRING: |
1658 |
+ |
the_event->err_msg = |
1659 |
+ |
strdup( "Global error. thermodynamicIntegrationK is not a double or int.\n" ); |
1660 |
+ |
return 1; |
1661 |
+ |
break; |
1662 |
+ |
|
1663 |
+ |
case DOUBLE: |
1664 |
+ |
thermodynamic_integration_k = the_event->evt.asmt.rhs.dval; |
1665 |
+ |
have_thermodynamic_integration_k = 1; |
1666 |
+ |
return 1; |
1667 |
+ |
break; |
1668 |
+ |
|
1669 |
+ |
case INT: |
1670 |
+ |
thermodynamic_integration_k = (double)the_event->evt.asmt.rhs.dval; |
1671 |
+ |
have_thermodynamic_integration_k = 1; |
1672 |
+ |
return 1; |
1673 |
+ |
break; |
1674 |
+ |
|
1675 |
+ |
default: |
1676 |
+ |
the_event->err_msg = |
1677 |
+ |
strdup( "Global error. thermodynamicIntegrationK unrecognized.\n" ); |
1678 |
+ |
return 0; |
1679 |
+ |
break; |
1680 |
+ |
} |
1681 |
+ |
break; |
1682 |
+ |
case G_FORCEFIELD_VARIANT: |
1683 |
+ |
if( the_type == STRING ){ |
1684 |
+ |
strcpy( forcefield_variant, the_event->evt.asmt.rhs.sval ); |
1685 |
+ |
have_forcefield_variant = 1; |
1686 |
+ |
return 1; |
1687 |
+ |
} |
1688 |
+ |
|
1689 |
+ |
the_event->err_msg = |
1690 |
+ |
strdup( "Global error. forceFieldVariant was not a string assignment.\n" ); |
1691 |
+ |
return 0; |
1692 |
+ |
break; |
1693 |
+ |
// add more token cases here. |
1694 |
|
} |
1695 |
|
} |
1696 |
|
|