Commit 7fb10336 authored by peastman's avatar peastman
Browse files

Cleaned up lots of formatting to be more consistent with the rest of OpenMM

parent 1d3ffd7b
......@@ -67,9 +67,9 @@ class ReferenceLJCoulombIxn {
--------------------------------------------------------------------------------------- */
void calculateOneIxn( int atom1, int atom2, std::vector<OpenMM::RealVec>& atomCoordinates,
RealOpenMM** atomParameters, std::vector<OpenMM::RealVec>& forces,
RealOpenMM* energyByAtom, RealOpenMM* totalEnergy ) const;
void calculateOneIxn(int atom1, int atom2, std::vector<OpenMM::RealVec>& atomCoordinates,
RealOpenMM** atomParameters, std::vector<OpenMM::RealVec>& forces,
RealOpenMM* energyByAtom, RealOpenMM* totalEnergy) const;
public:
......@@ -80,7 +80,7 @@ class ReferenceLJCoulombIxn {
--------------------------------------------------------------------------------------- */
ReferenceLJCoulombIxn( );
ReferenceLJCoulombIxn();
/**---------------------------------------------------------------------------------------
......@@ -88,7 +88,7 @@ class ReferenceLJCoulombIxn {
--------------------------------------------------------------------------------------- */
~ReferenceLJCoulombIxn( );
~ReferenceLJCoulombIxn();
/**---------------------------------------------------------------------------------------
......@@ -100,7 +100,7 @@ class ReferenceLJCoulombIxn {
--------------------------------------------------------------------------------------- */
void setUseCutoff( RealOpenMM distance, const OpenMM::NeighborList& neighbors, RealOpenMM solventDielectric );
void setUseCutoff(RealOpenMM distance, const OpenMM::NeighborList& neighbors, RealOpenMM solventDielectric);
/**---------------------------------------------------------------------------------------
......@@ -110,7 +110,7 @@ class ReferenceLJCoulombIxn {
--------------------------------------------------------------------------------------- */
void setUseSwitchingFunction( RealOpenMM distance );
void setUseSwitchingFunction(RealOpenMM distance);
/**---------------------------------------------------------------------------------------
......
......@@ -92,7 +92,7 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm {
--------------------------------------------------------------------------------------- */
ReferenceLincsAlgorithm( int numberOfConstraints, int** atomIndices, RealOpenMM* distance );
ReferenceLincsAlgorithm(int numberOfConstraints, int** atomIndices, RealOpenMM* distance);
/**---------------------------------------------------------------------------------------
......@@ -102,7 +102,7 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm {
--------------------------------------------------------------------------------------- */
int getNumberOfConstraints( void ) const;
int getNumberOfConstraints() const;
/**---------------------------------------------------------------------------------------
......@@ -112,7 +112,7 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm {
--------------------------------------------------------------------------------------- */
int getNumTerms( void ) const;
int getNumTerms() const;
/**---------------------------------------------------------------------------------------
......@@ -120,7 +120,7 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm {
--------------------------------------------------------------------------------------- */
void setNumTerms( int terms );
void setNumTerms(int terms);
/**---------------------------------------------------------------------------------------
......@@ -136,8 +136,8 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm {
--------------------------------------------------------------------------------------- */
int apply( int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates,
std::vector<OpenMM::RealVec>& atomCoordinatesP, std::vector<RealOpenMM>& inverseMasses );
int apply(int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates,
std::vector<OpenMM::RealVec>& atomCoordinatesP, std::vector<RealOpenMM>& inverseMasses);
/**---------------------------------------------------------------------------------------
......
......@@ -27,7 +27,7 @@ void OPENMM_EXPORT computeNeighborListNaive(
double maxDistance,
double minDistance = 0.0,
bool reportSymmetricPairs = false
);
);
// O(n) neighbor list method using voxel hash data structure
// parameter neighborList is automatically clear()ed before
......@@ -42,7 +42,7 @@ void OPENMM_EXPORT computeNeighborListVoxelHash(
double maxDistance,
double minDistance = 0.0,
bool reportSymmetricPairs = false
);
);
} // namespace OpenMM
......
......@@ -42,7 +42,7 @@ class OPENMM_EXPORT ReferencePairIxn {
--------------------------------------------------------------------------------------- */
ReferencePairIxn( );
ReferencePairIxn();
/**---------------------------------------------------------------------------------------
......@@ -50,7 +50,7 @@ class OPENMM_EXPORT ReferencePairIxn {
--------------------------------------------------------------------------------------- */
~ReferencePairIxn( );
~ReferencePairIxn();
/**---------------------------------------------------------------------------------------
......@@ -67,10 +67,10 @@ class OPENMM_EXPORT ReferencePairIxn {
--------------------------------------------------------------------------------------- */
virtual void calculatePairIxn( int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates,
virtual void calculatePairIxn(int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates,
RealOpenMM** atomParameters, int** exclusions,
RealOpenMM* fixedParameters, std::vector<OpenMM::RealVec>& forces,
RealOpenMM* energyByAtom, RealOpenMM* totalEnergy ) const = 0;
RealOpenMM* energyByAtom, RealOpenMM* totalEnergy) const = 0;
};
......
......@@ -41,7 +41,7 @@ class OPENMM_EXPORT ReferenceProperDihedralBond : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
ReferenceProperDihedralBond( );
ReferenceProperDihedralBond();
/**---------------------------------------------------------------------------------------
......@@ -49,7 +49,7 @@ class OPENMM_EXPORT ReferenceProperDihedralBond : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
~ReferenceProperDihedralBond( );
~ReferenceProperDihedralBond();
/**---------------------------------------------------------------------------------------
......@@ -65,9 +65,9 @@ class OPENMM_EXPORT ReferenceProperDihedralBond : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
void calculateBondIxn( int* atomIndices, std::vector<OpenMM::RealVec>& atomCoordinates,
void calculateBondIxn(int* atomIndices, std::vector<OpenMM::RealVec>& atomCoordinates,
RealOpenMM* parameters, std::vector<OpenMM::RealVec>& forces,
RealOpenMM* totalEnergy ) const;
RealOpenMM* totalEnergy) const;
};
......
......@@ -41,7 +41,7 @@ class OPENMM_EXPORT ReferenceRbDihedralBond : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
ReferenceRbDihedralBond( );
ReferenceRbDihedralBond();
/**---------------------------------------------------------------------------------------
......@@ -49,7 +49,7 @@ class OPENMM_EXPORT ReferenceRbDihedralBond : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
~ReferenceRbDihedralBond( );
~ReferenceRbDihedralBond();
/**---------------------------------------------------------------------------------------
......@@ -63,9 +63,9 @@ class OPENMM_EXPORT ReferenceRbDihedralBond : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
void calculateBondIxn( int* atomIndices, std::vector<OpenMM::RealVec>& atomCoordinates,
void calculateBondIxn(int* atomIndices, std::vector<OpenMM::RealVec>& atomCoordinates,
RealOpenMM* parameters, std::vector<OpenMM::RealVec>& forces,
RealOpenMM* totalEnergy ) const;
RealOpenMM* totalEnergy) const;
};
......
......@@ -51,7 +51,7 @@ class OPENMM_EXPORT ReferenceStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
ReferenceStochasticDynamics( int numberOfAtoms, RealOpenMM deltaT, RealOpenMM tau, RealOpenMM temperature );
ReferenceStochasticDynamics(int numberOfAtoms, RealOpenMM deltaT, RealOpenMM tau, RealOpenMM temperature);
/**---------------------------------------------------------------------------------------
......@@ -59,7 +59,7 @@ class OPENMM_EXPORT ReferenceStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
~ReferenceStochasticDynamics( );
~ReferenceStochasticDynamics();
/**---------------------------------------------------------------------------------------
......@@ -69,7 +69,7 @@ class OPENMM_EXPORT ReferenceStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
RealOpenMM getTau( void ) const;
RealOpenMM getTau() const;
/**---------------------------------------------------------------------------------------
......@@ -100,8 +100,8 @@ class OPENMM_EXPORT ReferenceStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
virtual void updatePart1( int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates, std::vector<OpenMM::RealVec>& velocities,
std::vector<OpenMM::RealVec>& forces, std::vector<RealOpenMM>& inverseMasses, std::vector<OpenMM::RealVec>& xPrime );
virtual void updatePart1(int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates, std::vector<OpenMM::RealVec>& velocities,
std::vector<OpenMM::RealVec>& forces, std::vector<RealOpenMM>& inverseMasses, std::vector<OpenMM::RealVec>& xPrime);
/**---------------------------------------------------------------------------------------
......@@ -115,8 +115,8 @@ class OPENMM_EXPORT ReferenceStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
virtual void updatePart2( int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates, std::vector<OpenMM::RealVec>& velocities,
std::vector<OpenMM::RealVec>& forces, std::vector<RealOpenMM>& inverseMasses, std::vector<OpenMM::RealVec>& xPrime );
virtual void updatePart2(int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates, std::vector<OpenMM::RealVec>& velocities,
std::vector<OpenMM::RealVec>& forces, std::vector<RealOpenMM>& inverseMasses, std::vector<OpenMM::RealVec>& xPrime);
};
......
......@@ -50,7 +50,7 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
ReferenceVariableStochasticDynamics( int numberOfAtoms, RealOpenMM tau, RealOpenMM temperature, RealOpenMM accuracy );
ReferenceVariableStochasticDynamics(int numberOfAtoms, RealOpenMM tau, RealOpenMM temperature, RealOpenMM accuracy);
/**---------------------------------------------------------------------------------------
......@@ -58,7 +58,7 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
~ReferenceVariableStochasticDynamics( );
~ReferenceVariableStochasticDynamics();
/**---------------------------------------------------------------------------------------
......@@ -68,7 +68,7 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
RealOpenMM getTau( void ) const;
RealOpenMM getTau() const;
/**---------------------------------------------------------------------------------------
......@@ -78,7 +78,7 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
RealOpenMM getAccuracy( void ) const;
RealOpenMM getAccuracy() const;
/**---------------------------------------------------------------------------------------
......@@ -86,7 +86,7 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
void setAccuracy( RealOpenMM accuracy );
void setAccuracy(RealOpenMM accuracy);
/**---------------------------------------------------------------------------------------
......@@ -120,9 +120,9 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
void updatePart1( int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates, std::vector<OpenMM::RealVec>& velocities,
void updatePart1(int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates, std::vector<OpenMM::RealVec>& velocities,
std::vector<OpenMM::RealVec>& forces, std::vector<RealOpenMM>& masses, std::vector<RealOpenMM>& inverseMasses,
std::vector<OpenMM::RealVec>& xPrime, RealOpenMM maxStepSize );
std::vector<OpenMM::RealVec>& xPrime, RealOpenMM maxStepSize);
/**---------------------------------------------------------------------------------------
......@@ -136,9 +136,9 @@ class ReferenceVariableStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
void updatePart2( int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates, std::vector<OpenMM::RealVec>& velocities,
void updatePart2(int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates, std::vector<OpenMM::RealVec>& velocities,
std::vector<OpenMM::RealVec>& forces, std::vector<RealOpenMM>& inverseMasses,
std::vector<OpenMM::RealVec>& xPrime );
std::vector<OpenMM::RealVec>& xPrime);
};
......
......@@ -48,7 +48,7 @@ class ReferenceVariableVerletDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
ReferenceVariableVerletDynamics( int numberOfAtoms, RealOpenMM accuracy );
ReferenceVariableVerletDynamics(int numberOfAtoms, RealOpenMM accuracy);
/**---------------------------------------------------------------------------------------
......@@ -56,7 +56,7 @@ class ReferenceVariableVerletDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
~ReferenceVariableVerletDynamics( );
~ReferenceVariableVerletDynamics();
/**---------------------------------------------------------------------------------------
......@@ -66,7 +66,7 @@ class ReferenceVariableVerletDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
RealOpenMM getAccuracy( void ) const;
RealOpenMM getAccuracy() const;
/**---------------------------------------------------------------------------------------
......@@ -74,7 +74,7 @@ class ReferenceVariableVerletDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
void setAccuracy( RealOpenMM accuracy );
void setAccuracy(RealOpenMM accuracy);
/**---------------------------------------------------------------------------------------
......
......@@ -49,7 +49,7 @@ class ReferenceVerletDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
ReferenceVerletDynamics( int numberOfAtoms, RealOpenMM deltaT );
ReferenceVerletDynamics(int numberOfAtoms, RealOpenMM deltaT);
/**---------------------------------------------------------------------------------------
......@@ -57,7 +57,7 @@ class ReferenceVerletDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
~ReferenceVerletDynamics( );
~ReferenceVerletDynamics();
/**---------------------------------------------------------------------------------------
......
......@@ -56,8 +56,8 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
// dummy constructor/destructor
SimTKOpenMMUtilities(){};
~SimTKOpenMMUtilities(){};
SimTKOpenMMUtilities() {};
~SimTKOpenMMUtilities() {};
/**---------------------------------------------------------------------------------------
......@@ -75,9 +75,9 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
--------------------------------------------------------------------------------------- */
static RealOpenMM* allocateOneDRealOpenMMArray( int iSize, RealOpenMM* array1D, int initialize,
static RealOpenMM* allocateOneDRealOpenMMArray(int iSize, RealOpenMM* array1D, int initialize,
RealOpenMM initialValue,
const std::string& idString = std::string( "1DArray" ) );
const std::string& idString = std::string("1DArray"));
/**---------------------------------------------------------------------------------------
......@@ -96,10 +96,10 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
--------------------------------------------------------------------------------------- */
static RealOpenMM** allocateTwoDRealOpenMMArray( int iSize, int jSize,
static RealOpenMM** allocateTwoDRealOpenMMArray(int iSize, int jSize,
RealOpenMM** array2D, int initialize,
RealOpenMM initialValue,
const std::string& idString = std::string( "2DArray" ) );
const std::string& idString = std::string("2DArray"));
/* ---------------------------------------------------------------------------------------
......@@ -112,8 +112,8 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
--------------------------------------------------------------------------------------- */
static void freeOneDRealOpenMMArray( RealOpenMM* array1D,
const std::string& idString = std::string( "1DArray" ) );
static void freeOneDRealOpenMMArray(RealOpenMM* array1D,
const std::string& idString = std::string("1DArray"));
/* ---------------------------------------------------------------------------------------
......@@ -126,8 +126,8 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
--------------------------------------------------------------------------------------- */
static void freeTwoDRealOpenMMArray( RealOpenMM** array2D,
const std::string& idString = std::string( "2DArray" ) );
static void freeTwoDRealOpenMMArray(RealOpenMM** array2D,
const std::string& idString = std::string("2DArray"));
/**---------------------------------------------------------------------------------------
......@@ -142,8 +142,8 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
--------------------------------------------------------------------------------------- */
static void initialize2DRealOpenMMArray( int iSize, int jSize,
RealOpenMM** array2D, RealOpenMM initialValue );
static void initialize2DRealOpenMMArray(int iSize, int jSize,
RealOpenMM** array2D, RealOpenMM initialValue);
/**---------------------------------------------------------------------------------------
......@@ -159,7 +159,7 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
--------------------------------------------------------------------------------------- */
static void crossProductVector3( RealOpenMM* vectorX, RealOpenMM* vectorY, RealOpenMM* vectorZ );
static void crossProductVector3(RealOpenMM* vectorX, RealOpenMM* vectorY, RealOpenMM* vectorZ);
/**---------------------------------------------------------------------------------------
......@@ -169,7 +169,7 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
--------------------------------------------------------------------------------------- */
static RealOpenMM getNormallyDistributedRandomNumber( void );
static RealOpenMM getNormallyDistributedRandomNumber();
/**---------------------------------------------------------------------------------------
......@@ -179,7 +179,7 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
--------------------------------------------------------------------------------------- */
static RealOpenMM getUniformlyDistributedRandomNumber( void );
static RealOpenMM getUniformlyDistributedRandomNumber();
/**---------------------------------------------------------------------------------------
......@@ -189,7 +189,7 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
--------------------------------------------------------------------------------------- */
static uint32_t getRandomNumberSeed( void );
static uint32_t getRandomNumberSeed();
/**---------------------------------------------------------------------------------------
......@@ -199,7 +199,7 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
--------------------------------------------------------------------------------------- */
static void setRandomNumberSeed( uint32_t seed );
static void setRandomNumberSeed(uint32_t seed);
/**---------------------------------------------------------------------------------------
......
......@@ -100,5 +100,5 @@ KernelImpl* ReferenceKernelFactory::createKernelImpl(std::string name, const Pla
return new ReferenceApplyMonteCarloBarostatKernel(name, platform);
if (name == RemoveCMMotionKernel::Name())
return new ReferenceRemoveCMMotionKernel(name, platform, data);
throw OpenMMException( (std::string("Tried to create kernel with illegal kernel name '") + name + "'").c_str() );
throw OpenMMException((std::string("Tried to create kernel with illegal kernel name '") + name + "'").c_str());
}
......@@ -1105,8 +1105,8 @@ void ReferenceCalcGBSAOBCForceKernel::initialize(const System& system, const GBS
ObcParameters* obcParameters = new ObcParameters(numParticles, ObcParameters::ObcTypeII);
obcParameters->setAtomicRadii(atomicRadii);
obcParameters->setScaledRadiusFactors(scaleFactors);
obcParameters->setSolventDielectric( static_cast<RealOpenMM>(force.getSolventDielectric()) );
obcParameters->setSoluteDielectric( static_cast<RealOpenMM>(force.getSoluteDielectric()) );
obcParameters->setSolventDielectric(static_cast<RealOpenMM>(force.getSolventDielectric()));
obcParameters->setSoluteDielectric(static_cast<RealOpenMM>(force.getSoluteDielectric()));
obcParameters->setPi4Asolv(4*M_PI*force.getSurfaceAreaEnergy());
if (force.getNonbondedMethod() != GBSAOBCForce::NoCutoff)
obcParameters->setUseCutoff(static_cast<RealOpenMM>(force.getCutoffDistance()));
......@@ -1152,7 +1152,7 @@ ReferenceCalcGBVIForceKernel::~ReferenceCalcGBVIForceKernel() {
}
}
void ReferenceCalcGBVIForceKernel::initialize(const System& system, const GBVIForce& force, const std::vector<double> & inputScaledRadii ) {
void ReferenceCalcGBVIForceKernel::initialize(const System& system, const GBVIForce& force, const std::vector<double> & inputScaledRadii) {
int numParticles = system.getNumParticles();
......@@ -1201,7 +1201,7 @@ double ReferenceCalcGBVIForceKernel::execute(ContextImpl& context, bool includeF
gbvi->computeBornForces(posData, charges, forceData);
energy = 0.0;
}
if( includeEnergy ){
if (includeEnergy) {
energy = gbvi->computeBornEnergy(posData, charges);
}
return static_cast<double>(energy);
......@@ -1710,7 +1710,7 @@ void ReferenceIntegrateVerletStepKernel::execute(ContextImpl& context, const Ver
if (dynamics)
delete dynamics;
dynamics = new ReferenceVerletDynamics(context.getSystem().getNumParticles(), static_cast<RealOpenMM>(stepSize) );
dynamics = new ReferenceVerletDynamics(context.getSystem().getNumParticles(), static_cast<RealOpenMM>(stepSize));
dynamics->setReferenceConstraintAlgorithm(&extractConstraints(context));
prevStepSize = stepSize;
}
......@@ -1748,12 +1748,12 @@ void ReferenceIntegrateLangevinStepKernel::execute(ContextImpl& context, const L
if (dynamics)
delete dynamics;
RealOpenMM tau = static_cast<RealOpenMM>( friction == 0.0 ? 0.0 : 1.0/friction );
RealOpenMM tau = static_cast<RealOpenMM>(friction == 0.0 ? 0.0 : 1.0/friction);
dynamics = new ReferenceStochasticDynamics(
context.getSystem().getNumParticles(),
static_cast<RealOpenMM>(stepSize),
static_cast<RealOpenMM>(tau),
static_cast<RealOpenMM>(temperature) );
static_cast<RealOpenMM>(temperature));
dynamics->setReferenceConstraintAlgorithm(&extractConstraints(context));
prevTemp = temperature;
prevFriction = friction;
......@@ -1797,7 +1797,7 @@ void ReferenceIntegrateBrownianStepKernel::execute(ContextImpl& context, const B
context.getSystem().getNumParticles(),
static_cast<RealOpenMM>(stepSize),
static_cast<RealOpenMM>(friction),
static_cast<RealOpenMM>(temperature) );
static_cast<RealOpenMM>(temperature));
dynamics->setReferenceConstraintAlgorithm(&extractConstraints(context));
prevTemp = temperature;
prevFriction = friction;
......@@ -1837,7 +1837,7 @@ double ReferenceIntegrateVariableLangevinStepKernel::execute(ContextImpl& contex
if (dynamics)
delete dynamics;
RealOpenMM tau = static_cast<RealOpenMM>( friction == 0.0 ? 0.0 : 1.0/friction );
RealOpenMM tau = static_cast<RealOpenMM>(friction == 0.0 ? 0.0 : 1.0/friction);
dynamics = new ReferenceVariableStochasticDynamics(context.getSystem().getNumParticles(), (RealOpenMM) tau, (RealOpenMM) temperature, (RealOpenMM) errorTol);
dynamics->setReferenceConstraintAlgorithm(&extractConstraints(context));
prevTemp = temperature;
......
......@@ -37,7 +37,7 @@ using namespace OpenMM;
--------------------------------------------------------------------------------------- */
ReferenceAndersenThermostat::ReferenceAndersenThermostat( ) {
ReferenceAndersenThermostat::ReferenceAndersenThermostat() {
}
/**---------------------------------------------------------------------------------------
......@@ -46,7 +46,7 @@ using namespace OpenMM;
--------------------------------------------------------------------------------------- */
ReferenceAndersenThermostat::~ReferenceAndersenThermostat( ) {
ReferenceAndersenThermostat::~ReferenceAndersenThermostat() {
}
/**---------------------------------------------------------------------------------------
......@@ -61,8 +61,8 @@ using namespace OpenMM;
--------------------------------------------------------------------------------------- */
void ReferenceAndersenThermostat::applyThermostat( const vector<vector<int> >& atomGroups, vector<RealVec>& atomVelocities, vector<RealOpenMM>& atomMasses,
RealOpenMM temperature, RealOpenMM collisionFrequency, RealOpenMM stepSize ) const {
void ReferenceAndersenThermostat::applyThermostat(const vector<vector<int> >& atomGroups, vector<RealVec>& atomVelocities, vector<RealOpenMM>& atomMasses,
RealOpenMM temperature, RealOpenMM collisionFrequency, RealOpenMM stepSize) const {
const RealOpenMM collisionProbability = 1.0f - EXP(-collisionFrequency*stepSize);
for (int i = 0; i < (int) atomGroups.size(); ++i) {
......
......@@ -39,7 +39,7 @@ using namespace OpenMM;
--------------------------------------------------------------------------------------- */
ReferenceAngleBondIxn::ReferenceAngleBondIxn( ){
ReferenceAngleBondIxn::ReferenceAngleBondIxn() {
// ---------------------------------------------------------------------------------------
......@@ -55,7 +55,7 @@ ReferenceAngleBondIxn::ReferenceAngleBondIxn( ){
--------------------------------------------------------------------------------------- */
ReferenceAngleBondIxn::~ReferenceAngleBondIxn( ){
ReferenceAngleBondIxn::~ReferenceAngleBondIxn() {
// ---------------------------------------------------------------------------------------
......@@ -77,8 +77,8 @@ ReferenceAngleBondIxn::~ReferenceAngleBondIxn( ){
--------------------------------------------------------------------------------------- */
void ReferenceAngleBondIxn::getPrefactorsGivenAngleCosine( RealOpenMM cosine, RealOpenMM* angleParameters,
RealOpenMM* dEdR, RealOpenMM* energyTerm ) const {
void ReferenceAngleBondIxn::getPrefactorsGivenAngleCosine(RealOpenMM cosine, RealOpenMM* angleParameters,
RealOpenMM* dEdR, RealOpenMM* energyTerm) const {
// ---------------------------------------------------------------------------------------
......@@ -91,9 +91,9 @@ void ReferenceAngleBondIxn::getPrefactorsGivenAngleCosine( RealOpenMM cosine, Re
// ---------------------------------------------------------------------------------------
RealOpenMM angle;
if( cosine >= one ){
if (cosine >= one) {
angle = zero;
} else if( cosine <= -one ){
} else if (cosine <= -one) {
angle = PI_M;
} else {
angle = ACOS(cosine);
......@@ -119,11 +119,11 @@ void ReferenceAngleBondIxn::getPrefactorsGivenAngleCosine( RealOpenMM cosine, Re
--------------------------------------------------------------------------------------- */
void ReferenceAngleBondIxn::calculateBondIxn( int* atomIndices,
void ReferenceAngleBondIxn::calculateBondIxn(int* atomIndices,
vector<RealVec>& atomCoordinates,
RealOpenMM* parameters,
vector<RealVec>& forces,
RealOpenMM* totalEnergy ) const {
RealOpenMM* totalEnergy) const {
// constants -- reduce Visual Studio warnings regarding conversions between float & double
......@@ -146,31 +146,31 @@ void ReferenceAngleBondIxn::calculateBondIxn( int* atomIndices,
int atomAIndex = atomIndices[0];
int atomBIndex = atomIndices[1];
int atomCIndex = atomIndices[2];
ReferenceForce::getDeltaR( atomCoordinates[atomAIndex], atomCoordinates[atomBIndex], deltaR[0] );
ReferenceForce::getDeltaR( atomCoordinates[atomCIndex], atomCoordinates[atomBIndex], deltaR[1] );
ReferenceForce::getDeltaR(atomCoordinates[atomAIndex], atomCoordinates[atomBIndex], deltaR[0]);
ReferenceForce::getDeltaR(atomCoordinates[atomCIndex], atomCoordinates[atomBIndex], deltaR[1]);
RealOpenMM pVector[threeI];
SimTKOpenMMUtilities::crossProductVector3( deltaR[0], deltaR[1], pVector );
RealOpenMM rp = DOT3( pVector, pVector );
rp = SQRT( rp );
if( rp < 1.0e-06 ){
SimTKOpenMMUtilities::crossProductVector3(deltaR[0], deltaR[1], pVector);
RealOpenMM rp = DOT3(pVector, pVector);
rp = SQRT(rp);
if (rp < 1.0e-06) {
rp = (RealOpenMM) 1.0e-06;
}
RealOpenMM dot = DOT3( deltaR[0], deltaR[1] );
RealOpenMM cosine = dot/SQRT( (deltaR[0][ReferenceForce::R2Index]*deltaR[1][ReferenceForce::R2Index]) );
RealOpenMM dot = DOT3(deltaR[0], deltaR[1]);
RealOpenMM cosine = dot/SQRT((deltaR[0][ReferenceForce::R2Index]*deltaR[1][ReferenceForce::R2Index]));
RealOpenMM dEdR;
RealOpenMM energy;
getPrefactorsGivenAngleCosine( cosine, parameters, &dEdR, &energy );
getPrefactorsGivenAngleCosine(cosine, parameters, &dEdR, &energy);
RealOpenMM termA = dEdR/(deltaR[0][ReferenceForce::R2Index]*rp);
RealOpenMM termC = -dEdR/(deltaR[1][ReferenceForce::R2Index]*rp);
RealOpenMM deltaCrossP[LastAtomIndex][threeI];
SimTKOpenMMUtilities::crossProductVector3( deltaR[0], pVector, deltaCrossP[0] );
SimTKOpenMMUtilities::crossProductVector3( deltaR[1], pVector, deltaCrossP[2] );
SimTKOpenMMUtilities::crossProductVector3(deltaR[0], pVector, deltaCrossP[0]);
SimTKOpenMMUtilities::crossProductVector3(deltaR[1], pVector, deltaCrossP[2]);
for( int ii = 0; ii < threeI; ii++ ){
for (int ii = 0; ii < threeI; ii++) {
deltaCrossP[0][ii] *= termA;
deltaCrossP[2][ii] *= termC;
deltaCrossP[1][ii] = oneM*(deltaCrossP[0][ii] + deltaCrossP[2][ii]);
......@@ -178,8 +178,8 @@ void ReferenceAngleBondIxn::calculateBondIxn( int* atomIndices,
// accumulate forces
for( int jj = 0; jj < LastAtomIndex; jj++ ){
for( int ii = 0; ii < threeI; ii++ ){
for (int jj = 0; jj < LastAtomIndex; jj++) {
for (int ii = 0; ii < threeI; ii++) {
forces[atomIndices[jj]][ii] += deltaCrossP[jj][ii];
}
}
......
......@@ -38,7 +38,7 @@ using namespace OpenMM;
--------------------------------------------------------------------------------------- */
ReferenceBondForce::ReferenceBondForce( ){
ReferenceBondForce::ReferenceBondForce() {
// ---------------------------------------------------------------------------------------
......@@ -54,7 +54,7 @@ ReferenceBondForce::ReferenceBondForce( ){
--------------------------------------------------------------------------------------- */
ReferenceBondForce::~ReferenceBondForce( ){
ReferenceBondForce::~ReferenceBondForce() {
// ---------------------------------------------------------------------------------------
......@@ -79,12 +79,12 @@ ReferenceBondForce::~ReferenceBondForce( ){
--------------------------------------------------------------------------------------- */
void ReferenceBondForce::calculateForce( int numberOfBonds, int** atomIndices,
void ReferenceBondForce::calculateForce(int numberOfBonds, int** atomIndices,
vector<RealVec>& atomCoordinates,
RealOpenMM** parameters,
vector<RealVec>& forces,
RealOpenMM *totalEnergy,
ReferenceBondIxn& referenceBondIxn ){
ReferenceBondIxn& referenceBondIxn) {
// ---------------------------------------------------------------------------------------
......@@ -93,12 +93,12 @@ void ReferenceBondForce::calculateForce( int numberOfBonds, int** atomIndices,
// ---------------------------------------------------------------------------------------
for( int ii = 0; ii < numberOfBonds; ii++ ){
for (int ii = 0; ii < numberOfBonds; ii++) {
// calculate bond ixn
referenceBondIxn.calculateBondIxn( atomIndices[ii], atomCoordinates, parameters[ii],
forces, totalEnergy );
referenceBondIxn.calculateBondIxn(atomIndices[ii], atomCoordinates, parameters[ii],
forces, totalEnergy);
}
}
......@@ -39,7 +39,7 @@ using namespace OpenMM;
--------------------------------------------------------------------------------------- */
ReferenceBondIxn::ReferenceBondIxn( ){
ReferenceBondIxn::ReferenceBondIxn() {
// ---------------------------------------------------------------------------------------
......@@ -55,7 +55,7 @@ ReferenceBondIxn::ReferenceBondIxn( ){
--------------------------------------------------------------------------------------- */
ReferenceBondIxn::~ReferenceBondIxn( ){
ReferenceBondIxn::~ReferenceBondIxn() {
// ---------------------------------------------------------------------------------------
......@@ -77,9 +77,9 @@ ReferenceBondIxn::~ReferenceBondIxn( ){
--------------------------------------------------------------------------------------- */
void ReferenceBondIxn::calculateBondIxn( int* atomIndices, vector<RealVec>& atomCoordinates,
void ReferenceBondIxn::calculateBondIxn(int* atomIndices, vector<RealVec>& atomCoordinates,
RealOpenMM* parameters, vector<RealVec>& forces,
RealOpenMM* totalEnergy ) const {
RealOpenMM* totalEnergy) const {
// ---------------------------------------------------------------------------------------
// static const std::string methodName = "\nReferenceBondIxn::calculateBondIxn";
......@@ -103,8 +103,8 @@ ReferenceBondIxn::~ReferenceBondIxn( ){
--------------------------------------------------------------------------------------- */
RealOpenMM ReferenceBondIxn::getNormedDotProduct( RealOpenMM* vector1, RealOpenMM* vector2,
int hasREntry = 0 ) {
RealOpenMM ReferenceBondIxn::getNormedDotProduct(RealOpenMM* vector1, RealOpenMM* vector2,
int hasREntry = 0) {
// ---------------------------------------------------------------------------------------
......@@ -123,35 +123,35 @@ RealOpenMM ReferenceBondIxn::getNormedDotProduct( RealOpenMM* vector1, RealOpenM
#if defined USE_DOUBLE_FOR_NORMED_DOT_PRODUCT
double v1D[3];
double v2D[3];
v1D[0] = static_cast<double>( vector1[0] );
v1D[1] = static_cast<double>( vector1[1] );
v1D[2] = static_cast<double>( vector1[2] );
v2D[0] = static_cast<double>( vector2[0] );
v2D[1] = static_cast<double>( vector2[1] );
v2D[2] = static_cast<double>( vector2[2] );
double dotProductD = DOT3( v1D, v2D );
if( dotProductD != 0.0 ){
if( hasREntry ){
dotProductD /= ( static_cast<double>(vector1[ReferenceForce::RIndex])*static_cast<double>(vector2[ReferenceForce::RIndex]) );
v1D[0] = static_cast<double>(vector1[0]);
v1D[1] = static_cast<double>(vector1[1]);
v1D[2] = static_cast<double>(vector1[2]);
v2D[0] = static_cast<double>(vector2[0]);
v2D[1] = static_cast<double>(vector2[1]);
v2D[2] = static_cast<double>(vector2[2]);
double dotProductD = DOT3(v1D, v2D);
if (dotProductD != 0.0) {
if (hasREntry) {
dotProductD /= (static_cast<double>(vector1[ReferenceForce::RIndex])*static_cast<double>(vector2[ReferenceForce::RIndex]));
} else {
double norm1 = DOT3( v1D, v1D );
double norm2 = DOT3( v2D, v2D);
dotProductD /= sqrt( norm1*norm2 );
double norm1 = DOT3(v1D, v1D);
double norm2 = DOT3(v2D, v2D);
dotProductD /= sqrt(norm1*norm2);
}
}
RealOpenMM dotProduct = static_cast<RealOpenMM>(dotProductD);
#else
RealOpenMM dotProduct = DOT3( vector1, vector2 );
if( dotProduct != zero ){
if( hasREntry ){
dotProduct /= ( vector1[ReferenceForce::RIndex]*vector2[ReferenceForce::RIndex] );
RealOpenMM dotProduct = DOT3(vector1, vector2);
if (dotProduct != zero) {
if (hasREntry) {
dotProduct /= (vector1[ReferenceForce::RIndex]*vector2[ReferenceForce::RIndex]);
} else {
RealOpenMM norm1 = DOT3( vector1, vector1 );
RealOpenMM norm2 = DOT3( vector2, vector2 );
dotProduct /= SQRT( norm1*norm2 );
RealOpenMM norm1 = DOT3(vector1, vector1);
RealOpenMM norm2 = DOT3(vector2, vector2);
dotProduct /= SQRT(norm1*norm2);
}
}
......@@ -160,9 +160,9 @@ RealOpenMM ReferenceBondIxn::getNormedDotProduct( RealOpenMM* vector1, RealOpenM
// clamp dot product to [-1,1]
if( dotProduct > one ){
if (dotProduct > one) {
dotProduct = one;
} else if( dotProduct < -one ){
} else if (dotProduct < -one) {
dotProduct = -one;
}
......@@ -184,9 +184,9 @@ RealOpenMM ReferenceBondIxn::getNormedDotProduct( RealOpenMM* vector1, RealOpenM
--------------------------------------------------------------------------------------- */
RealOpenMM ReferenceBondIxn::getAngleBetweenTwoVectors( RealOpenMM* vector1, RealOpenMM* vector2,
RealOpenMM* outputDotProduct = NULL,
int hasREntry = 0 ) {
RealOpenMM ReferenceBondIxn::getAngleBetweenTwoVectors(RealOpenMM* vector1, RealOpenMM* vector2,
RealOpenMM* outputDotProduct = NULL,
int hasREntry = 0) {
// ---------------------------------------------------------------------------------------
......@@ -199,7 +199,7 @@ RealOpenMM ReferenceBondIxn::getAngleBetweenTwoVectors( RealOpenMM* vector1, Rea
// get dot product betweenn vectors and then angle
RealOpenMM dotProduct = getNormedDotProduct( vector1, vector2, hasREntry );
RealOpenMM dotProduct = getNormedDotProduct(vector1, vector2, hasREntry);
RealOpenMM angle;
if (dotProduct > (RealOpenMM) 0.99 || dotProduct < (RealOpenMM) -0.99) {
......@@ -215,7 +215,7 @@ RealOpenMM ReferenceBondIxn::getAngleBetweenTwoVectors( RealOpenMM* vector1, Rea
angle = ACOS(dotProduct);
}
if( outputDotProduct ){
if (outputDotProduct) {
*outputDotProduct = dotProduct;
}
......@@ -241,14 +241,14 @@ RealOpenMM ReferenceBondIxn::getAngleBetweenTwoVectors( RealOpenMM* vector1, Rea
--------------------------------------------------------------------------------------- */
RealOpenMM ReferenceBondIxn::getDihedralAngleBetweenThreeVectors( RealOpenMM* vector1,
RealOpenMM* vector2,
RealOpenMM* vector3,
RealOpenMM** outputCrossProduct = NULL,
RealOpenMM* cosineOfAngle = NULL,
RealOpenMM* signVector = NULL,
RealOpenMM* signOfAngle = NULL,
int hasREntry = 0 ) {
RealOpenMM ReferenceBondIxn::getDihedralAngleBetweenThreeVectors(RealOpenMM* vector1,
RealOpenMM* vector2,
RealOpenMM* vector3,
RealOpenMM** outputCrossProduct = NULL,
RealOpenMM* cosineOfAngle = NULL,
RealOpenMM* signVector = NULL,
RealOpenMM* signOfAngle = NULL,
int hasREntry = 0) {
// ---------------------------------------------------------------------------------------
......@@ -264,7 +264,7 @@ RealOpenMM ReferenceBondIxn::getDihedralAngleBetweenThreeVectors( RealOpenMM* v
// get cross products between vectors and then angle between cross product vectors
RealOpenMM* crossProduct[2];
if( outputCrossProduct ){
if (outputCrossProduct) {
crossProduct[0] = outputCrossProduct[0];
crossProduct[1] = outputCrossProduct[1];
} else {
......@@ -272,17 +272,17 @@ RealOpenMM ReferenceBondIxn::getDihedralAngleBetweenThreeVectors( RealOpenMM* v
crossProduct[1] = tempVectors + 3;
}
SimTKOpenMMUtilities::crossProductVector3( vector1, vector2, crossProduct[0] );
SimTKOpenMMUtilities::crossProductVector3( vector2, vector3, crossProduct[1] );
SimTKOpenMMUtilities::crossProductVector3(vector1, vector2, crossProduct[0]);
SimTKOpenMMUtilities::crossProductVector3(vector2, vector3, crossProduct[1]);
RealOpenMM angle = getAngleBetweenTwoVectors( crossProduct[0], crossProduct[1], cosineOfAngle, 0 );
RealOpenMM angle = getAngleBetweenTwoVectors(crossProduct[0], crossProduct[1], cosineOfAngle, 0);
// take care of sign of angle
if( signVector ){
RealOpenMM dotProduct = DOT3( signVector, crossProduct[1] );
if (signVector) {
RealOpenMM dotProduct = DOT3(signVector, crossProduct[1]);
RealOpenMM sign = dotProduct < zero ? -one : one;
if( signOfAngle ){
if (signOfAngle) {
*signOfAngle = sign;
}
angle *= sign;
......
......@@ -47,10 +47,10 @@ using namespace OpenMM;
--------------------------------------------------------------------------------------- */
ReferenceBrownianDynamics::ReferenceBrownianDynamics( int numberOfAtoms,
ReferenceBrownianDynamics::ReferenceBrownianDynamics(int numberOfAtoms,
RealOpenMM deltaT, RealOpenMM friction,
RealOpenMM temperature ) :
ReferenceDynamics( numberOfAtoms, deltaT, temperature ), friction( friction ) {
RealOpenMM temperature) :
ReferenceDynamics(numberOfAtoms, deltaT, temperature), friction(friction) {
if (friction <= 0) {
std::stringstream message;
......@@ -67,7 +67,7 @@ ReferenceBrownianDynamics::ReferenceBrownianDynamics( int numberOfAtoms,
--------------------------------------------------------------------------------------- */
ReferenceBrownianDynamics::~ReferenceBrownianDynamics( ){
ReferenceBrownianDynamics::~ReferenceBrownianDynamics() {
// ---------------------------------------------------------------------------------------
......@@ -85,7 +85,7 @@ ReferenceBrownianDynamics::~ReferenceBrownianDynamics( ){
--------------------------------------------------------------------------------------- */
RealOpenMM ReferenceBrownianDynamics::getFriction( void ) const {
RealOpenMM ReferenceBrownianDynamics::getFriction() const {
// ---------------------------------------------------------------------------------------
......@@ -125,10 +125,10 @@ void ReferenceBrownianDynamics::update(const OpenMM::System& system, vector<Real
// first-time-through initialization
int numberOfAtoms = system.getNumParticles();
if( getTimeStep() == 0 ){
if (getTimeStep() == 0) {
// invert masses
for( int ii = 0; ii < numberOfAtoms; ii++ ){
for (int ii = 0; ii < numberOfAtoms; ii++) {
if (masses[ii] == zero)
inverseMasses[ii] = zero;
else
......@@ -138,7 +138,7 @@ void ReferenceBrownianDynamics::update(const OpenMM::System& system, vector<Real
// Perform the integration.
const RealOpenMM noiseAmplitude = static_cast<RealOpenMM>( sqrt(2.0*BOLTZ*getTemperature()*getDeltaT()/getFriction()) );
const RealOpenMM noiseAmplitude = static_cast<RealOpenMM>(sqrt(2.0*BOLTZ*getTemperature()*getDeltaT()/getFriction()));
const RealOpenMM forceScale = getDeltaT()/getFriction();
for (int i = 0; i < numberOfAtoms; ++i) {
if (masses[i] != zero)
......@@ -152,7 +152,7 @@ void ReferenceBrownianDynamics::update(const OpenMM::System& system, vector<Real
// Update the positions and velocities.
RealOpenMM velocityScale = static_cast<RealOpenMM>( 1.0/getDeltaT() );
RealOpenMM velocityScale = static_cast<RealOpenMM>(1.0/getDeltaT());
for (int i = 0; i < numberOfAtoms; ++i) {
if (masses[i] != zero)
for (int j = 0; j < 3; ++j) {
......
......@@ -61,7 +61,7 @@ ReferenceCustomAngleIxn::ReferenceCustomAngleIxn(const Lepton::CompiledExpressio
--------------------------------------------------------------------------------------- */
ReferenceCustomAngleIxn::~ReferenceCustomAngleIxn( ){
ReferenceCustomAngleIxn::~ReferenceCustomAngleIxn() {
// ---------------------------------------------------------------------------------------
......@@ -83,11 +83,11 @@ ReferenceCustomAngleIxn::~ReferenceCustomAngleIxn( ){
--------------------------------------------------------------------------------------- */
void ReferenceCustomAngleIxn::calculateBondIxn( int* atomIndices,
vector<RealVec>& atomCoordinates,
RealOpenMM* parameters,
vector<RealVec>& forces,
RealOpenMM* totalEnergy ) const {
void ReferenceCustomAngleIxn::calculateBondIxn(int* atomIndices,
vector<RealVec>& atomCoordinates,
RealOpenMM* parameters,
vector<RealVec>& forces,
RealOpenMM* totalEnergy) const {
static const std::string methodName = "\nReferenceCustomAngleIxn::calculateAngleIxn";
......
......@@ -61,7 +61,7 @@ ReferenceCustomBondIxn::ReferenceCustomBondIxn(const Lepton::CompiledExpression&
--------------------------------------------------------------------------------------- */
ReferenceCustomBondIxn::~ReferenceCustomBondIxn( ){
ReferenceCustomBondIxn::~ReferenceCustomBondIxn() {
// ---------------------------------------------------------------------------------------
......@@ -83,11 +83,11 @@ ReferenceCustomBondIxn::~ReferenceCustomBondIxn( ){
--------------------------------------------------------------------------------------- */
void ReferenceCustomBondIxn::calculateBondIxn( int* atomIndices,
vector<RealVec>& atomCoordinates,
RealOpenMM* parameters,
vector<RealVec>& forces,
RealOpenMM* totalEnergy ) const {
void ReferenceCustomBondIxn::calculateBondIxn(int* atomIndices,
vector<RealVec>& atomCoordinates,
RealOpenMM* parameters,
vector<RealVec>& forces,
RealOpenMM* totalEnergy) const {
static const std::string methodName = "\nReferenceCustomBondIxn::calculateBondIxn";
......@@ -109,7 +109,7 @@ void ReferenceCustomBondIxn::calculateBondIxn( int* atomIndices,
int atomAIndex = atomIndices[0];
int atomBIndex = atomIndices[1];
ReferenceForce::getDeltaR( atomCoordinates[atomAIndex], atomCoordinates[atomBIndex], deltaR );
ReferenceForce::getDeltaR(atomCoordinates[atomAIndex], atomCoordinates[atomBIndex], deltaR);
ReferenceForce::setVariable(energyR, deltaR[ReferenceForce::RIndex]);
ReferenceForce::setVariable(forceR, deltaR[ReferenceForce::RIndex]);
......
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