Unverified Commit 8f8aa247 authored by peastman's avatar peastman Committed by GitHub
Browse files

Merge pull request #2112 from peastman/cleanup

Code cleanup
parents 0d13f9cd c0e862f6
......@@ -69,9 +69,9 @@ void ReferenceRbDihedralBond::setPeriodic(OpenMM::Vec3* vectors) {
--------------------------------------------------------------------------------------- */
void ReferenceRbDihedralBond::calculateBondIxn(int* atomIndices,
void ReferenceRbDihedralBond::calculateBondIxn(vector<int>& atomIndices,
vector<Vec3>& atomCoordinates,
double* parameters,
vector<double>& parameters,
vector<Vec3>& forces,
double* totalEnergy, double* energyParamDerivs) {
// number of parameters
......
......@@ -45,17 +45,7 @@ using namespace std;
}
static string getErrorString(nvrtcResult result) {
switch (result) {
case NVRTC_SUCCESS: return "NVRTC_SUCCESS";
case NVRTC_ERROR_OUT_OF_MEMORY: return "NVRTC_ERROR_OUT_OF_MEMORY";
case NVRTC_ERROR_PROGRAM_CREATION_FAILURE: return "NVRTC_ERROR_PROGRAM_CREATION_FAILURE";
case NVRTC_ERROR_INVALID_INPUT: return "NVRTC_ERROR_INVALID_INPUT";
case NVRTC_ERROR_INVALID_PROGRAM: return "NVRTC_ERROR_INVALID_PROGRAM";
case NVRTC_ERROR_INVALID_OPTION: return "NVRTC_ERROR_INVALID_OPTION";
case NVRTC_ERROR_COMPILATION: return "NVRTC_ERROR_COMPILATION";
case NVRTC_ERROR_BUILTIN_OPERATION_FAILURE: return "NVRTC_ERROR_BUILTIN_OPERATION_FAILURE";
}
return "NVRTC error";
return nvrtcGetErrorString(result);
}
string CudaRuntimeCompilerKernel::createModule(const string& source, const string& flags, CudaContext& cu) {
......
......@@ -57,20 +57,21 @@ void SystemProxy::serialize(const void* object, SerializationNode& node) const {
for (int i = 0; i < system.getNumParticles(); i++) {
SerializationNode& particle = particles.createChildNode("Particle").setDoubleProperty("mass", system.getParticleMass(i));
if (system.isVirtualSite(i)) {
if (typeid(system.getVirtualSite(i)) == typeid(TwoParticleAverageSite)) {
const TwoParticleAverageSite& site = dynamic_cast<const TwoParticleAverageSite&>(system.getVirtualSite(i));
const VirtualSite& vsite = system.getVirtualSite(i);
if (typeid(vsite) == typeid(TwoParticleAverageSite)) {
const TwoParticleAverageSite& site = dynamic_cast<const TwoParticleAverageSite&>(vsite);
particle.createChildNode("TwoParticleAverageSite").setIntProperty("p1", site.getParticle(0)).setIntProperty("p2", site.getParticle(1)).setDoubleProperty("w1", site.getWeight(0)).setDoubleProperty("w2", site.getWeight(1));
}
else if (typeid(system.getVirtualSite(i)) == typeid(ThreeParticleAverageSite)) {
const ThreeParticleAverageSite& site = dynamic_cast<const ThreeParticleAverageSite&>(system.getVirtualSite(i));
else if (typeid(vsite) == typeid(ThreeParticleAverageSite)) {
const ThreeParticleAverageSite& site = dynamic_cast<const ThreeParticleAverageSite&>(vsite);
particle.createChildNode("ThreeParticleAverageSite").setIntProperty("p1", site.getParticle(0)).setIntProperty("p2", site.getParticle(1)).setIntProperty("p3", site.getParticle(2)).setDoubleProperty("w1", site.getWeight(0)).setDoubleProperty("w2", site.getWeight(1)).setDoubleProperty("w3", site.getWeight(2));
}
else if (typeid(system.getVirtualSite(i)) == typeid(OutOfPlaneSite)) {
const OutOfPlaneSite& site = dynamic_cast<const OutOfPlaneSite&>(system.getVirtualSite(i));
else if (typeid(vsite) == typeid(OutOfPlaneSite)) {
const OutOfPlaneSite& site = dynamic_cast<const OutOfPlaneSite&>(vsite);
particle.createChildNode("OutOfPlaneSite").setIntProperty("p1", site.getParticle(0)).setIntProperty("p2", site.getParticle(1)).setIntProperty("p3", site.getParticle(2)).setDoubleProperty("w12", site.getWeight12()).setDoubleProperty("w13", site.getWeight13()).setDoubleProperty("wc", site.getWeightCross());
}
else if (typeid(system.getVirtualSite(i)) == typeid(LocalCoordinatesSite)) {
const LocalCoordinatesSite& site = dynamic_cast<const LocalCoordinatesSite&>(system.getVirtualSite(i));
else if (typeid(vsite) == typeid(LocalCoordinatesSite)) {
const LocalCoordinatesSite& site = dynamic_cast<const LocalCoordinatesSite&>(vsite);
int numParticles = site.getNumParticles();
vector<double> wo, wx, wy;
site.getOriginWeights(wo);
......
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