Commit 5b5ec4c3 authored by Mark Friedrichs's avatar Mark Friedrichs
Browse files

Adding BrookPlatform back in -- deleted wrong file earlier

Fixed getTime() calls in _openMMBrookInterface()
Based on Sherm's suggestions:
changed '#ifdef WIN32' to '#ifdef WIN32 _MSC_VER;
reordered include files so that system files after OpenMM files
all include files should be C++ files now (as opposed to C files (<math.h> -> <cmath>
parent 513303d8
......@@ -675,7 +675,7 @@ if( !(ii % 2 ) )fprintf( log, "]\n", posArray[ii] );
float diff = fabsf( distance - cluster._distance );
if( diff > tolerance && (errors++ < maxErrorToPrint || maxErrorToPrint < 0) ){
char value[1024];
#ifdef WIN32
#ifdef _MSC_VER
sprintf_s( value, 1024, "Error: Atom [%6d %6d] d[%16.7e %16.7e] diff=%16.7e [%16.7e %16.7e %16.7e] [%16.7e %16.7e %16.7e]\n",
centralAtomIndex/3, peripheralAtomIndex/3, distance, cluster._distance, diff,
posArray[centralAtomIndex], posArray[centralAtomIndex+1], posArray[centralAtomIndex+2],
......@@ -704,7 +704,7 @@ if( !(ii % 2 ) )fprintf( log, "]\n", posArray[ii] );
char text[1024];
if( errors ){
#ifdef WIN32
#ifdef _MSC_VER
(void) sprintf_s( text, 1024, "Shake errors=%d tol=%.3e mxDff=%.3e atoms[%d %d]", errors, tolerance, maxDiff, maxDiffCentralIndex, maxDiffPeripheralIndex );
#else
(void) sprintf( text, "Shake errors=%d tol=%.3e mxDff=%.3e atoms[%d %d]", errors, tolerance, maxDiff, maxDiffCentralIndex, maxDiffPeripheralIndex );
......@@ -713,7 +713,7 @@ if( !(ii % 2 ) )fprintf( log, "]\n", posArray[ii] );
if( errors >= maxErrorToPrint ){
#ifdef WIN32
#ifdef _MSC_VER
(void) sprintf_s( text, 1024, " only printing first %d errors", maxErrorToPrint );
#else
(void) sprintf( text, " only printing first %d errors", maxErrorToPrint );
......@@ -725,7 +725,7 @@ if( !(ii % 2 ) )fprintf( log, "]\n", posArray[ii] );
} else {
#ifdef WIN32
#ifdef _MSC_VER
(void) sprintf_s( text, 1024, "Shake no errors: tol=%.3e mxDff=%.3e", tolerance, maxDiff );
#else
(void) sprintf( text, "Shake no errors: tol=%.3e mxDff=%.3e", tolerance, maxDiff );
......@@ -764,7 +764,7 @@ std::string BrookShakeAlgorithm::getContentsString( int level ) const {
std::stringstream message;
std::string tab = " ";
#ifdef WIN32
#ifdef _MSC_VER
#define LOCAL_SPRINTF(a,b,c) sprintf_s( (a), MAX_LINE_CHARS, (b), (c) );
#else
#define LOCAL_SPRINTF(a,b,c) sprintf( (a), (b), (c) );
......@@ -807,7 +807,7 @@ std::string BrookShakeAlgorithm::getContentsString( int level ) const {
char buffer[1024];
const ShakeCluster& cluster = iter->second;
#ifdef WIN32
#ifdef _MSC_VER
sprintf_s( buffer, 1024, "%5d %6d [%6d %6d %6d] d=%.3f m[%12.5f %12.5f]", index++, cluster._centralID,
cluster._peripheralID[0], cluster._peripheralID[1], cluster._peripheralID[2],
cluster._distance, cluster._centralInvMass, cluster._peripheralInvMass );
......
......@@ -24,13 +24,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* -------------------------------------------------------------------------- */
#include <sstream>
#include "openmm/OpenMMException.h"
#include "BrookStreamFactory.h"
#include "BrookStreamImpl.h"
#include "openmm/internal/OpenMMContextImpl.h"
#include "OpenMMBrookInterface.h"
#include <sstream>
using namespace OpenMM;
const std::string BrookStreamFactory::ParticlePositions = "particlePositions";
......
......@@ -24,10 +24,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* -------------------------------------------------------------------------- */
#include <sstream>
#include "openmm/OpenMMException.h"
#include "BrookStreamImpl.h"
#include <sstream>
using namespace OpenMM;
using namespace std;
......
......@@ -24,11 +24,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* -------------------------------------------------------------------------- */
#include <sstream>
#include "openmm/OpenMMException.h"
#include "BrookStreamInternal.h"
#ifdef _WIN32
#include <sstream>
#ifdef _MSC_VER
#include <float.h>
#define isnan _isnan
......@@ -275,7 +276,7 @@ std::string BrookStreamInternal::_getLine( const std::string& tab,
std::stringstream message;
memset( line, ' ', MAX_LINE_CHARS );
#ifdef WIN32
#ifdef _MSC_VER
(void) sprintf_s( line, MAX_LINE_CHARS, "%s %-40s %s", tab.c_str(), description.c_str(), value.c_str() );
#else
(void) sprintf( line, "%s %-40s %s", tab.c_str(), description.c_str(), value.c_str() );
......@@ -343,7 +344,7 @@ const std::string BrookStreamInternal::getContentsString( int level ) const {
std::stringstream message;
std::string tab = " ";
#ifdef WIN32
#ifdef _MSC_VER
#define LOCAL_SPRINTF(a,b,c) sprintf_s( (a), MAX_LINE_CHARS, (b), (c) );
#else
#define LOCAL_SPRINTF(a,b,c) sprintf( (a), (b), (c) );
......@@ -421,7 +422,7 @@ std::string BrookStreamInternal::printStatistics( std::string tag, std::vector<s
header.push_back( "Count" );
}
#ifdef WIN32
#ifdef _MSC_VER
#define LOCAL_SPRINTF(a,b,c) sprintf_s( (a), MAX_LINE_CHARS, (b), (c) );
#else
#define LOCAL_SPRINTF(a,b,c) sprintf( (a), (b), (c) );
......@@ -476,7 +477,7 @@ int BrookStreamInternal::printStreamsToFile( std::string fileName, std::vector<B
// ---------------------------------------------------------------------------------------
FILE* filePtr;
#ifdef WIN32
#ifdef _MSC_VER
fopen_s( &filePtr, fileName.c_str(), "w" );
#else
filePtr = fopen( fileName.c_str(), "w" );
......@@ -605,7 +606,7 @@ int BrookStreamInternal::loadStreamGivenFileName( std::string& fileName ){
/* open file, read header */
FILE* filePtr;
#ifdef WIN32
#ifdef _MSC_VER
fopen_s( &filePtr, fileName.c_str(), "rb" );
#else
filePtr = fopen( fileName.c_str(), "rb" );
......
......@@ -25,10 +25,10 @@
* -------------------------------------------------------------------------- */
#include "openmm/OpenMMException.h"
#include <sstream>
#include "BrookUpdateTimeKernel.h"
#include <sstream>
using namespace OpenMM;
using namespace std;
......
......@@ -24,13 +24,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* -------------------------------------------------------------------------- */
#include <sstream>
#include "BrookVelocityCenterOfMassRemoval.h"
#include "BrookPlatform.h"
#include "openmm/OpenMMException.h"
#include "BrookStreamImpl.h"
#include "kernels/kcom.h"
#include <sstream>
using namespace OpenMM;
using namespace std;
......@@ -397,7 +398,7 @@ std::string BrookVelocityCenterOfMassRemoval::getContentsString( int level ) con
std::stringstream message;
std::string tab = " ";
#ifdef WIN32
#ifdef _MSC_VER
#define LOCAL_SPRINTF(a,b,c) sprintf_s( (a), MAX_LINE_CHARS, (b), (c) );
#else
#define LOCAL_SPRINTF(a,b,c) sprintf( (a), (b), (c) );
......
......@@ -24,7 +24,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* -------------------------------------------------------------------------- */
#include <sstream>
#include "BrookVerletDynamics.h"
#include "BrookPlatform.h"
#include "openmm/OpenMMException.h"
......@@ -33,6 +32,8 @@
#include "kernels/kupdatemd.h"
#include "kernels/kcommon.h"
#include <sstream>
using namespace OpenMM;
using namespace std;
......@@ -409,7 +410,7 @@ std::string BrookVerletDynamics::getContentsString( int level ) const {
std::stringstream message;
std::string tab = " ";
#ifdef WIN32
#ifdef _MSC_VER
#define LOCAL_SPRINTF(a,b,c) sprintf_s( (a), MAX_LINE_CHARS, (b), (c) );
#else
#define LOCAL_SPRINTF(a,b,c) sprintf( (a), (b), (c) );
......
......@@ -24,19 +24,19 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* -------------------------------------------------------------------------- */
#include <cmath>
#include <limits>
#include "openmm/OpenMMException.h"
#include <sstream>
#include "openmm/LangevinIntegrator.h"
#include "ReferencePlatform.h"
#include "openmm/internal/OpenMMContextImpl.h"
#include "openmm/OpenMMException.h"
#include "BrookStreamImpl.h"
#include "OpenMMBrookInterface.h"
#include "kernels/kcommon.h"
#include <cmath>
#include <limits>
#include <sstream>
using namespace OpenMM;
using namespace std;
......
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