"plugins/amoeba/vscode:/vscode.git/clone" did not exist on "21ab511a59dc28926ebc1c335ad134b79f6a0a7d"
Commit 1d3ffd7b authored by peastman's avatar peastman
Browse files

Deleted obsolete logging class

parent 9111cca0
......@@ -26,7 +26,6 @@
#include <sstream>
#include "SimTKOpenMMCommon.h"
#include "SimTKOpenMMLog.h"
#include "SimTKOpenMMUtilities.h"
#include "ReferenceDynamics.h"
......
......@@ -26,7 +26,6 @@
#include <sstream>
#include "SimTKOpenMMCommon.h"
#include "SimTKOpenMMLog.h"
#include "SimTKOpenMMUtilities.h"
#include "ReferenceForce.h"
......
......@@ -26,7 +26,6 @@
#include <sstream>
#include "SimTKOpenMMCommon.h"
#include "SimTKOpenMMLog.h"
#include "SimTKOpenMMUtilities.h"
#include "ReferenceHarmonicBondIxn.h"
#include "ReferenceForce.h"
......
......@@ -26,7 +26,6 @@
#include <sstream>
#include "SimTKOpenMMCommon.h"
#include "SimTKOpenMMLog.h"
#include "SimTKOpenMMUtilities.h"
#include "ReferenceLJCoulomb14.h"
#include "ReferenceForce.h"
......
......@@ -28,11 +28,11 @@
#include <algorithm>
#include "SimTKOpenMMCommon.h"
#include "SimTKOpenMMLog.h"
#include "SimTKOpenMMUtilities.h"
#include "ReferenceLJCoulombIxn.h"
#include "ReferenceForce.h"
#include "ReferencePME.h"
#include "openmm/OpenMMException.h"
// In case we're using some primitive version of Visual Studio this will
// make sure that erf() and erfc() are defined.
......@@ -264,11 +264,8 @@ void ReferenceLJCoulombIxn::calculateEwaldIxn(int numberOfAtoms, vector<RealVec>
vector<d_complex> tab_xy(numberOfAtoms);
vector<d_complex> tab_qxyz(numberOfAtoms);
if (kmax < 1) {
std::stringstream message;
message << " kmax < 1 , Aborting" << std::endl;
SimTKOpenMMLog::printError( message );
}
if (kmax < 1)
throw OpenMMException("kmax for Ewald summation < 1");
for(int i = 0; (i < numberOfAtoms); i++) {
for(int m = 0; (m < 3); m++)
......
......@@ -26,7 +26,6 @@
#include "SimTKOpenMMCommon.h"
#include "SimTKOpenMMUtilities.h"
#include "SimTKOpenMMLog.h"
#include "ReferenceLincsAlgorithm.h"
#include "ReferenceDynamics.h"
#include "openmm/OpenMMException.h"
......
......@@ -26,7 +26,6 @@
#include <sstream>
#include "SimTKOpenMMCommon.h"
#include "SimTKOpenMMLog.h"
#include "SimTKOpenMMUtilities.h"
#include "ReferenceForce.h"
#include "ReferencePairIxn.h"
......
......@@ -26,7 +26,6 @@
#include <sstream>
#include "SimTKOpenMMCommon.h"
#include "SimTKOpenMMLog.h"
#include "SimTKOpenMMUtilities.h"
#include "ReferenceProperDihedralBond.h"
#include "ReferenceForce.h"
......
......@@ -26,7 +26,6 @@
#include <sstream>
#include "SimTKOpenMMCommon.h"
#include "SimTKOpenMMLog.h"
#include "SimTKOpenMMUtilities.h"
#include "ReferenceRbDihedralBond.h"
#include "ReferenceForce.h"
......
......@@ -26,10 +26,10 @@
#include <sstream>
#include "SimTKOpenMMCommon.h"
#include "SimTKOpenMMLog.h"
#include "SimTKOpenMMUtilities.h"
#include "ReferenceStochasticDynamics.h"
#include "ReferenceVirtualSites.h"
#include "openmm/OpenMMException.h"
#include <cstdio>
......@@ -51,27 +51,10 @@ ReferenceStochasticDynamics::ReferenceStochasticDynamics( int numberOfAtoms,
RealOpenMM deltaT, RealOpenMM tau,
RealOpenMM temperature ) :
ReferenceDynamics( numberOfAtoms, deltaT, temperature ), _tau( tau ) {
// ---------------------------------------------------------------------------------------
static const char* methodName = "\nReferenceStochasticDynamics::ReferenceStochasticDynamics";
static const RealOpenMM zero = 0.0;
static const RealOpenMM one = 1.0;
// ---------------------------------------------------------------------------------------
// ensure tau is not zero -- if it is print warning message
if( _tau == zero ){
if (tau <= 0) {
std::stringstream message;
message << methodName;
message << " input tau value=" << tau << " is invalid -- setting to 1.";
SimTKOpenMMLog::printError( message );
_tau = one;
message << "illegal tau value: " << tau;
throw OpenMMException(message.str());
}
xPrime.resize(numberOfAtoms);
inverseMasses.resize(numberOfAtoms);
......
......@@ -27,10 +27,10 @@
#include <algorithm>
#include "SimTKOpenMMCommon.h"
#include "SimTKOpenMMLog.h"
#include "SimTKOpenMMUtilities.h"
#include "ReferenceVariableStochasticDynamics.h"
#include "ReferenceVirtualSites.h"
#include "openmm/OpenMMException.h"
#include <cstdio>
......@@ -53,27 +53,10 @@ ReferenceVariableStochasticDynamics::ReferenceVariableStochasticDynamics( int nu
RealOpenMM tau, RealOpenMM temperature,
RealOpenMM accuracy ) :
ReferenceDynamics(numberOfAtoms, 0.0f, temperature), _tau(tau), _accuracy(accuracy) {
// ---------------------------------------------------------------------------------------
static const char* methodName = "\nReferenceVariableStochasticDynamics::ReferenceVariableStochasticDynamics";
static const RealOpenMM zero = 0.0;
static const RealOpenMM one = 1.0;
// ---------------------------------------------------------------------------------------
// ensure tau is not zero -- if it is print warning message
if( _tau == zero ){
if (tau <= 0) {
std::stringstream message;
message << methodName;
message << " input tau value=" << tau << " is invalid -- setting to 1.";
SimTKOpenMMLog::printError( message );
_tau = one;
message << "illegal tau value: " << tau;
throw OpenMMException(message.str());
}
xPrime.resize(numberOfAtoms);
inverseMasses.resize(numberOfAtoms);
......
......@@ -27,7 +27,6 @@
#include <algorithm>
#include "SimTKOpenMMCommon.h"
#include "SimTKOpenMMLog.h"
#include "SimTKOpenMMUtilities.h"
#include "ReferenceVariableVerletDynamics.h"
#include "ReferenceVirtualSites.h"
......
......@@ -26,7 +26,6 @@
#include <sstream>
#include "SimTKOpenMMCommon.h"
#include "SimTKOpenMMLog.h"
#include "SimTKOpenMMUtilities.h"
#include "ReferenceVerletDynamics.h"
#include "ReferenceVirtualSites.h"
......
/* Portions copyright (c) 2006 Stanford University and Simbios.
* Contributors: Pande Group
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject
* to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "SimTKOpenMMLog.h"
#include <stdlib.h>
#include "openmm/OpenMMException.h"
using namespace OpenMM;
// static settings
SimTKOpenMMLog* SimTKOpenMMLog::_simTKOpenMMLog = NULL;
/**---------------------------------------------------------------------------------------
SimTKOpenMMLog constructor (Simbios)
@param logFile file reference for logging
--------------------------------------------------------------------------------------- */
SimTKOpenMMLog::SimTKOpenMMLog( FILE* logFile ) : _logFile( logFile ){
// ---------------------------------------------------------------------------------------
// static const std::string methodName = "\nSimTKOpenMMLog::SimTKOpenMMLog";
// ---------------------------------------------------------------------------------------
_logLevel = LogLowLevel;
}
/**---------------------------------------------------------------------------------------
SimTKOpenMMLog destructor (Simbios)
--------------------------------------------------------------------------------------- */
SimTKOpenMMLog::~SimTKOpenMMLog( ){
// ---------------------------------------------------------------------------------------
// static const std::string methodName = "\nSimTKOpenMMLog::~SimTKOpenMMLog";
// ---------------------------------------------------------------------------------------
}
/**---------------------------------------------------------------------------------------
Get LogFile
@return logFile
--------------------------------------------------------------------------------------- */
FILE* SimTKOpenMMLog::getLogFile( void ) const {
// ---------------------------------------------------------------------------------------
// static const std::string methodName = "\nSimTKOpenMMLog::getLogFile";
// ---------------------------------------------------------------------------------------
return _logFile;
}
/**---------------------------------------------------------------------------------------
Set LogFile
@param input logFile
--------------------------------------------------------------------------------------- */
void SimTKOpenMMLog::setLogFile( FILE* logFile ){
// ---------------------------------------------------------------------------------------
// static const std::string methodName = "\nSimTKOpenMMLog::setLogFile";
// ---------------------------------------------------------------------------------------
_logFile = logFile;
}
/**---------------------------------------------------------------------------------------
Set LogLevel
@param input logLevel
--------------------------------------------------------------------------------------- */
void SimTKOpenMMLog::setLogLevel( SimTKOpenMMLog::LogLevels logLevel ){
// ---------------------------------------------------------------------------------------
// static const std::string methodName = "\nSimTKOpenMMLog::setLogLevel";
// ---------------------------------------------------------------------------------------
_logLevel = logLevel;
}
/**---------------------------------------------------------------------------------------
SimTKOpenMMLog log message to log (Simbios)
@param message message to log
--------------------------------------------------------------------------------------- */
void SimTKOpenMMLog::logMessage( const std::stringstream& message ) const {
// ---------------------------------------------------------------------------------------
// static const std::string methodName = "\nSimTKOpenMMLog::logMessage";
// ---------------------------------------------------------------------------------------
if( _logFile ){
// (void) fprintf( stderr, "%s", message.str().c_str() );
// (void) fflush( stderr );
(void) fprintf( _logFile, "%s", message.str().c_str() );
(void) fflush( _logFile );
}
}
/**---------------------------------------------------------------------------------------
Set global simTKOpenMMLog (Simbios)
@param logFile file to log to
@return new SimTKOpenMMLog
--------------------------------------------------------------------------------------- */
SimTKOpenMMLog* SimTKOpenMMLog::setSimTKOpenMMLog( FILE* logFile ){
// ---------------------------------------------------------------------------------------
// static const std::string methodName = "\nSimTKOpenMMLog::setSimTKOpenMMLog";
// ---------------------------------------------------------------------------------------
// allow for multiple logs
/*
if( _simTKOpenMMLog ){
delete _simTKOpenMMLog;
}
*/
_simTKOpenMMLog = new SimTKOpenMMLog( logFile );
return _simTKOpenMMLog;
}
/**---------------------------------------------------------------------------------------
Get global simTKOpenMMLog -- static method (Simbios)
@return static member
--------------------------------------------------------------------------------------- */
SimTKOpenMMLog* SimTKOpenMMLog::getSimTKOpenMMLog( void ){
// ---------------------------------------------------------------------------------------
// static const std::string methodName = "\nSimTKOpenMMLog::getSimTKOpenMMLog";
// ---------------------------------------------------------------------------------------
if( !_simTKOpenMMLog ){
_simTKOpenMMLog = new SimTKOpenMMLog( );
}
return _simTKOpenMMLog;
}
/**---------------------------------------------------------------------------------------
Get global simTKOpenMMLog (Simbios)
@return FILE reference
--------------------------------------------------------------------------------------- */
FILE* SimTKOpenMMLog::getSimTKOpenMMLogFile( void ){
// ---------------------------------------------------------------------------------------
// static const std::string methodName = "\nSimTKOpenMMLog::getSimTKOpenMMLogFile";
// ---------------------------------------------------------------------------------------
SimTKOpenMMLog* simTKOpenMMLog = getSimTKOpenMMLog( );
return simTKOpenMMLog->getLogFile();
}
/**---------------------------------------------------------------------------------------
Static method to print message (Simbios)
@param message message to log
--------------------------------------------------------------------------------------- */
void SimTKOpenMMLog::printMessage( const std::stringstream& message ){
// ---------------------------------------------------------------------------------------
// static const std::string methodName = "\nSimTKOpenMMLog::printMessage";
// ---------------------------------------------------------------------------------------
if( _simTKOpenMMLog ){
_simTKOpenMMLog->logMessage( message );
} else {
(void) fprintf( stderr, "%s", message.str().c_str() );
(void) fflush( stderr );
}
}
/**---------------------------------------------------------------------------------------
Static method to print warning message (Simbios)
If global _simTKOpenMMLog is not set, then print to stderr
@param message message to log
--------------------------------------------------------------------------------------- */
void SimTKOpenMMLog::printWarning( const std::stringstream& message ){
// ---------------------------------------------------------------------------------------
// static const std::string methodName = "\nSimTKOpenMMLog::printWarning";
// ---------------------------------------------------------------------------------------
if( _simTKOpenMMLog ){
std::stringstream messageWithHeader;
messageWithHeader << "Warning: " << message.str();
_simTKOpenMMLog->logMessage( messageWithHeader );
} else {
(void) fprintf( stderr, "Warning: %s", message.str().c_str() );
}
}
/**---------------------------------------------------------------------------------------
Static method to print error message and exit program (Simbios)
If global _simTKOpenMMLog is not set, then print to stderr
@param message message to log
--------------------------------------------------------------------------------------- */
void SimTKOpenMMLog::printError( const std::stringstream& message ){
// ---------------------------------------------------------------------------------------
// static const std::string methodName = "\nSimTKOpenMMLog::printError";
// ---------------------------------------------------------------------------------------
std::stringstream messageWithHeader;
messageWithHeader << "Error: " << message.str();
if( _simTKOpenMMLog ){
_simTKOpenMMLog->logMessage( messageWithHeader );
} else {
(void) fprintf( stderr, "%s", messageWithHeader.str().c_str() );
(void) fflush( stderr );
}
throw OpenMM::OpenMMException(messageWithHeader.str());
}
......@@ -26,7 +26,6 @@
#include "openmm/internal/OSRngSeed.h"
#include "SimTKOpenMMUtilities.h"
#include "SimTKOpenMMLog.h"
#include "sfmt/SFMT.h"
// fabs(), ...
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment