Commit e0dfd821 authored by Mark Friedrichs's avatar Mark Friedrichs
Browse files

Mods for clean Windows compile

parent 25880017
...@@ -200,6 +200,7 @@ public: ...@@ -200,6 +200,7 @@ public:
buffer << "TorsionInfo::copyTorsionParameter: input torsionParameter index(=" << index << ") is not in range [0," << maxTorsions << ")!"; buffer << "TorsionInfo::copyTorsionParameter: input torsionParameter index(=" << index << ") is not in range [0," << maxTorsions << ")!";
throw OpenMMException( buffer.str() ); throw OpenMMException( buffer.str() );
} }
return 0;
} }
}; };
......
...@@ -61,7 +61,8 @@ public: ...@@ -61,7 +61,8 @@ public:
} }
std::vector<std::string> getKernelNames(); std::vector<std::string> getKernelNames();
static void reorderGrid( const TorsionTorsionGrid& grid, TorsionTorsionGrid& reorderedGrid ); OPENMM_EXPORT static void reorderGrid( const TorsionTorsionGrid& grid, TorsionTorsionGrid& reorderedGrid );
private: private:
AmoebaTorsionTorsionForce& owner; AmoebaTorsionTorsionForce& owner;
Kernel kernel; Kernel kernel;
......
...@@ -54,7 +54,7 @@ void AmoebaMultipoleForceImpl::initialize(ContextImpl& context) { ...@@ -54,7 +54,7 @@ void AmoebaMultipoleForceImpl::initialize(ContextImpl& context) {
for( int ii = 0; ii < system.getNumParticles(); ii++ ){ for( int ii = 0; ii < system.getNumParticles(); ii++ ){
int index, axisType, multipoleAtomZ, multipoleAtomX, multipoleAtomY; int axisType, multipoleAtomZ, multipoleAtomX, multipoleAtomY;
double charge, thole, dampingFactor, polarity ; double charge, thole, dampingFactor, polarity ;
std::vector<double> molecularDipole; std::vector<double> molecularDipole;
std::vector<double> molecularQuadrupole; std::vector<double> molecularQuadrupole;
......
...@@ -73,7 +73,7 @@ const TorsionTorsionGrid& AmoebaTorsionTorsionForce::getTorsionTorsionGrid(int i ...@@ -73,7 +73,7 @@ const TorsionTorsionGrid& AmoebaTorsionTorsionForce::getTorsionTorsionGrid(int i
} }
void AmoebaTorsionTorsionForce::setTorsionTorsionGrid(int index, const TorsionTorsionGrid& grid ) { void AmoebaTorsionTorsionForce::setTorsionTorsionGrid(int index, const TorsionTorsionGrid& grid ) {
if( index >= torsionTorsionGrids.size() ){ if( index >= static_cast<int>(torsionTorsionGrids.size()) ){
torsionTorsionGrids.resize( index + 1); torsionTorsionGrids.resize( index + 1);
} }
torsionTorsionGrids[index] = grid; torsionTorsionGrids[index] = grid;
......
...@@ -85,7 +85,7 @@ void AmoebaVdwForce::setParticleExclusions( int particleIndex, const std::vector ...@@ -85,7 +85,7 @@ void AmoebaVdwForce::setParticleExclusions( int particleIndex, const std::vector
if( exclusions.size() < parameters.size() ){ if( exclusions.size() < parameters.size() ){
exclusions.resize( parameters.size() ); exclusions.resize( parameters.size() );
} }
if( exclusions.size() < particleIndex ){ if( static_cast<int>(exclusions.size()) < particleIndex ){
exclusions.resize( particleIndex + 10 ); exclusions.resize( particleIndex + 10 );
} }
for( unsigned int ii = 0; ii < inputExclusions.size(); ii++ ){ for( unsigned int ii = 0; ii < inputExclusions.size(); ii++ ){
...@@ -95,7 +95,7 @@ void AmoebaVdwForce::setParticleExclusions( int particleIndex, const std::vector ...@@ -95,7 +95,7 @@ void AmoebaVdwForce::setParticleExclusions( int particleIndex, const std::vector
void AmoebaVdwForce::getParticleExclusions( int particleIndex, std::vector< int >& outputExclusions ) const { void AmoebaVdwForce::getParticleExclusions( int particleIndex, std::vector< int >& outputExclusions ) const {
if( particleIndex < exclusions.size() ){ if( particleIndex < static_cast<int>(exclusions.size()) ){
outputExclusions.resize( exclusions[particleIndex].size() ); outputExclusions.resize( exclusions[particleIndex].size() );
for( unsigned int ii = 0; ii < exclusions[particleIndex].size(); ii++ ){ for( unsigned int ii = 0; ii < exclusions[particleIndex].size(); ii++ ){
outputExclusions[ii] = exclusions[particleIndex][ii]; outputExclusions[ii] = exclusions[particleIndex][ii];
......
...@@ -1037,7 +1037,7 @@ void CudaCalcAmoebaMultipoleForceKernel::initialize(const System& system, const ...@@ -1037,7 +1037,7 @@ void CudaCalcAmoebaMultipoleForceKernel::initialize(const System& system, const
data.cudaPlatformData.nonbondedMethod = PARTICLE_MESH_EWALD; data.cudaPlatformData.nonbondedMethod = PARTICLE_MESH_EWALD;
amoebaGpuContext amoebaGpu = data.getAmoebaGpu(); amoebaGpuContext amoebaGpu = data.getAmoebaGpu();
gpuContext gpu = amoebaGpu->gpuContext; gpuContext gpu = amoebaGpu->gpuContext;
gpu->sim.nonbondedCutoffSqr = force.getCutoffDistance()*force.getCutoffDistance(); gpu->sim.nonbondedCutoffSqr = static_cast<float>(force.getCutoffDistance()*force.getCutoffDistance());
gpu->sim.nonbondedMethod = PARTICLE_MESH_EWALD; gpu->sim.nonbondedMethod = PARTICLE_MESH_EWALD;
} }
data.getAmoebaGpu()->gpuContext->forces.push_back(new ForceInfo(force)); data.getAmoebaGpu()->gpuContext->forces.push_back(new ForceInfo(force));
......
...@@ -195,7 +195,7 @@ RealOpenMM AmoebaReferenceHarmonicAngleForce::calculateForceAndEnergy( int numAn ...@@ -195,7 +195,7 @@ RealOpenMM AmoebaReferenceHarmonicAngleForce::calculateForceAndEnergy( int numAn
RealOpenMM angleSextic, RealOpenMM angleSextic,
vector<RealVec>& forceData) const { vector<RealVec>& forceData) const {
RealOpenMM energy = 0.0; RealOpenMM energy = 0.0;
for (unsigned int ii = 0; ii < numAngles; ii++) { for (unsigned int ii = 0; ii < static_cast<unsigned int>(numAngles); ii++) {
int particle1Index = particle1[ii]; int particle1Index = particle1[ii];
int particle2Index = particle2[ii]; int particle2Index = particle2[ii];
int particle3Index = particle3[ii]; int particle3Index = particle3[ii];
......
...@@ -258,7 +258,7 @@ RealOpenMM AmoebaReferenceHarmonicInPlaneAngleForce::calculateForceAndEnergy( in ...@@ -258,7 +258,7 @@ RealOpenMM AmoebaReferenceHarmonicInPlaneAngleForce::calculateForceAndEnergy( in
RealOpenMM angleSextic, RealOpenMM angleSextic,
vector<RealVec>& forceData) const { vector<RealVec>& forceData) const {
RealOpenMM energy = 0.0; RealOpenMM energy = 0.0;
for (unsigned int ii = 0; ii < numAngles; ii++) { for (unsigned int ii = 0; ii < static_cast<unsigned int>(numAngles); ii++) {
int particle1Index = particle1[ii]; int particle1Index = particle1[ii];
int particle2Index = particle2[ii]; int particle2Index = particle2[ii];
int particle3Index = particle3[ii]; int particle3Index = particle3[ii];
......
...@@ -1594,6 +1594,7 @@ void AmoebaReferenceMultipoleForce::mapTorqueToForce( const MultipoleParticleDat ...@@ -1594,6 +1594,7 @@ void AmoebaReferenceMultipoleForce::mapTorqueToForce( const MultipoleParticleDat
RealOpenMM vector[LastVectorIndex][3]; RealOpenMM vector[LastVectorIndex][3];
RealOpenMM angles[LastVectorIndex][2]; RealOpenMM angles[LastVectorIndex][2];
static const RealOpenMM zero = 0.0;
static const RealOpenMM one = 1.0; static const RealOpenMM one = 1.0;
static const RealOpenMM two = 2.0; static const RealOpenMM two = 2.0;
...@@ -1629,22 +1630,22 @@ void AmoebaReferenceMultipoleForce::mapTorqueToForce( const MultipoleParticleDat ...@@ -1629,22 +1630,22 @@ void AmoebaReferenceMultipoleForce::mapTorqueToForce( const MultipoleParticleDat
norms[VW] = AmoebaReferenceForce::normalizeVector3( vector[VW] ); norms[VW] = AmoebaReferenceForce::normalizeVector3( vector[VW] );
angles[UV][0] = AmoebaReferenceForce::getDotProduct3( vector[U], vector[V] ); angles[UV][0] = AmoebaReferenceForce::getDotProduct3( vector[U], vector[V] );
angles[UV][1] = sqrtf( 1.0f - angles[UV][0]*angles[UV][0]); angles[UV][1] = SQRT( one - angles[UV][0]*angles[UV][0]);
angles[UW][0] = AmoebaReferenceForce::getDotProduct3( vector[U], vector[W] ); angles[UW][0] = AmoebaReferenceForce::getDotProduct3( vector[U], vector[W] );
angles[UW][1] = sqrtf( 1.0f - angles[UW][0]*angles[UW][0]); angles[UW][1] = SQRT( one - angles[UW][0]*angles[UW][0]);
angles[VW][0] = AmoebaReferenceForce::getDotProduct3( vector[V], vector[W] ); angles[VW][0] = AmoebaReferenceForce::getDotProduct3( vector[V], vector[W] );
angles[VW][1] = sqrtf( 1.0f - angles[VW][0]*angles[VW][0]); angles[VW][1] = SQRT( one - angles[VW][0]*angles[VW][0]);
float dphi[3]; RealOpenMM dphi[3];
dphi[U] = AmoebaReferenceForce::getDotProduct3( vector[U], torque ); dphi[U] = AmoebaReferenceForce::getDotProduct3( vector[U], torque );
dphi[V] = AmoebaReferenceForce::getDotProduct3( vector[V], torque ); dphi[V] = AmoebaReferenceForce::getDotProduct3( vector[V], torque );
dphi[W] = AmoebaReferenceForce::getDotProduct3( vector[W], torque ); dphi[W] = AmoebaReferenceForce::getDotProduct3( vector[W], torque );
dphi[U] *= -1.0f; dphi[U] *= -one;
dphi[V] *= -1.0f; dphi[V] *= -one;
dphi[W] *= -1.0f; dphi[W] *= -one;
// branch based on axis type // branch based on axis type
...@@ -1653,20 +1654,21 @@ void AmoebaReferenceMultipoleForce::mapTorqueToForce( const MultipoleParticleDat ...@@ -1653,20 +1654,21 @@ void AmoebaReferenceMultipoleForce::mapTorqueToForce( const MultipoleParticleDat
if( axisType == AmoebaMultipoleForce::ZThenX || axisType == AmoebaMultipoleForce::Bisector ){ if( axisType == AmoebaMultipoleForce::ZThenX || axisType == AmoebaMultipoleForce::Bisector ){
float factor1; RealOpenMM factor1;
float factor2; RealOpenMM factor2;
float factor3; RealOpenMM factor3;
float factor4; RealOpenMM factor4;
RealOpenMM half = 0.5;
factor1 = dphi[V]/(norms[U]*angles[UV][1]); factor1 = dphi[V]/(norms[U]*angles[UV][1]);
factor2 = dphi[W]/(norms[U]); factor2 = dphi[W]/(norms[U]);
factor3 = -dphi[U]/(norms[V]*angles[UV][1]); factor3 = -dphi[U]/(norms[V]*angles[UV][1]);
if( axisType == AmoebaMultipoleForce::Bisector ){ if( axisType == AmoebaMultipoleForce::Bisector ){
factor2 *= 0.5f; factor2 *= half;
factor4 = 0.5f*dphi[W]/(norms[V]); factor4 = half*dphi[W]/(norms[V]);
} else { } else {
factor4 = 0.0f; factor4 = zero;
} }
for( int ii = 0; ii < 3; ii++ ){ for( int ii = 0; ii < 3; ii++ ){
...@@ -1701,16 +1703,16 @@ void AmoebaReferenceMultipoleForce::mapTorqueToForce( const MultipoleParticleDat ...@@ -1701,16 +1703,16 @@ void AmoebaReferenceMultipoleForce::mapTorqueToForce( const MultipoleParticleDat
norms[WS] = AmoebaReferenceForce::normalizeVector3( vector[WS] ); norms[WS] = AmoebaReferenceForce::normalizeVector3( vector[WS] );
angles[UR][0] = AmoebaReferenceForce::getDotProduct3( vector[U], vector[R] ); angles[UR][0] = AmoebaReferenceForce::getDotProduct3( vector[U], vector[R] );
angles[UR][1] = sqrtf( 1.0f - angles[UR][0]*angles[UR][0]); angles[UR][1] = SQRT( one - angles[UR][0]*angles[UR][0]);
angles[US][0] = AmoebaReferenceForce::getDotProduct3( vector[U], vector[S] ); angles[US][0] = AmoebaReferenceForce::getDotProduct3( vector[U], vector[S] );
angles[US][1] = sqrtf( 1.0f - angles[US][0]*angles[US][0]); angles[US][1] = SQRT( one - angles[US][0]*angles[US][0]);
angles[VS][0] = AmoebaReferenceForce::getDotProduct3( vector[V], vector[S] ); angles[VS][0] = AmoebaReferenceForce::getDotProduct3( vector[V], vector[S] );
angles[VS][1] = sqrtf( 1.0f - angles[VS][0]*angles[VS][0]); angles[VS][1] = SQRT( one - angles[VS][0]*angles[VS][0]);
angles[WS][0] = AmoebaReferenceForce::getDotProduct3( vector[W], vector[S] ); angles[WS][0] = AmoebaReferenceForce::getDotProduct3( vector[W], vector[S] );
angles[WS][1] = sqrtf( 1.0f - angles[WS][0]*angles[WS][0]); angles[WS][1] = SQRT( one - angles[WS][0]*angles[WS][0]);
RealOpenMM t1[3]; RealOpenMM t1[3];
RealOpenMM t2[3]; RealOpenMM t2[3];
...@@ -1726,13 +1728,13 @@ void AmoebaReferenceMultipoleForce::mapTorqueToForce( const MultipoleParticleDat ...@@ -1726,13 +1728,13 @@ void AmoebaReferenceMultipoleForce::mapTorqueToForce( const MultipoleParticleDat
notUsed = AmoebaReferenceForce::normalizeVector3( t2 ); notUsed = AmoebaReferenceForce::normalizeVector3( t2 );
RealOpenMM ut1cos = AmoebaReferenceForce::getDotProduct3( vector[U], t1 ); RealOpenMM ut1cos = AmoebaReferenceForce::getDotProduct3( vector[U], t1 );
RealOpenMM ut1sin = sqrtf( 1.0f - ut1cos*ut1cos); RealOpenMM ut1sin = SQRT( one - ut1cos*ut1cos);
RealOpenMM ut2cos = AmoebaReferenceForce::getDotProduct3( vector[U], t2 ); RealOpenMM ut2cos = AmoebaReferenceForce::getDotProduct3( vector[U], t2 );
RealOpenMM ut2sin = sqrtf( 1.0f - ut2cos*ut2cos); RealOpenMM ut2sin = SQRT( one - ut2cos*ut2cos);
RealOpenMM dphiR = -1.0f*AmoebaReferenceForce::getDotProduct3( vector[R], torque ); RealOpenMM dphiR = -one*AmoebaReferenceForce::getDotProduct3( vector[R], torque );
RealOpenMM dphiS = -1.0f*AmoebaReferenceForce::getDotProduct3( vector[S], torque ); RealOpenMM dphiS = -one*AmoebaReferenceForce::getDotProduct3( vector[S], torque );
RealOpenMM factor1 = dphiR/(norms[U]*angles[UR][1]); RealOpenMM factor1 = dphiR/(norms[U]*angles[UR][1]);
RealOpenMM factor2 = dphiS/(norms[U]); RealOpenMM factor2 = dphiS/(norms[U]);
......
...@@ -793,7 +793,7 @@ void CpuGBVISoftcore::printGbvi( const std::vector<OpenMM::RealVec>& atomCoordin ...@@ -793,7 +793,7 @@ void CpuGBVISoftcore::printGbvi( const std::vector<OpenMM::RealVec>& atomCoordin
gbviParameters->getBornRadiusScalingSoftcoreMethod(), GBVISoftcoreParameters::QuinticSpline ); gbviParameters->getBornRadiusScalingSoftcoreMethod(), GBVISoftcoreParameters::QuinticSpline );
(void) fprintf( log, " preFactor %15.7e)\n", preFactor ); (void) fprintf( log, " preFactor %15.7e)\n", preFactor );
for( int atomI = 0; atomI < numberOfAtoms; atomI++ ){ for( unsigned int atomI = 0; atomI < numberOfAtoms; atomI++ ){
(void) fprintf( log, "%6d r=%15.7e rSc=%15.7e swd=%15.7e lmda=%4.2f tau*gam=%15.7e q=%15.7e", atomI, (void) fprintf( log, "%6d r=%15.7e rSc=%15.7e swd=%15.7e lmda=%4.2f tau*gam=%15.7e q=%15.7e", atomI,
atomicRadii[atomI], atomicRadii[atomI],
scaledRadii[atomI], scaledRadii[atomI],
......
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