Commit 0a2439ce authored by Rafal P. Wiewiora's avatar Rafal P. Wiewiora
Browse files

Merge branch 'master' of https://github.com/rafwiewiora/openmm

parents c29de611 6ed5bc4e
......@@ -67,17 +67,13 @@ void* DrudeForceProxy::deserialize(const SerializationNode& node) const {
DrudeForce* force = new DrudeForce();
try {
const SerializationNode& particles = node.getChildNode("Particles");
for (int i = 0; i < (int) particles.getChildren().size(); i++) {
const SerializationNode& particle = particles.getChildren()[i];
for (auto& particle : particles.getChildren())
force->addParticle(particle.getIntProperty("p"), particle.getIntProperty("p1"), particle.getIntProperty("p2"), particle.getIntProperty("p3"), particle.getIntProperty("p4"),
particle.getDoubleProperty("charge"), particle.getDoubleProperty("polarizability"), particle.getDoubleProperty("a12"), particle.getDoubleProperty("a34"));
}
const SerializationNode& pairs = node.getChildNode("ScreenedPairs");
for (int i = 0; i < (int) pairs.getChildren().size(); i++) {
const SerializationNode& pair = pairs.getChildren()[i];
for (auto& pair : pairs.getChildren())
force->addScreenedPair(pair.getIntProperty("p1"), pair.getIntProperty("p2"), pair.getDoubleProperty("thole"));
}
}
catch (...) {
delete force;
throw;
......
This diff is collapsed.
......@@ -85,26 +85,19 @@ void* CustomAngleForceProxy::deserialize(const SerializationNode& node) const {
if (version > 1)
force->setUsesPeriodicBoundaryConditions(node.getBoolProperty("usesPeriodic"));
const SerializationNode& perAngleParams = node.getChildNode("PerAngleParameters");
for (int i = 0; i < (int) perAngleParams.getChildren().size(); i++) {
const SerializationNode& parameter = perAngleParams.getChildren()[i];
for (auto& parameter : perAngleParams.getChildren())
force->addPerAngleParameter(parameter.getStringProperty("name"));
}
const SerializationNode& globalParams = node.getChildNode("GlobalParameters");
for (int i = 0; i < (int) globalParams.getChildren().size(); i++) {
const SerializationNode& parameter = globalParams.getChildren()[i];
for (auto& parameter : globalParams.getChildren())
force->addGlobalParameter(parameter.getStringProperty("name"), parameter.getDoubleProperty("default"));
}
if (version > 2) {
const SerializationNode& energyDerivs = node.getChildNode("EnergyParameterDerivatives");
for (int i = 0; i < (int) energyDerivs.getChildren().size(); i++) {
const SerializationNode& parameter = energyDerivs.getChildren()[i];
for (auto& parameter : energyDerivs.getChildren())
force->addEnergyParameterDerivative(parameter.getStringProperty("name"));
}
}
const SerializationNode& angles = node.getChildNode("Angles");
vector<double> params(force->getNumPerAngleParameters());
for (int i = 0; i < (int) angles.getChildren().size(); i++) {
const SerializationNode& angle = angles.getChildren()[i];
for (auto& angle : angles.getChildren()) {
for (int j = 0; j < (int) params.size(); j++) {
stringstream key;
key << "param";
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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