--- trunk/OOPSE/libmdtools/StatWriter.cpp 2004/05/20 20:24:07 1180 +++ trunk/OOPSE/libmdtools/StatWriter.cpp 2004/06/01 17:15:43 1212 @@ -32,23 +32,53 @@ StatWriter::StatWriter( SimInfo* the_entry_plug ){ painCave.isFatal = 1; simError(); } - - rawFile.open(rawName, ios::out | ios::trunc ); - - if( !rawFile ){ - - sprintf( painCave.errMsg, - "Could not open \"%s\" for stat output.\n", - rawName); - painCave.isFatal = 1; - simError(); - } //outFile.setf( ios::scientific ); outFile << "#time(fs)\ttot_E\tpotential\tkinetic\ttemperature\tpressure\tvolume\tconserved quantity\n"; - rawFile << "#time(fs)\tRaw Pot\t Raw Harm\n"; + if (entry_plug->useSolidThermInt && !entry_plug->useLiquidThermInt) { + rawFile.open(rawName, ios::out | ios::trunc ); + + if( !rawFile ){ + + sprintf( painCave.errMsg, + "Could not open \"%s\" for stat output.\n", + rawName); + painCave.isFatal = 1; + simError(); + } + + rawFile << "#time(fs)\tRaw Pot\t Raw Harm\n"; + } + if (entry_plug->useLiquidThermInt) { + if (entry_plug->useSolidThermInt) { + sprintf( painCave.errMsg, + "It appears that you have both solid and liquid thermodynamic\n" + "integration activated in your .bass file. To avoid confusion,\n" + "specify only one technique in your .bass file. Liquid-state\n" + "thermodynamic integration will be assumed for the current\n" + "simulation. If this is not what you desire, set useSolidThermInt\n" + "to 'true' and useLiquidThermInt to 'false' in your .bass file.", + rawName); + painCave.isFatal = 0; + simError(); + } + + rawFile.open(rawName, ios::out | ios::trunc ); + + if( !rawFile ){ + + sprintf( painCave.errMsg, + "Could not open \"%s\" for stat output.\n", + rawName); + painCave.isFatal = 1; + simError(); + } + + rawFile << "#time(fs)\tRaw Pot\n"; + } + #ifdef IS_MPI }