122 |
|
|
123 |
|
void SimSetup::createSim(void){ |
124 |
|
|
125 |
< |
// gather all of the information from the Bass file |
125 |
> |
// gather all of the information from the meta-data file |
126 |
|
|
127 |
|
gatherInfo(); |
128 |
|
|
646 |
|
|
647 |
|
} |
648 |
|
|
649 |
< |
void SimSetup::initFromBass(void){ |
649 |
> |
void SimSetup::initFromMetaDataFile(void){ |
650 |
|
int i, j, k; |
651 |
|
int n_cells; |
652 |
|
double cellx, celly, cellz; |
769 |
|
current_atom = comp_stamps[current_comp]->getAtom(k); |
770 |
|
if (!current_atom->havePosition()){ |
771 |
|
sprintf(painCave.errMsg, |
772 |
< |
"SimSetup:initFromBass error.\n" |
772 |
> |
"SimSetup:initFromMetaData error.\n" |
773 |
|
"\tComponent %s, atom %s does not have a position specified.\n" |
774 |
|
"\tThe initialization routine is unable to give a start" |
775 |
|
" position.\n", |
824 |
|
// set the easy ones first |
825 |
|
|
826 |
|
for (i = 0; i < nInfo; i++){ |
827 |
< |
info[i].target_temp = globals->getTargetTemp(); |
828 |
< |
info[i].dt = globals->getDt(); |
829 |
< |
info[i].run_time = globals->getRunTime(); |
830 |
< |
} |
827 |
> |
if (globals->haveTargetTemp()) { |
828 |
> |
info[i].target_temp = globals->getTargetTemp(); |
829 |
> |
info[i].have_target_temp = 1; |
830 |
> |
} else { |
831 |
> |
info[i].have_target_temp = 0; |
832 |
> |
} |
833 |
> |
if (globals->haveDt()) { |
834 |
> |
info[i].dt = globals->getDt(); |
835 |
> |
} |
836 |
> |
if (globals->haveRunTime()) { |
837 |
> |
info[i].run_time = globals->getRunTime(); |
838 |
> |
} |
839 |
> |
} |
840 |
|
n_components = globals->getNComponents(); |
841 |
|
|
842 |
|
|
869 |
|
|
870 |
|
// get the ensemble |
871 |
|
|
863 |
– |
strcpy(ensemble, globals->getEnsemble()); |
872 |
|
|
873 |
< |
if (!strcasecmp(ensemble, "NVE")){ |
874 |
< |
ensembleCase = NVE_ENS; |
875 |
< |
} |
876 |
< |
else if (!strcasecmp(ensemble, "NVT")){ |
877 |
< |
ensembleCase = NVT_ENS; |
878 |
< |
} |
879 |
< |
else if (!strcasecmp(ensemble, "NPTi") || !strcasecmp(ensemble, "NPT")){ |
880 |
< |
ensembleCase = NPTi_ENS; |
881 |
< |
} |
882 |
< |
else if (!strcasecmp(ensemble, "NPTf")){ |
883 |
< |
ensembleCase = NPTf_ENS; |
884 |
< |
} |
885 |
< |
else if (!strcasecmp(ensemble, "NPTxyz")){ |
886 |
< |
ensembleCase = NPTxyz_ENS; |
887 |
< |
} |
888 |
< |
else{ |
889 |
< |
sprintf(painCave.errMsg, |
890 |
< |
"SimSetup Warning. Unrecognized Ensemble -> %s \n" |
891 |
< |
"\treverting to NVE for this simulation.\n", |
892 |
< |
ensemble); |
893 |
< |
painCave.isFatal = 0; |
894 |
< |
simError(); |
895 |
< |
strcpy(ensemble, "NVE"); |
896 |
< |
ensembleCase = NVE_ENS; |
897 |
< |
} |
898 |
< |
|
899 |
< |
for (i = 0; i < nInfo; i++){ |
900 |
< |
strcpy(info[i].ensemble, ensemble); |
873 |
> |
if (globals->haveEnsemble()) { |
874 |
> |
|
875 |
> |
strcpy(ensemble, globals->getEnsemble()); |
876 |
> |
|
877 |
> |
if (!strcasecmp(ensemble, "NVE")){ |
878 |
> |
ensembleCase = NVE_ENS; |
879 |
> |
} |
880 |
> |
else if (!strcasecmp(ensemble, "NVT")){ |
881 |
> |
ensembleCase = NVT_ENS; |
882 |
> |
} |
883 |
> |
else if (!strcasecmp(ensemble, "NPTi") || !strcasecmp(ensemble, "NPT")){ |
884 |
> |
ensembleCase = NPTi_ENS; |
885 |
> |
} |
886 |
> |
else if (!strcasecmp(ensemble, "NPTf")){ |
887 |
> |
ensembleCase = NPTf_ENS; |
888 |
> |
} |
889 |
> |
else if (!strcasecmp(ensemble, "NPTxyz")){ |
890 |
> |
ensembleCase = NPTxyz_ENS; |
891 |
> |
} |
892 |
> |
else{ |
893 |
> |
sprintf(painCave.errMsg, |
894 |
> |
"SimSetup Warning. Unrecognized Ensemble -> %s \n" |
895 |
> |
"\treverting to NVE for this simulation.\n", |
896 |
> |
ensemble); |
897 |
> |
painCave.isFatal = 0; |
898 |
> |
simError(); |
899 |
> |
strcpy(ensemble, "NVE"); |
900 |
> |
ensembleCase = NVE_ENS; |
901 |
> |
} |
902 |
> |
|
903 |
> |
for (i = 0; i < nInfo; i++) |
904 |
> |
strcpy(info[i].ensemble, ensemble); |
905 |
> |
|
906 |
> |
|
907 |
> |
//check whether sample time, status time, thermal time and reset time are divisble by dt |
908 |
> |
if (globals->haveSampleTime() && !isDivisible(globals->getSampleTime(), globals->getDt())){ |
909 |
> |
sprintf(painCave.errMsg, |
910 |
> |
"Sample time is not divisible by dt.\n" |
911 |
> |
"\tThis will result in samples that are not uniformly\n" |
912 |
> |
"\tdistributed in time. If this is a problem, change\n" |
913 |
> |
"\tyour sampleTime variable.\n"); |
914 |
> |
painCave.isFatal = 0; |
915 |
> |
simError(); |
916 |
> |
} |
917 |
> |
|
918 |
> |
if (globals->haveStatusTime() && !isDivisible(globals->getStatusTime(), globals->getDt())){ |
919 |
> |
sprintf(painCave.errMsg, |
920 |
> |
"Status time is not divisible by dt.\n" |
921 |
> |
"\tThis will result in status reports that are not uniformly\n" |
922 |
> |
"\tdistributed in time. If this is a problem, change \n" |
923 |
> |
"\tyour statusTime variable.\n"); |
924 |
> |
painCave.isFatal = 0; |
925 |
> |
simError(); |
926 |
> |
} |
927 |
> |
|
928 |
> |
if (globals->haveThermalTime() && !isDivisible(globals->getThermalTime(), globals->getDt())){ |
929 |
> |
sprintf(painCave.errMsg, |
930 |
> |
"Thermal time is not divisible by dt.\n" |
931 |
> |
"\tThis will result in thermalizations that are not uniformly\n" |
932 |
> |
"\tdistributed in time. If this is a problem, change \n" |
933 |
> |
"\tyour thermalTime variable.\n"); |
934 |
> |
painCave.isFatal = 0; |
935 |
> |
simError(); |
936 |
> |
} |
937 |
> |
|
938 |
> |
if (globals->haveResetTime() && !isDivisible(globals->getResetTime(), globals->getDt())){ |
939 |
> |
sprintf(painCave.errMsg, |
940 |
> |
"Reset time is not divisible by dt.\n" |
941 |
> |
"\tThis will result in integrator resets that are not uniformly\n" |
942 |
> |
"\tdistributed in time. If this is a problem, change\n" |
943 |
> |
"\tyour resetTime variable.\n"); |
944 |
> |
painCave.isFatal = 0; |
945 |
> |
simError(); |
946 |
> |
} |
947 |
> |
|
948 |
> |
// set the status, sample, and thermal kick times |
949 |
> |
|
950 |
> |
for (i = 0; i < nInfo; i++){ |
951 |
> |
if (globals->haveSampleTime()){ |
952 |
> |
info[i].sampleTime = globals->getSampleTime(); |
953 |
> |
info[i].statusTime = info[i].sampleTime; |
954 |
> |
} |
955 |
> |
else{ |
956 |
> |
info[i].sampleTime = globals->getRunTime(); |
957 |
> |
info[i].statusTime = info[i].sampleTime; |
958 |
> |
} |
959 |
> |
|
960 |
> |
if (globals->haveStatusTime()){ |
961 |
> |
info[i].statusTime = globals->getStatusTime(); |
962 |
> |
} |
963 |
> |
|
964 |
> |
if (globals->haveThermalTime()){ |
965 |
> |
info[i].thermalTime = globals->getThermalTime(); |
966 |
> |
} else { |
967 |
> |
info[i].thermalTime = globals->getRunTime(); |
968 |
> |
} |
969 |
> |
|
970 |
> |
info[i].resetIntegrator = 0; |
971 |
> |
if( globals->haveResetTime() ){ |
972 |
> |
info[i].resetTime = globals->getResetTime(); |
973 |
> |
info[i].resetIntegrator = 1; |
974 |
> |
} |
975 |
> |
} |
976 |
|
|
977 |
+ |
|
978 |
+ |
for (i=0; i < nInfo; i++) { |
979 |
+ |
|
980 |
+ |
// check for the temperature set flag |
981 |
+ |
|
982 |
+ |
if (globals->haveTempSet()) |
983 |
+ |
info[i].setTemp = globals->getTempSet(); |
984 |
+ |
|
985 |
+ |
// check for the extended State init |
986 |
+ |
|
987 |
+ |
info[i].useInitXSstate = globals->getUseInitXSstate(); |
988 |
+ |
info[i].orthoTolerance = globals->getOrthoBoxTolerance(); |
989 |
+ |
|
990 |
+ |
// check for thermodynamic integration |
991 |
+ |
if (globals->getUseSolidThermInt() && !globals->getUseLiquidThermInt()) { |
992 |
+ |
if (globals->haveThermIntLambda() && globals->haveThermIntK()) { |
993 |
+ |
info[i].useSolidThermInt = globals->getUseSolidThermInt(); |
994 |
+ |
info[i].thermIntLambda = globals->getThermIntLambda(); |
995 |
+ |
info[i].thermIntK = globals->getThermIntK(); |
996 |
+ |
|
997 |
+ |
Restraints *myRestraint = new Restraints(tot_nmol, info[i].thermIntLambda, info[i].thermIntK); |
998 |
+ |
info[i].restraint = myRestraint; |
999 |
+ |
} |
1000 |
+ |
else { |
1001 |
+ |
sprintf(painCave.errMsg, |
1002 |
+ |
"SimSetup Error:\n" |
1003 |
+ |
"\tKeyword useSolidThermInt was set to 'true' but\n" |
1004 |
+ |
"\tthermodynamicIntegrationLambda (and/or\n" |
1005 |
+ |
"\tthermodynamicIntegrationK) was not specified.\n" |
1006 |
+ |
"\tPlease provide a lambda value and k value in your meta-data file.\n"); |
1007 |
+ |
painCave.isFatal = 1; |
1008 |
+ |
simError(); |
1009 |
+ |
} |
1010 |
+ |
} |
1011 |
+ |
else if(globals->getUseLiquidThermInt()) { |
1012 |
+ |
if (globals->getUseSolidThermInt()) { |
1013 |
+ |
sprintf( painCave.errMsg, |
1014 |
+ |
"SimSetup Warning: It appears that you have both solid and\n" |
1015 |
+ |
"\tliquid thermodynamic integration activated in your meta-data\n" |
1016 |
+ |
"\tfile. To avoid confusion, specify only one technique in\n" |
1017 |
+ |
"\tyour meta-data file. Liquid-state thermodynamic integration\n" |
1018 |
+ |
"\twill be assumed for the current simulation. If this is not\n" |
1019 |
+ |
"\twhat you desire, set useSolidThermInt to 'true' and\n" |
1020 |
+ |
"\tuseLiquidThermInt to 'false' in your meta-data file.\n"); |
1021 |
+ |
painCave.isFatal = 0; |
1022 |
+ |
simError(); |
1023 |
+ |
} |
1024 |
+ |
if (globals->haveThermIntLambda() && globals->haveThermIntK()) { |
1025 |
+ |
info[i].useLiquidThermInt = globals->getUseLiquidThermInt(); |
1026 |
+ |
info[i].thermIntLambda = globals->getThermIntLambda(); |
1027 |
+ |
info[i].thermIntK = globals->getThermIntK(); |
1028 |
+ |
} |
1029 |
+ |
else { |
1030 |
+ |
sprintf(painCave.errMsg, |
1031 |
+ |
"SimSetup Error:\n" |
1032 |
+ |
"\tKeyword useLiquidThermInt was set to 'true' but\n" |
1033 |
+ |
"\tthermodynamicIntegrationLambda (and/or\n" |
1034 |
+ |
"\tthermodynamicIntegrationK) was not specified.\n" |
1035 |
+ |
"\tPlease provide a lambda value and k value in your meta-data file.\n"); |
1036 |
+ |
painCave.isFatal = 1; |
1037 |
+ |
simError(); |
1038 |
+ |
} |
1039 |
+ |
} |
1040 |
+ |
else if(globals->haveThermIntLambda() || globals->haveThermIntK()){ |
1041 |
+ |
sprintf(painCave.errMsg, |
1042 |
+ |
"SimSetup Warning: If you want to use Thermodynamic\n" |
1043 |
+ |
"\tIntegration, set useSolidThermInt or useLiquidThermInt to\n" |
1044 |
+ |
"\t'true' in your meta-data file. These keywords are set to\n" |
1045 |
+ |
"\t'false' by default, so your lambda and/or k values are\n" |
1046 |
+ |
"\tbeing ignored.\n"); |
1047 |
+ |
painCave.isFatal = 0; |
1048 |
+ |
simError(); |
1049 |
+ |
} |
1050 |
+ |
} |
1051 |
+ |
} |
1052 |
+ |
|
1053 |
+ |
for (i = 0; i < nInfo; i++) { |
1054 |
|
// get the mixing rule |
1055 |
< |
|
1055 |
> |
|
1056 |
|
strcpy(info[i].mixingRule, globals->getMixingRule()); |
1057 |
|
info[i].usePBC = globals->getPBC(); |
1058 |
|
} |
1059 |
< |
|
1059 |
> |
|
1060 |
|
// get the components and calculate the tot_nMol and indvidual n_mol |
1061 |
< |
|
1061 |
> |
|
1062 |
|
the_components = globals->getComponents(); |
1063 |
|
components_nmol = new int[n_components]; |
1064 |
< |
|
905 |
< |
|
1064 |
> |
|
1065 |
|
if (!globals->haveNMol()){ |
1066 |
|
// we don't have the total number of molecules, so we assume it is |
1067 |
|
// given in each component |
1091 |
|
painCave.isFatal = 1; |
1092 |
|
simError(); |
1093 |
|
} |
1094 |
< |
|
936 |
< |
//check whether sample time, status time, thermal time and reset time are divisble by dt |
937 |
< |
if (globals->haveSampleTime() && !isDivisible(globals->getSampleTime(), globals->getDt())){ |
938 |
< |
sprintf(painCave.errMsg, |
939 |
< |
"Sample time is not divisible by dt.\n" |
940 |
< |
"\tThis will result in samples that are not uniformly\n" |
941 |
< |
"\tdistributed in time. If this is a problem, change\n" |
942 |
< |
"\tyour sampleTime variable.\n"); |
943 |
< |
painCave.isFatal = 0; |
944 |
< |
simError(); |
945 |
< |
} |
946 |
< |
|
947 |
< |
if (globals->haveStatusTime() && !isDivisible(globals->getStatusTime(), globals->getDt())){ |
948 |
< |
sprintf(painCave.errMsg, |
949 |
< |
"Status time is not divisible by dt.\n" |
950 |
< |
"\tThis will result in status reports that are not uniformly\n" |
951 |
< |
"\tdistributed in time. If this is a problem, change \n" |
952 |
< |
"\tyour statusTime variable.\n"); |
953 |
< |
painCave.isFatal = 0; |
954 |
< |
simError(); |
955 |
< |
} |
956 |
< |
|
957 |
< |
if (globals->haveThermalTime() && !isDivisible(globals->getThermalTime(), globals->getDt())){ |
958 |
< |
sprintf(painCave.errMsg, |
959 |
< |
"Thermal time is not divisible by dt.\n" |
960 |
< |
"\tThis will result in thermalizations that are not uniformly\n" |
961 |
< |
"\tdistributed in time. If this is a problem, change \n" |
962 |
< |
"\tyour thermalTime variable.\n"); |
963 |
< |
painCave.isFatal = 0; |
964 |
< |
simError(); |
965 |
< |
} |
1094 |
> |
|
1095 |
|
|
967 |
– |
if (globals->haveResetTime() && !isDivisible(globals->getResetTime(), globals->getDt())){ |
968 |
– |
sprintf(painCave.errMsg, |
969 |
– |
"Reset time is not divisible by dt.\n" |
970 |
– |
"\tThis will result in integrator resets that are not uniformly\n" |
971 |
– |
"\tdistributed in time. If this is a problem, change\n" |
972 |
– |
"\tyour resetTime variable.\n"); |
973 |
– |
painCave.isFatal = 0; |
974 |
– |
simError(); |
975 |
– |
} |
1096 |
|
|
977 |
– |
// set the status, sample, and thermal kick times |
978 |
– |
|
979 |
– |
for (i = 0; i < nInfo; i++){ |
980 |
– |
if (globals->haveSampleTime()){ |
981 |
– |
info[i].sampleTime = globals->getSampleTime(); |
982 |
– |
info[i].statusTime = info[i].sampleTime; |
983 |
– |
} |
984 |
– |
else{ |
985 |
– |
info[i].sampleTime = globals->getRunTime(); |
986 |
– |
info[i].statusTime = info[i].sampleTime; |
987 |
– |
} |
988 |
– |
|
989 |
– |
if (globals->haveStatusTime()){ |
990 |
– |
info[i].statusTime = globals->getStatusTime(); |
991 |
– |
} |
992 |
– |
|
993 |
– |
if (globals->haveThermalTime()){ |
994 |
– |
info[i].thermalTime = globals->getThermalTime(); |
995 |
– |
} else { |
996 |
– |
info[i].thermalTime = globals->getRunTime(); |
997 |
– |
} |
998 |
– |
|
999 |
– |
info[i].resetIntegrator = 0; |
1000 |
– |
if( globals->haveResetTime() ){ |
1001 |
– |
info[i].resetTime = globals->getResetTime(); |
1002 |
– |
info[i].resetIntegrator = 1; |
1003 |
– |
} |
1004 |
– |
|
1005 |
– |
// check for the temperature set flag |
1006 |
– |
|
1007 |
– |
if (globals->haveTempSet()) |
1008 |
– |
info[i].setTemp = globals->getTempSet(); |
1009 |
– |
|
1010 |
– |
// check for the extended State init |
1011 |
– |
|
1012 |
– |
info[i].useInitXSstate = globals->getUseInitXSstate(); |
1013 |
– |
info[i].orthoTolerance = globals->getOrthoBoxTolerance(); |
1014 |
– |
|
1015 |
– |
// check for thermodynamic integration |
1016 |
– |
if (globals->getUseSolidThermInt() && !globals->getUseLiquidThermInt()) { |
1017 |
– |
if (globals->haveThermIntLambda() && globals->haveThermIntK()) { |
1018 |
– |
info[i].useSolidThermInt = globals->getUseSolidThermInt(); |
1019 |
– |
info[i].thermIntLambda = globals->getThermIntLambda(); |
1020 |
– |
info[i].thermIntK = globals->getThermIntK(); |
1021 |
– |
|
1022 |
– |
Restraints *myRestraint = new Restraints(tot_nmol, info[i].thermIntLambda, info[i].thermIntK); |
1023 |
– |
info[i].restraint = myRestraint; |
1024 |
– |
} |
1025 |
– |
else { |
1026 |
– |
sprintf(painCave.errMsg, |
1027 |
– |
"SimSetup Error:\n" |
1028 |
– |
"\tKeyword useSolidThermInt was set to 'true' but\n" |
1029 |
– |
"\tthermodynamicIntegrationLambda (and/or\n" |
1030 |
– |
"\tthermodynamicIntegrationK) was not specified.\n" |
1031 |
– |
"\tPlease provide a lambda value and k value in your .bass file.\n"); |
1032 |
– |
painCave.isFatal = 1; |
1033 |
– |
simError(); |
1034 |
– |
} |
1035 |
– |
} |
1036 |
– |
else if(globals->getUseLiquidThermInt()) { |
1037 |
– |
if (globals->getUseSolidThermInt()) { |
1038 |
– |
sprintf( painCave.errMsg, |
1039 |
– |
"SimSetup Warning: It appears that you have both solid and\n" |
1040 |
– |
"\tliquid thermodynamic integration activated in your .bass\n" |
1041 |
– |
"\tfile. To avoid confusion, specify only one technique in\n" |
1042 |
– |
"\tyour .bass file. Liquid-state thermodynamic integration\n" |
1043 |
– |
"\twill be assumed for the current simulation. If this is not\n" |
1044 |
– |
"\twhat you desire, set useSolidThermInt to 'true' and\n" |
1045 |
– |
"\tuseLiquidThermInt to 'false' in your .bass file.\n"); |
1046 |
– |
painCave.isFatal = 0; |
1047 |
– |
simError(); |
1048 |
– |
} |
1049 |
– |
if (globals->haveThermIntLambda() && globals->haveThermIntK()) { |
1050 |
– |
info[i].useLiquidThermInt = globals->getUseLiquidThermInt(); |
1051 |
– |
info[i].thermIntLambda = globals->getThermIntLambda(); |
1052 |
– |
info[i].thermIntK = globals->getThermIntK(); |
1053 |
– |
} |
1054 |
– |
else { |
1055 |
– |
sprintf(painCave.errMsg, |
1056 |
– |
"SimSetup Error:\n" |
1057 |
– |
"\tKeyword useLiquidThermInt was set to 'true' but\n" |
1058 |
– |
"\tthermodynamicIntegrationLambda (and/or\n" |
1059 |
– |
"\tthermodynamicIntegrationK) was not specified.\n" |
1060 |
– |
"\tPlease provide a lambda value and k value in your .bass file.\n"); |
1061 |
– |
painCave.isFatal = 1; |
1062 |
– |
simError(); |
1063 |
– |
} |
1064 |
– |
} |
1065 |
– |
else if(globals->haveThermIntLambda() || globals->haveThermIntK()){ |
1066 |
– |
sprintf(painCave.errMsg, |
1067 |
– |
"SimSetup Warning: If you want to use Thermodynamic\n" |
1068 |
– |
"\tIntegration, set useSolidThermInt or useLiquidThermInt to\n" |
1069 |
– |
"\t'true' in your .bass file. These keywords are set to\n" |
1070 |
– |
"\t'false' by default, so your lambda and/or k values are\n" |
1071 |
– |
"\tbeing ignored.\n"); |
1072 |
– |
painCave.isFatal = 0; |
1073 |
– |
simError(); |
1074 |
– |
} |
1075 |
– |
} |
1097 |
|
|
1098 |
|
//setup seed for random number generator |
1099 |
|
int seedValue; |
1136 |
|
} |
1137 |
|
|
1138 |
|
#ifdef IS_MPI |
1139 |
< |
strcpy(checkPointMsg, "Successfully gathered all information from Bass\n"); |
1139 |
> |
strcpy(checkPointMsg, "Successfully gathered all information from meta-data file\n"); |
1140 |
|
MPIcheckPoint(); |
1141 |
|
#endif // is_mpi |
1142 |
|
} |
1305 |
|
} |
1306 |
|
else{ |
1307 |
|
|
1308 |
< |
// no init from bass |
1308 |
> |
// no init from md file |
1309 |
|
|
1310 |
|
sprintf(painCave.errMsg, |
1311 |
|
"Cannot intialize a simulation without an initial configuration file.\n"); |
1323 |
|
|
1324 |
|
void SimSetup::makeOutNames(void){ |
1325 |
|
int k; |
1326 |
+ |
string prefix; |
1327 |
|
|
1306 |
– |
|
1328 |
|
for (k = 0; k < nInfo; k++){ |
1329 |
|
#ifdef IS_MPI |
1330 |
|
if (worldRank == 0){ |
1331 |
|
#endif // is_mpi |
1332 |
+ |
|
1333 |
+ |
if(globals->haveFinalConfig()) |
1334 |
+ |
prefix = getPrefix(globals->getFinalConfig()); |
1335 |
+ |
else |
1336 |
+ |
prefix = getPrefix(info[k].finalName); |
1337 |
|
|
1338 |
< |
if (globals->haveFinalConfig()){ |
1339 |
< |
strcpy(info[k].finalName, globals->getFinalConfig()); |
1340 |
< |
} |
1315 |
< |
else{ |
1316 |
< |
strcpy(info[k].finalName, inFileName); |
1317 |
< |
char* endTest; |
1318 |
< |
int nameLength = strlen(info[k].finalName); |
1319 |
< |
endTest = &(info[k].finalName[nameLength - 5]); |
1320 |
< |
if (!strcmp(endTest, ".bass")){ |
1321 |
< |
strcpy(endTest, ".eor"); |
1322 |
< |
} |
1323 |
< |
else if (!strcmp(endTest, ".BASS")){ |
1324 |
< |
strcpy(endTest, ".eor"); |
1325 |
< |
} |
1326 |
< |
else{ |
1327 |
< |
endTest = &(info[k].finalName[nameLength - 4]); |
1328 |
< |
if (!strcmp(endTest, ".bss")){ |
1329 |
< |
strcpy(endTest, ".eor"); |
1330 |
< |
} |
1331 |
< |
else if (!strcmp(endTest, ".mdl")){ |
1332 |
< |
strcpy(endTest, ".eor"); |
1333 |
< |
} |
1334 |
< |
else{ |
1335 |
< |
strcat(info[k].finalName, ".eor"); |
1336 |
< |
} |
1337 |
< |
} |
1338 |
< |
} |
1339 |
< |
|
1340 |
< |
// make the sample and status out names |
1341 |
< |
|
1342 |
< |
strcpy(info[k].sampleName, inFileName); |
1343 |
< |
char* endTest; |
1344 |
< |
int nameLength = strlen(info[k].sampleName); |
1345 |
< |
endTest = &(info[k].sampleName[nameLength - 5]); |
1346 |
< |
if (!strcmp(endTest, ".bass")){ |
1347 |
< |
strcpy(endTest, ".dump"); |
1348 |
< |
} |
1349 |
< |
else if (!strcmp(endTest, ".BASS")){ |
1350 |
< |
strcpy(endTest, ".dump"); |
1351 |
< |
} |
1352 |
< |
else{ |
1353 |
< |
endTest = &(info[k].sampleName[nameLength - 4]); |
1354 |
< |
if (!strcmp(endTest, ".bss")){ |
1355 |
< |
strcpy(endTest, ".dump"); |
1356 |
< |
} |
1357 |
< |
else if (!strcmp(endTest, ".mdl")){ |
1358 |
< |
strcpy(endTest, ".dump"); |
1359 |
< |
} |
1360 |
< |
else{ |
1361 |
< |
strcat(info[k].sampleName, ".dump"); |
1362 |
< |
} |
1363 |
< |
} |
1364 |
< |
|
1365 |
< |
strcpy(info[k].statusName, inFileName); |
1366 |
< |
nameLength = strlen(info[k].statusName); |
1367 |
< |
endTest = &(info[k].statusName[nameLength - 5]); |
1368 |
< |
if (!strcmp(endTest, ".bass")){ |
1369 |
< |
strcpy(endTest, ".stat"); |
1370 |
< |
} |
1371 |
< |
else if (!strcmp(endTest, ".BASS")){ |
1372 |
< |
strcpy(endTest, ".stat"); |
1373 |
< |
} |
1374 |
< |
else{ |
1375 |
< |
endTest = &(info[k].statusName[nameLength - 4]); |
1376 |
< |
if (!strcmp(endTest, ".bss")){ |
1377 |
< |
strcpy(endTest, ".stat"); |
1378 |
< |
} |
1379 |
< |
else if (!strcmp(endTest, ".mdl")){ |
1380 |
< |
strcpy(endTest, ".stat"); |
1381 |
< |
} |
1382 |
< |
else{ |
1383 |
< |
strcat(info[k].statusName, ".stat"); |
1384 |
< |
} |
1385 |
< |
} |
1386 |
< |
|
1387 |
< |
strcpy(info[k].rawPotName, inFileName); |
1388 |
< |
nameLength = strlen(info[k].rawPotName); |
1389 |
< |
endTest = &(info[k].rawPotName[nameLength - 5]); |
1390 |
< |
if (!strcmp(endTest, ".bass")){ |
1391 |
< |
strcpy(endTest, ".raw"); |
1392 |
< |
} |
1393 |
< |
else if (!strcmp(endTest, ".BASS")){ |
1394 |
< |
strcpy(endTest, ".raw"); |
1395 |
< |
} |
1396 |
< |
else{ |
1397 |
< |
endTest = &(info[k].rawPotName[nameLength - 4]); |
1398 |
< |
if (!strcmp(endTest, ".bss")){ |
1399 |
< |
strcpy(endTest, ".raw"); |
1400 |
< |
} |
1401 |
< |
else if (!strcmp(endTest, ".mdl")){ |
1402 |
< |
strcpy(endTest, ".raw"); |
1403 |
< |
} |
1404 |
< |
else{ |
1405 |
< |
strcat(info[k].rawPotName, ".raw"); |
1406 |
< |
} |
1407 |
< |
} |
1338 |
> |
info[k].finalName = prefix + ".eor"; |
1339 |
> |
info[k].sampleName = prefix + ".dump"; |
1340 |
> |
info[k].statusName = prefix + ".stat"; |
1341 |
|
|
1342 |
|
#ifdef IS_MPI |
1343 |
|
|
1718 |
|
else |
1719 |
|
myNVT = new NVT<RealIntegrator>(&(info[k]), the_ff); |
1720 |
|
|
1721 |
< |
myNVT->setTargetTemp(globals->getTargetTemp()); |
1721 |
> |
|
1722 |
> |
if (globals->haveTargetTemp()) |
1723 |
> |
myNVT->setTargetTemp(globals->getTargetTemp()); |
1724 |
> |
else{ |
1725 |
> |
sprintf(painCave.errMsg, |
1726 |
> |
"SimSetup error: If you use the NVT\n" |
1727 |
> |
"\tensemble, you must set targetTemp.\n"); |
1728 |
> |
painCave.isFatal = 1; |
1729 |
> |
simError(); |
1730 |
> |
} |
1731 |
|
|
1732 |
|
if (globals->haveTauThermostat()) |
1733 |
|
myNVT->setTauThermostat(globals->getTauThermostat()); |
1750 |
|
else |
1751 |
|
myNPTi = new NPTi<NPT<RealIntegrator> >(&(info[k]), the_ff); |
1752 |
|
|
1753 |
< |
myNPTi->setTargetTemp(globals->getTargetTemp()); |
1753 |
> |
if (globals->haveTargetTemp()) |
1754 |
> |
myNPTi->setTargetTemp(globals->getTargetTemp()); |
1755 |
> |
else{ |
1756 |
> |
sprintf(painCave.errMsg, |
1757 |
> |
"SimSetup error: If you use a constant pressure\n" |
1758 |
> |
"\tensemble, you must set targetTemp.\n"); |
1759 |
> |
painCave.isFatal = 1; |
1760 |
> |
simError(); |
1761 |
> |
} |
1762 |
|
|
1763 |
|
if (globals->haveTargetPressure()) |
1764 |
|
myNPTi->setTargetPressure(globals->getTargetPressure()); |
1765 |
|
else{ |
1766 |
|
sprintf(painCave.errMsg, |
1767 |
|
"SimSetup error: If you use a constant pressure\n" |
1768 |
< |
"\tensemble, you must set targetPressure in the BASS file.\n"); |
1768 |
> |
"\tensemble, you must set targetPressure in the meta-data file.\n"); |
1769 |
|
painCave.isFatal = 1; |
1770 |
|
simError(); |
1771 |
|
} |
1801 |
|
else |
1802 |
|
myNPTf = new NPTf<NPT <RealIntegrator> >(&(info[k]), the_ff); |
1803 |
|
|
1804 |
< |
myNPTf->setTargetTemp(globals->getTargetTemp()); |
1804 |
> |
if (globals->haveTargetTemp()) |
1805 |
> |
myNPTf->setTargetTemp(globals->getTargetTemp()); |
1806 |
> |
else{ |
1807 |
> |
sprintf(painCave.errMsg, |
1808 |
> |
"SimSetup error: If you use a constant pressure\n" |
1809 |
> |
"\tensemble, you must set targetTemp.\n"); |
1810 |
> |
painCave.isFatal = 1; |
1811 |
> |
simError(); |
1812 |
> |
} |
1813 |
|
|
1814 |
|
if (globals->haveTargetPressure()) |
1815 |
|
myNPTf->setTargetPressure(globals->getTargetPressure()); |
1816 |
|
else{ |
1817 |
|
sprintf(painCave.errMsg, |
1818 |
|
"SimSetup error: If you use a constant pressure\n" |
1819 |
< |
"\tensemble, you must set targetPressure in the BASS file.\n"); |
1819 |
> |
"\tensemble, you must set targetPressure in the meta-data file.\n"); |
1820 |
|
painCave.isFatal = 1; |
1821 |
|
simError(); |
1822 |
|
} |
1854 |
|
else |
1855 |
|
myNPTxyz = new NPTxyz<NPT <RealIntegrator> >(&(info[k]), the_ff); |
1856 |
|
|
1857 |
< |
myNPTxyz->setTargetTemp(globals->getTargetTemp()); |
1857 |
> |
if (globals->haveTargetTemp()) |
1858 |
> |
myNPTxyz->setTargetTemp(globals->getTargetTemp()); |
1859 |
> |
else{ |
1860 |
> |
sprintf(painCave.errMsg, |
1861 |
> |
"SimSetup error: If you use a constant pressure\n" |
1862 |
> |
"\tensemble, you must set targetTemp.\n"); |
1863 |
> |
painCave.isFatal = 1; |
1864 |
> |
simError(); |
1865 |
> |
} |
1866 |
|
|
1867 |
|
if (globals->haveTargetPressure()) |
1868 |
|
myNPTxyz->setTargetPressure(globals->getTargetPressure()); |
1869 |
|
else{ |
1870 |
|
sprintf(painCave.errMsg, |
1871 |
|
"SimSetup error: If you use a constant pressure\n" |
1872 |
< |
"\tensemble, you must set targetPressure in the BASS file.\n"); |
1872 |
> |
"\tensemble, you must set targetPressure in the meta-data file.\n"); |
1873 |
|
painCave.isFatal = 1; |
1874 |
|
simError(); |
1875 |
|
} |