Commit 3862202e authored by Justin MacCallum's avatar Justin MacCallum
Browse files

Merge branch 'upstream' into fork

parents e1a4e015 73882ac5
......@@ -34,8 +34,8 @@
#include "ReferencePlatform.h"
#include "openmm/RpmdKernels.h"
#include "SimTKUtilities/RealVec.h"
#include "SimTKReference/fftpack.h"
#include "RealVec.h"
#include "fftpack.h"
namespace OpenMM {
......
......@@ -42,7 +42,7 @@
#include "openmm/System.h"
#include "openmm/RPMDIntegrator.h"
#include "openmm/VirtualSite.h"
#include "SimTKUtilities/SimTKOpenMMUtilities.h"
#include "SimTKOpenMMUtilities.h"
#include "sfmt/SFMT.h"
#include <iostream>
#include <vector>
......
......@@ -175,6 +175,7 @@ int main() {
verifyEvaluation("5*2", 10.0);
verifyEvaluation("2*3+4*5", 26.0);
verifyEvaluation("2^-3", 0.125);
verifyEvaluation("1e+2", 100.0);
verifyEvaluation("-x", 2.0, 3.0, -2.0);
verifyEvaluation("y^-x", 3.0, 2.0, 0.125);
verifyEvaluation("1/-x", 3.0, 2.0, -1.0/3.0);
......
......@@ -16,7 +16,7 @@
<H name="HOP3" parent="OP3"/>
</Residue>
<Residue name="ACE">
<H name="H" parent="C"/>
<H name="H" parent="C" terminal="C"/>
<H name="H1" parent="CH3"/>
<H name="H2" parent="CH3"/>
<H name="H3" parent="CH3"/>
......@@ -313,7 +313,7 @@
<H name="H1" parent="C"/>
<H name="H2" parent="C"/>
<H name="H3" parent="C"/>
<H name="HN2" parent="N"/>
<H name="HN2" parent="N" terminal="N"/>
</Residue>
<Residue name="ORN">
<H name="H" parent="N"/>
......
......@@ -1046,6 +1046,13 @@ class GBSAOBCGenerator:
force.setSolventDielectric(float(args['solventDielectric']))
sys.addForce(force)
def postprocessSystem(self, sys, data, args):
# Disable the reaction field approximation, since it produces bad results when combined with GB.
for force in sys.getForces():
if isinstance(force, mm.NonbondedForce):
force.setReactionFieldDielectric(1.0)
parsers["GBSAOBCForce"] = GBSAOBCGenerator.parseElement
......
......@@ -448,6 +448,7 @@ class GromacsTopFile(object):
gb.setSoluteDielectric(soluteDielectric)
gb.setSolventDielectric(solventDielectric)
sys.addForce(gb)
nb.setReactionFieldDielectric(1.0)
elif implicitSolvent is not None:
raise ValueError('Illegal value for implicitSolvent')
bonds = None
......
......@@ -824,6 +824,7 @@ def readAmberSystem(prmtop_filename=None, prmtop_loader=None, shake=None, gbmode
gb.setCutoffDistance(nonbondedCutoff)
else:
raise Exception("Illegal nonbonded method for use with GBSA")
force.setReactionFieldDielectric(1.0)
# TODO: Add GBVI terms?
......
......@@ -64,6 +64,14 @@ using namespace OpenMM;
%include OpenMM_headers.i
%pythoncode %{
# when we import * from the python module, we only want to import the
# actual classes, and not the swigregistration methods, which have already
# been called, and are now unneeded by the user code, and only pollute the
# namespace
__all__ = [k for k in locals().keys() if not k.endswith('_swigregister')]
%}
/*
%extend OpenMM::XmlSerializer {
%template(XmlSerializer_serialize_AndersenThermostat) XmlSerializer::serialize<AndersenThermostat>;
......
......@@ -5,6 +5,7 @@ try:
except:
pass
import sys
import math
RMIN_PER_SIGMA=math.pow(2, 1/6.0)
RVDW_PER_SIGMA=math.pow(2, 1/6.0)/2.0
......@@ -273,14 +274,15 @@ def stripUnits(args):
"""
newArgList=[]
for arg in args:
if unit.is_quantity(arg):
if 'numpy' in sys.modules and isinstance(arg, numpy.ndarray):
arg = arg.tolist()
elif unit.is_quantity(arg):
# JDC: Ugly workaround for OpenMM using 'bar' for fundamental pressure unit.
if arg.unit.is_compatible(unit.bar):
arg = arg / unit.bar
else:
arg=arg.value_in_unit_system(unit.md_unit_system)
# JDC: End workaround.
#arg=arg.value_in_unit_system(unit.md_unit_system)
elif isinstance(arg, dict):
newKeys = stripUnits(arg.keys())
newValues = stripUnits(arg.values())
......
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