-
Notifications
You must be signed in to change notification settings - Fork 36
Python_MDSetup
When using explicit solvent periodic boundary conditions have to be used.
NOTE: Running the following script in BALLView creates a large number of representations (water molecules) as well. To reduce runnging time set the default representation to 'Line Model' before.
{{{ #!python
af = AmberFF()
s = getSystem(0)
bbp = BoundingBoxProcessor() s.apply(bbp)
sc = 10.
vl = bbp.getLower() - Vector3(sc) vu = bbp.getUpper() + Vector3(sc)
af.options.setBool("periodic_box_enabled", True) af.options.setVector("periodic_box_lower", vl) af.options.setVector("periodic_box_upper", vu)
af.setup(s)
b = SimpleBox3() b.set(vl, vu)
p = PeriodicBoundary(af)
p.setBox(b)
p.setup()
new_box = p.getBox()
v1 = new_box.a # get the anchor v2 = Vector3(new_box.getWidth(), 0, 0) v3 = Vector3(0, new_box.getHeight(), 0) v4 = Vector3(0, 0, new_box.getDepth())
colored_box = Box(v1, v2, v3, v4) colored_box.setColor(ColorRGBA(1, 0, 0, 0.8)) r = Representation() r.insert(colored_box)
getMainControl().insert(r) getMainControl().update(r)
getMainControl().updateRepresentationsOf(s)
}}}