--- trunk/OOPSE-1.0/libmdtools/SimSetup.cpp 2004/07/26 17:50:57 1415 +++ trunk/OOPSE-1.0/libmdtools/SimSetup.cpp 2004/07/27 16:13:29 1418 @@ -122,7 +122,7 @@ void SimSetup::createSim(void){ void SimSetup::createSim(void){ - // gather all of the information from the Bass file + // gather all of the information from the meta-data file gatherInfo(); @@ -646,7 +646,7 @@ void SimSetup::makeMolecules(void){ } -void SimSetup::initFromBass(void){ +void SimSetup::initFromMetaDataFile(void){ int i, j, k; int n_cells; double cellx, celly, cellz; @@ -769,7 +769,7 @@ void SimSetup::makeElement(double x, double y, double current_atom = comp_stamps[current_comp]->getAtom(k); if (!current_atom->havePosition()){ sprintf(painCave.errMsg, - "SimSetup:initFromBass error.\n" + "SimSetup:initFromMetaData error.\n" "\tComponent %s, atom %s does not have a position specified.\n" "\tThe initialization routine is unable to give a start" " position.\n", @@ -1003,7 +1003,7 @@ void SimSetup::gatherInfo(void){ "\tKeyword useSolidThermInt was set to 'true' but\n" "\tthermodynamicIntegrationLambda (and/or\n" "\tthermodynamicIntegrationK) was not specified.\n" - "\tPlease provide a lambda value and k value in your .bass file.\n"); + "\tPlease provide a lambda value and k value in your meta-data file.\n"); painCave.isFatal = 1; simError(); } @@ -1012,12 +1012,12 @@ void SimSetup::gatherInfo(void){ if (globals->getUseSolidThermInt()) { sprintf( painCave.errMsg, "SimSetup Warning: It appears that you have both solid and\n" - "\tliquid thermodynamic integration activated in your .bass\n" + "\tliquid thermodynamic integration activated in your meta-data\n" "\tfile. To avoid confusion, specify only one technique in\n" - "\tyour .bass file. Liquid-state thermodynamic integration\n" + "\tyour meta-data file. Liquid-state thermodynamic integration\n" "\twill be assumed for the current simulation. If this is not\n" "\twhat you desire, set useSolidThermInt to 'true' and\n" - "\tuseLiquidThermInt to 'false' in your .bass file.\n"); + "\tuseLiquidThermInt to 'false' in your meta-data file.\n"); painCave.isFatal = 0; simError(); } @@ -1032,7 +1032,7 @@ void SimSetup::gatherInfo(void){ "\tKeyword useLiquidThermInt was set to 'true' but\n" "\tthermodynamicIntegrationLambda (and/or\n" "\tthermodynamicIntegrationK) was not specified.\n" - "\tPlease provide a lambda value and k value in your .bass file.\n"); + "\tPlease provide a lambda value and k value in your meta-data file.\n"); painCave.isFatal = 1; simError(); } @@ -1041,7 +1041,7 @@ void SimSetup::gatherInfo(void){ sprintf(painCave.errMsg, "SimSetup Warning: If you want to use Thermodynamic\n" "\tIntegration, set useSolidThermInt or useLiquidThermInt to\n" - "\t'true' in your .bass file. These keywords are set to\n" + "\t'true' in your meta-data file. These keywords are set to\n" "\t'false' by default, so your lambda and/or k values are\n" "\tbeing ignored.\n"); painCave.isFatal = 0; @@ -1136,7 +1136,7 @@ void SimSetup::gatherInfo(void){ } #ifdef IS_MPI - strcpy(checkPointMsg, "Successfully gathered all information from Bass\n"); + strcpy(checkPointMsg, "Successfully gathered all information from meta-data file\n"); MPIcheckPoint(); #endif // is_mpi } @@ -1305,7 +1305,7 @@ void SimSetup::initSystemCoords(void){ } else{ - // no init from bass + // no init from md file sprintf(painCave.errMsg, "Cannot intialize a simulation without an initial configuration file.\n"); @@ -1323,109 +1323,21 @@ void SimSetup::makeOutNames(void){ void SimSetup::makeOutNames(void){ int k; + string prefix; - for (k = 0; k < nInfo; k++){ #ifdef IS_MPI if (worldRank == 0){ #endif // is_mpi - - if (globals->haveFinalConfig()){ - strcpy(info[k].finalName, globals->getFinalConfig()); - } - else{ - strcpy(info[k].finalName, inFileName); - char* endTest; - int nameLength = strlen(info[k].finalName); - endTest = &(info[k].finalName[nameLength - 5]); - if (!strcmp(endTest, ".bass")){ - strcpy(endTest, ".eor"); - } - else if (!strcmp(endTest, ".BASS")){ - strcpy(endTest, ".eor"); - } - else{ - endTest = &(info[k].finalName[nameLength - 4]); - if (!strcmp(endTest, ".bss")){ - strcpy(endTest, ".eor"); - } - else if (!strcmp(endTest, ".mdl")){ - strcpy(endTest, ".eor"); - } - else{ - strcat(info[k].finalName, ".eor"); - } - } - } + + if(globals->haveFinalConfig()) + prefix = getPrefix(globals->getFinalConfig()); + else + prefix = getPrefix(info[k].finalName); - // make the sample and status out names - - strcpy(info[k].sampleName, inFileName); - char* endTest; - int nameLength = strlen(info[k].sampleName); - endTest = &(info[k].sampleName[nameLength - 5]); - if (!strcmp(endTest, ".bass")){ - strcpy(endTest, ".dump"); - } - else if (!strcmp(endTest, ".BASS")){ - strcpy(endTest, ".dump"); - } - else{ - endTest = &(info[k].sampleName[nameLength - 4]); - if (!strcmp(endTest, ".bss")){ - strcpy(endTest, ".dump"); - } - else if (!strcmp(endTest, ".mdl")){ - strcpy(endTest, ".dump"); - } - else{ - strcat(info[k].sampleName, ".dump"); - } - } - - strcpy(info[k].statusName, inFileName); - nameLength = strlen(info[k].statusName); - endTest = &(info[k].statusName[nameLength - 5]); - if (!strcmp(endTest, ".bass")){ - strcpy(endTest, ".stat"); - } - else if (!strcmp(endTest, ".BASS")){ - strcpy(endTest, ".stat"); - } - else{ - endTest = &(info[k].statusName[nameLength - 4]); - if (!strcmp(endTest, ".bss")){ - strcpy(endTest, ".stat"); - } - else if (!strcmp(endTest, ".mdl")){ - strcpy(endTest, ".stat"); - } - else{ - strcat(info[k].statusName, ".stat"); - } - } - - strcpy(info[k].rawPotName, inFileName); - nameLength = strlen(info[k].rawPotName); - endTest = &(info[k].rawPotName[nameLength - 5]); - if (!strcmp(endTest, ".bass")){ - strcpy(endTest, ".raw"); - } - else if (!strcmp(endTest, ".BASS")){ - strcpy(endTest, ".raw"); - } - else{ - endTest = &(info[k].rawPotName[nameLength - 4]); - if (!strcmp(endTest, ".bss")){ - strcpy(endTest, ".raw"); - } - else if (!strcmp(endTest, ".mdl")){ - strcpy(endTest, ".raw"); - } - else{ - strcat(info[k].rawPotName, ".raw"); - } - } + info[k].finalName = prefix + ".eor"; + info[k].sampleName = prefix + ".dump"; + info[k].statusName = prefix + ".stat"; #ifdef IS_MPI @@ -1853,7 +1765,7 @@ void SimSetup::makeIntegrator(void){ else{ sprintf(painCave.errMsg, "SimSetup error: If you use a constant pressure\n" - "\tensemble, you must set targetPressure in the BASS file.\n"); + "\tensemble, you must set targetPressure in the meta-data file.\n"); painCave.isFatal = 1; simError(); } @@ -1904,7 +1816,7 @@ void SimSetup::makeIntegrator(void){ else{ sprintf(painCave.errMsg, "SimSetup error: If you use a constant pressure\n" - "\tensemble, you must set targetPressure in the BASS file.\n"); + "\tensemble, you must set targetPressure in the meta-data file.\n"); painCave.isFatal = 1; simError(); } @@ -1957,7 +1869,7 @@ void SimSetup::makeIntegrator(void){ else{ sprintf(painCave.errMsg, "SimSetup error: If you use a constant pressure\n" - "\tensemble, you must set targetPressure in the BASS file.\n"); + "\tensemble, you must set targetPressure in the meta-data file.\n"); painCave.isFatal = 1; simError(); }