"platforms/vscode:/vscode.git/clone" did not exist on "8382f88c8782ff1f2ad93f68db7b44cf8797d54e"
Commit b723e4af authored by Peter Eastman's avatar Peter Eastman
Browse files

Replaced lots of tabs with spaces

parent 93c467b2
...@@ -88,14 +88,14 @@ void testEwaldExact() { ...@@ -88,14 +88,14 @@ void testEwaldExact() {
// The potential energy of an ion in a crystal is // The potential energy of an ion in a crystal is
// E = - (M*e^2/ 4*pi*epsilon0*a0), // E = - (M*e^2/ 4*pi*epsilon0*a0),
// where // where
// M : Madelung constant (dimensionless, for FCC cells such as NaCl it is 1.7476) // M : Madelung constant (dimensionless, for FCC cells such as NaCl it is 1.7476)
// e : 1.6022 × 10−19 C // e : 1.6022 × 10−19 C
// 4*pi*epsilon0 : 1.112 × 10−10 C²/(J m) // 4*pi*epsilon0: 1.112 × 10−10 C²/(J m)
// a0 : 0.282 x 10-9 m (perfect cell) // a0 : 0.282 x 10-9 m (perfect cell)
// //
// E is then the energy per pair of ions, so for our case // E is then the energy per pair of ions, so for our case
// E has to be divided by 2 (per ion), multiplied by N(avogadro), multiplied by number of particles, and divided by 1000 for kJ // E has to be divided by 2 (per ion), multiplied by N(avogadro), multiplied by number of particles, and divided by 1000 for kJ
double exactEnergy = - (1.7476 * 1.6022e-19 * 1.6022e-19 * 6.02214e+23 * numParticles) / (1.112e-10 * 0.282e-9 * 2 * 1000); double exactEnergy = - (1.7476 * 1.6022e-19 * 1.6022e-19 * 6.02214e+23 * numParticles) / (1.112e-10 * 0.282e-9 * 2 * 1000);
//cout << "exact\t\t: " << exactEnergy << endl; //cout << "exact\t\t: " << exactEnergy << endl;
//cout << "calc\t\t: " << state.getPotentialEnergy() << endl; //cout << "calc\t\t: " << state.getPotentialEnergy() << endl;
ASSERT_EQUAL_TOL(exactEnergy, state.getPotentialEnergy(), 100*EWALD_TOL); ASSERT_EQUAL_TOL(exactEnergy, state.getPotentialEnergy(), 100*EWALD_TOL);
......
...@@ -30,9 +30,9 @@ ...@@ -30,9 +30,9 @@
#if defined(OPENMM_AMOEBA_BUILDING_SHARED_LIBRARY) #if defined(OPENMM_AMOEBA_BUILDING_SHARED_LIBRARY)
#define OPENMM_EXPORT_AMOEBA __declspec(dllexport) #define OPENMM_EXPORT_AMOEBA __declspec(dllexport)
#elif defined(OPENMM_AMOEBA_BUILDING_STATIC_LIBRARY) || defined(OPENMM_AMOEBA_USE_STATIC_LIBRARIES) #elif defined(OPENMM_AMOEBA_BUILDING_STATIC_LIBRARY) || defined(OPENMM_AMOEBA_USE_STATIC_LIBRARIES)
#define OPENMM_EXPORT_AMOEBA #define OPENMM_EXPORT_AMOEBA
#else #else
#define OPENMM_EXPORT_AMOEBA __declspec(dllimport) // i.e., a client of a shared library #define OPENMM_EXPORT_AMOEBA __declspec(dllimport) // i.e., a client of a shared library
#endif #endif
#else #else
#define OPENMM_EXPORT_AMOEBA // Linux, Mac #define OPENMM_EXPORT_AMOEBA // Linux, Mac
......
...@@ -69,19 +69,19 @@ void AmoebaMultipoleForce::setCutoffDistance(double distance) { ...@@ -69,19 +69,19 @@ void AmoebaMultipoleForce::setCutoffDistance(double distance) {
cutoffDistance = distance; cutoffDistance = distance;
} }
double AmoebaMultipoleForce::getAEwald() const { double AmoebaMultipoleForce::getAEwald() const {
return aewald; return aewald;
} }
void AmoebaMultipoleForce::setAEwald(double inputAewald ) {
aewald = inputAewald;
}
int AmoebaMultipoleForce::getPmeBSplineOrder( void ) const { void AmoebaMultipoleForce::setAEwald(double inputAewald ) {
return pmeBSplineOrder; aewald = inputAewald;
} }
void AmoebaMultipoleForce::getPmeGridDimensions( std::vector<int>& gridDimension ) const { int AmoebaMultipoleForce::getPmeBSplineOrder( void ) const {
return pmeBSplineOrder;
}
void AmoebaMultipoleForce::getPmeGridDimensions( std::vector<int>& gridDimension ) const {
if( gridDimension.size() < 3 ){ if( gridDimension.size() < 3 ){
gridDimension.resize(3); gridDimension.resize(3);
} }
...@@ -93,15 +93,15 @@ void AmoebaMultipoleForce::getPmeGridDimensions( std::vector<int>& gridDimension ...@@ -93,15 +93,15 @@ void AmoebaMultipoleForce::getPmeGridDimensions( std::vector<int>& gridDimension
gridDimension[0] = gridDimension[1] = gridDimension[2] = 0; gridDimension[0] = gridDimension[1] = gridDimension[2] = 0;
} }
return; return;
} }
void AmoebaMultipoleForce::setPmeGridDimensions( const std::vector<int>& gridDimension ) { void AmoebaMultipoleForce::setPmeGridDimensions( const std::vector<int>& gridDimension ) {
pmeGridDimension.resize(3); pmeGridDimension.resize(3);
pmeGridDimension[0] = gridDimension[0]; pmeGridDimension[0] = gridDimension[0];
pmeGridDimension[1] = gridDimension[1]; pmeGridDimension[1] = gridDimension[1];
pmeGridDimension[2] = gridDimension[2]; pmeGridDimension[2] = gridDimension[2];
return; return;
} }
int AmoebaMultipoleForce::getMutualInducedMaxIterations( void ) const { int AmoebaMultipoleForce::getMutualInducedMaxIterations( void ) const {
return mutualInducedMaxIterations; return mutualInducedMaxIterations;
......
...@@ -1350,7 +1350,7 @@ static void setupAndGetForcesEnergyMultipoleLargeWater( AmoebaMultipoleForce::No ...@@ -1350,7 +1350,7 @@ static void setupAndGetForcesEnergyMultipoleLargeWater( AmoebaMultipoleForce::No
system.addForce(amoebaBondForce); system.addForce(amoebaBondForce);
static std::vector<Vec3> positions; // Static to work around bug in Visual Studio that makes compilation very very slow. static std::vector<Vec3> positions; // Static to work around bug in Visual Studio that makes compilation very very slow.
positions.resize(numberOfParticles); positions.resize(numberOfParticles);
positions[0] = Vec3( 8.0394300e-01, 5.8680350e-01, 4.9277700e-02 ); positions[0] = Vec3( 8.0394300e-01, 5.8680350e-01, 4.9277700e-02 );
positions[1] = Vec3( 7.5814940e-01, 5.0226660e-01, 4.0375900e-02 ); positions[1] = Vec3( 7.5814940e-01, 5.0226660e-01, 4.0375900e-02 );
...@@ -2040,7 +2040,7 @@ static void testPMEMutualPolarizationLargeWater( FILE* log ) { ...@@ -2040,7 +2040,7 @@ static void testPMEMutualPolarizationLargeWater( FILE* log ) {
cutoff, inputPmeGridDimension, testName, cutoff, inputPmeGridDimension, testName,
forces, energy, outputMultipoleMoments, inputGrid, outputGridPotential, log ); forces, energy, outputMultipoleMoments, inputGrid, outputGridPotential, log );
static std::vector<Vec3> expectedForces; // Static to work around bug in Visual Studio that makes compilation very very slow. static std::vector<Vec3> expectedForces; // Static to work around bug in Visual Studio that makes compilation very very slow.
expectedForces.resize(numberOfParticles); expectedForces.resize(numberOfParticles);
double expectedEnergy = -1.3268930e+04; double expectedEnergy = -1.3268930e+04;
......
...@@ -30,9 +30,9 @@ ...@@ -30,9 +30,9 @@
#if defined(OPENMM_AMOEBA_REFERENCE_BUILDING_SHARED_LIBRARY) #if defined(OPENMM_AMOEBA_REFERENCE_BUILDING_SHARED_LIBRARY)
#define OPENMM_AMOEBA_REFERENCE_EXPORT __declspec(dllexport) #define OPENMM_AMOEBA_REFERENCE_EXPORT __declspec(dllexport)
#elif defined(OPENMM_AMOEBA_REFERENCE_BUILDING_STATIC_LIBRARY) || defined(OPENMM_AMOEBA_REFERENCE_USE_STATIC_LIBRARIES) #elif defined(OPENMM_AMOEBA_REFERENCE_BUILDING_STATIC_LIBRARY) || defined(OPENMM_AMOEBA_REFERENCE_USE_STATIC_LIBRARIES)
#define OPENMM_AMOEBA_REFERENCE_EXPORT #define OPENMM_AMOEBA_REFERENCE_EXPORT
#else #else
#define OPENMM_AMOEBA_REFERENCE_EXPORT __declspec(dllimport) // i.e., a client of a shared library #define OPENMM_AMOEBA_REFERENCE_EXPORT __declspec(dllimport) // i.e., a client of a shared library
#endif #endif
#else #else
#define OPENMM_AMOEBA_REFERENCE_EXPORT // Linux, Mac #define OPENMM_AMOEBA_REFERENCE_EXPORT // Linux, Mac
......
...@@ -1686,7 +1686,7 @@ RealOpenMM AmoebaReferenceMultipoleForce::calculateElectrostaticPotentialForPart ...@@ -1686,7 +1686,7 @@ RealOpenMM AmoebaReferenceMultipoleForce::calculateElectrostaticPotentialForPart
getPeriodicDelta( deltaR ); getPeriodicDelta( deltaR );
RealOpenMM r2 = deltaR.dot( deltaR ); RealOpenMM r2 = deltaR.dot( deltaR );
RealOpenMM r = SQRT( r2 ); RealOpenMM r = SQRT( r2 );
RealOpenMM rr1 = 1.0/r; RealOpenMM rr1 = 1.0/r;
...@@ -3777,7 +3777,7 @@ RealOpenMM AmoebaReferenceGeneralizedKirkwoodMultipoleForce::calculateKirkwoodED ...@@ -3777,7 +3777,7 @@ RealOpenMM AmoebaReferenceGeneralizedKirkwoodMultipoleForce::calculateKirkwoodED
RealOpenMM yr = deltaR[1]; RealOpenMM yr = deltaR[1];
RealOpenMM zr = deltaR[2]; RealOpenMM zr = deltaR[2];
r = SQRT(r2); r = SQRT(r2);
rr1 = 1.0/r; rr1 = 1.0/r;
rr3 = rr1/r2; rr3 = rr1/r2;
rr5 = 3.0*rr3/r2; rr5 = 3.0*rr3/r2;
......
...@@ -1256,7 +1256,7 @@ static void setupAndGetForcesEnergyMultipoleLargeWater( AmoebaMultipoleForce::No ...@@ -1256,7 +1256,7 @@ static void setupAndGetForcesEnergyMultipoleLargeWater( AmoebaMultipoleForce::No
system.addForce(amoebaMultipoleForce); system.addForce(amoebaMultipoleForce);
static std::vector<Vec3> positions; // Static to work around bug in Visual Studio that makes compilation very very slow. static std::vector<Vec3> positions; // Static to work around bug in Visual Studio that makes compilation very very slow.
positions.resize(numberOfParticles); positions.resize(numberOfParticles);
positions[0] = Vec3( 8.0394300e-01, 5.8680350e-01, 4.9277700e-02 ); positions[0] = Vec3( 8.0394300e-01, 5.8680350e-01, 4.9277700e-02 );
positions[1] = Vec3( 7.5814940e-01, 5.0226660e-01, 4.0375900e-02 ); positions[1] = Vec3( 7.5814940e-01, 5.0226660e-01, 4.0375900e-02 );
...@@ -1947,7 +1947,7 @@ static void testPMEMutualPolarizationLargeWater( FILE* log ) { ...@@ -1947,7 +1947,7 @@ static void testPMEMutualPolarizationLargeWater( FILE* log ) {
cutoff, inputPmeGridDimension, testName, cutoff, inputPmeGridDimension, testName,
forces, energy, outputMultipoleMoments, inputGrid, outputGridPotential, log ); forces, energy, outputMultipoleMoments, inputGrid, outputGridPotential, log );
static std::vector<Vec3> expectedForces; // Static to work around bug in Visual Studio that makes compilation very very slow. static std::vector<Vec3> expectedForces; // Static to work around bug in Visual Studio that makes compilation very very slow.
expectedForces.resize(numberOfParticles); expectedForces.resize(numberOfParticles);
double expectedEnergy = -1.3268930e+04; double expectedEnergy = -1.3268930e+04;
......
...@@ -30,9 +30,9 @@ ...@@ -30,9 +30,9 @@
#if defined(OPENMM_AMOEBA_SERIALIZATION_BUILDING_SHARED_LIBRARY) #if defined(OPENMM_AMOEBA_SERIALIZATION_BUILDING_SHARED_LIBRARY)
#define OPENMM_EXPORT_AMOEBA_SERIALIZATION __declspec(dllexport) #define OPENMM_EXPORT_AMOEBA_SERIALIZATION __declspec(dllexport)
#elif defined(OPENMM_AMOEBA_SERIALIZATION_BUILDING_STATIC_LIBRARY) || defined(OPENMM_AMOEBA_SERIALIZATION_USE_STATIC_LIBRARIES) #elif defined(OPENMM_AMOEBA_SERIALIZATION_BUILDING_STATIC_LIBRARY) || defined(OPENMM_AMOEBA_SERIALIZATION_USE_STATIC_LIBRARIES)
#define OPENMM_EXPORT_AMOEBA_SERIALIZATION #define OPENMM_EXPORT_AMOEBA_SERIALIZATION
#else #else
#define OPENMM_EXPORT_AMOEBA_SERIALIZATION __declspec(dllimport) // i.e., a client of a shared library #define OPENMM_EXPORT_AMOEBA_SERIALIZATION __declspec(dllimport) // i.e., a client of a shared library
#endif #endif
#else #else
#define OPENMM_EXPORT_AMOEBA_SERIALIZATION // Linux, Mac #define OPENMM_EXPORT_AMOEBA_SERIALIZATION // Linux, Mac
......
...@@ -30,9 +30,9 @@ ...@@ -30,9 +30,9 @@
#if defined(OPENMM_RPMD_BUILDING_SHARED_LIBRARY) #if defined(OPENMM_RPMD_BUILDING_SHARED_LIBRARY)
#define OPENMM_EXPORT_RPMD __declspec(dllexport) #define OPENMM_EXPORT_RPMD __declspec(dllexport)
#elif defined(OPENMM_RPMD_BUILDING_STATIC_LIBRARY) || defined(OPENMM_RPMD_USE_STATIC_LIBRARIES) #elif defined(OPENMM_RPMD_BUILDING_STATIC_LIBRARY) || defined(OPENMM_RPMD_USE_STATIC_LIBRARIES)
#define OPENMM_EXPORT_RPMD #define OPENMM_EXPORT_RPMD
#else #else
#define OPENMM_EXPORT_RPMD __declspec(dllimport) // i.e., a client of a shared library #define OPENMM_EXPORT_RPMD __declspec(dllimport) // i.e., a client of a shared library
#endif #endif
#else #else
#define OPENMM_EXPORT_RPMD // Linux, Mac #define OPENMM_EXPORT_RPMD // Linux, Mac
......
...@@ -53,9 +53,9 @@ void* LangevinIntegratorProxy::deserialize(const SerializationNode& node) const ...@@ -53,9 +53,9 @@ void* LangevinIntegratorProxy::deserialize(const SerializationNode& node) const
if (node.getIntProperty("version") != 1 && node.getIntProperty("version") != 2) if (node.getIntProperty("version") != 1 && node.getIntProperty("version") != 2)
throw OpenMMException("Unsupported version number"); throw OpenMMException("Unsupported version number");
LangevinIntegrator *integrator = new LangevinIntegrator(node.getDoubleProperty("temperature"), LangevinIntegrator *integrator = new LangevinIntegrator(node.getDoubleProperty("temperature"),
node.getDoubleProperty("friction"), node.getDoubleProperty("friction"),
node.getDoubleProperty("stepSizeInPs")); node.getDoubleProperty("stepSizeInPs"));
integrator->setConstraintTolerance(node.getDoubleProperty("constraintTolerance")); integrator->setConstraintTolerance(node.getDoubleProperty("constraintTolerance"));
integrator->setRandomNumberSeed(node.getIntProperty("randomSeed")); integrator->setRandomNumberSeed(node.getIntProperty("randomSeed"));
return integrator; return integrator;
} }
\ No newline at end of file
...@@ -111,7 +111,7 @@ extern "C" void registerSerializationProxies() { ...@@ -111,7 +111,7 @@ extern "C" void registerSerializationProxies() {
SerializationProxy::registerProxy(typeid(PeriodicTorsionForce), new PeriodicTorsionForceProxy()); SerializationProxy::registerProxy(typeid(PeriodicTorsionForce), new PeriodicTorsionForceProxy());
SerializationProxy::registerProxy(typeid(RBTorsionForce), new RBTorsionForceProxy()); SerializationProxy::registerProxy(typeid(RBTorsionForce), new RBTorsionForceProxy());
SerializationProxy::registerProxy(typeid(System), new SystemProxy()); SerializationProxy::registerProxy(typeid(System), new SystemProxy());
SerializationProxy::registerProxy(typeid(State), new StateProxy()); SerializationProxy::registerProxy(typeid(State), new StateProxy());
SerializationProxy::registerProxy(typeid(VerletIntegrator), new VerletIntegratorProxy()); SerializationProxy::registerProxy(typeid(VerletIntegrator), new VerletIntegratorProxy());
SerializationProxy::registerProxy(typeid(LangevinIntegrator), new LangevinIntegratorProxy()); SerializationProxy::registerProxy(typeid(LangevinIntegrator), new LangevinIntegratorProxy());
} }
\ No newline at end of file
...@@ -74,7 +74,7 @@ void StateProxy::serialize(const void* object, SerializationNode& node) const { ...@@ -74,7 +74,7 @@ void StateProxy::serialize(const void* object, SerializationNode& node) const {
SerializationNode& positionsNode = node.createChildNode("Positions"); SerializationNode& positionsNode = node.createChildNode("Positions");
vector<Vec3> statePositions = s.getPositions(); vector<Vec3> statePositions = s.getPositions();
for (int i=0; i<statePositions.size();i++) { for (int i=0; i<statePositions.size();i++) {
positionsNode.createChildNode("Position").setDoubleProperty("x", statePositions[i][0]).setDoubleProperty("y", statePositions[i][1]).setDoubleProperty("z", statePositions[i][2]); positionsNode.createChildNode("Position").setDoubleProperty("x", statePositions[i][0]).setDoubleProperty("y", statePositions[i][1]).setDoubleProperty("z", statePositions[i][2]);
} }
} catch (const OpenMMException &) { } catch (const OpenMMException &) {
// do nothing // do nothing
...@@ -84,7 +84,7 @@ void StateProxy::serialize(const void* object, SerializationNode& node) const { ...@@ -84,7 +84,7 @@ void StateProxy::serialize(const void* object, SerializationNode& node) const {
SerializationNode& velocitiesNode = node.createChildNode("Velocities"); SerializationNode& velocitiesNode = node.createChildNode("Velocities");
vector<Vec3> stateVelocities = s.getVelocities(); vector<Vec3> stateVelocities = s.getVelocities();
for (int i=0; i<stateVelocities.size();i++) { for (int i=0; i<stateVelocities.size();i++) {
velocitiesNode.createChildNode("Velocity").setDoubleProperty("x", stateVelocities[i][0]).setDoubleProperty("y", stateVelocities[i][1]).setDoubleProperty("z", stateVelocities[i][2]); velocitiesNode.createChildNode("Velocity").setDoubleProperty("x", stateVelocities[i][0]).setDoubleProperty("y", stateVelocities[i][1]).setDoubleProperty("z", stateVelocities[i][2]);
} }
} catch (const OpenMMException &) { } catch (const OpenMMException &) {
// do nothing // do nothing
...@@ -94,7 +94,7 @@ void StateProxy::serialize(const void* object, SerializationNode& node) const { ...@@ -94,7 +94,7 @@ void StateProxy::serialize(const void* object, SerializationNode& node) const {
SerializationNode& forcesNode = node.createChildNode("Forces"); SerializationNode& forcesNode = node.createChildNode("Forces");
vector<Vec3> stateForces = s.getForces(); vector<Vec3> stateForces = s.getForces();
for (int i=0; i<stateForces.size();i++) { for (int i=0; i<stateForces.size();i++) {
forcesNode.createChildNode("Force").setDoubleProperty("x", stateForces[i][0]).setDoubleProperty("y", stateForces[i][1]).setDoubleProperty("z", stateForces[i][2]); forcesNode.createChildNode("Force").setDoubleProperty("x", stateForces[i][0]).setDoubleProperty("y", stateForces[i][1]).setDoubleProperty("z", stateForces[i][2]);
} }
} catch (const OpenMMException &) { } catch (const OpenMMException &) {
// do nothing // do nothing
...@@ -198,5 +198,5 @@ void* StateProxy::deserialize(const SerializationNode& node) const { ...@@ -198,5 +198,5 @@ void* StateProxy::deserialize(const SerializationNode& node) const {
builder.setPeriodicBoxVectors(outAVec, outBVec, outCVec); builder.setPeriodicBoxVectors(outAVec, outBVec, outCVec);
State *s = new State(); State *s = new State();
*s = builder.getState(); *s = builder.getState();
return s; return s;
} }
\ No newline at end of file
...@@ -53,5 +53,5 @@ void* VerletIntegratorProxy::deserialize(const SerializationNode& node) const { ...@@ -53,5 +53,5 @@ void* VerletIntegratorProxy::deserialize(const SerializationNode& node) const {
double constraintTol = node.getDoubleProperty("constraintTolerance"); double constraintTol = node.getDoubleProperty("constraintTolerance");
VerletIntegrator *integrator = new VerletIntegrator(stepSize); VerletIntegrator *integrator = new VerletIntegrator(stepSize);
integrator->setConstraintTolerance(constraintTol); integrator->setConstraintTolerance(constraintTol);
return integrator; return integrator;
} }
\ No newline at end of file
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