IMP logo
Public Member Functions | Static Public Member Functions
IMP::container::PairsRestraint Class Reference

Detailed Description

Applies a PairScore to each Pair in a list.

This restraint stores the used particles in a ParticlePairsTemp. The container used can be set so that the list can be shared with other containers (or a nonbonded list can be used). By default a ListPairContainer is used and the {add_, set_, clear_}particle_pair{s} methodas can be used.

Examples using various multiplicity containers:

import IMP.example
radius=10
stiffness=2
center= IMP.algebra.Vector3D(1,2,3)
(m,c)=IMP.example.create_model_and_particles()
ub= IMP.core.HarmonicUpperBound(radius, stiffness)

# Restrain based on the distance to a single point (hence a ball
ss= IMP.core.DistanceToSingletonScore(ub, center)

r= IMP.container.SingletonsRestraint(ss, c)
m.add_restraint(r)
m.evaluate(False)
import IMP
import IMP.core
import IMP.atom
import IMP.container

# This example addes a restraint on nonbonded interactions
# after excluding a set of bonded interactions.

m= IMP.Model()
# The set of particles
ps = IMP.container.ListSingletonContainer(IMP.core.create_xyzr_particles(m, 20, 1.0))

# create a bond between two particles
bd0= IMP.atom.Bonded.setup_particle(ps.get_particle(0))
bd1= IMP.atom.Bonded.setup_particle(ps.get_particle(1))
IMP.atom.create_custom_bond(bd0, bd1, 2.0)

# Set up the nonbonded list for all pairs at are touching
# and let things move 3 before updating the list
nbl= IMP.container.ClosePairContainer(ps, 0.0, 3.0)
nbl.add_pair_filter(IMP.atom.BondedPairFilter())

# Set up excluded volume
sdps= IMP.core.SoftSpherePairScore(1)
evr= IMP.container.PairsRestraint(sdps, nbl)
m.add_restraint(evr)

# Set up optimizer
o= IMP.core.ConjugateGradients()
o.set_model(m)

o.optimize(1000)
See also:
PairRestraint

Examples: chain, bipartite nonbonded interactions, nonbonded interactions, charmm forcefield verbose, initialize chains, custom filter, merge tree, basic optimization, rigid collisions, six particles optimization, interactive with containers, charmm forcefield, assess dope, interactive, optimize balls, excluded volume

+ Inheritance diagram for IMP::container::PairsRestraint:

List of all members.

Public Member Functions

 PairsRestraint (PairScore *ss, PairContainer *pc, std::string name="PairsRestraint %1%")
 Create the restraint with a shared container.
ParticlePairsTemp get_arguments () const
 Get the container used to store Particles.
PairContainerget_container () const
PairScoreget_score () const

Static Public Member Functions

static PairsRestraintget_from (IMP::base::Object *o)

Constructor & Destructor Documentation

IMP::container::PairsRestraint::PairsRestraint ( PairScore ss,
PairContainer pc,
std::string  name = "PairsRestraint %1%" 
)

Create the restraint with a shared container.

Parameters:
[in]ssThe function to apply to each particle.
[in]pcThe container containing the stored particles. This container is not copied.
[in]nameThe object name

Member Function Documentation

ParticlePairsTemp IMP::container::PairsRestraint::get_arguments ( ) const

Get the container used to store Particles.


The documentation for this class was generated from the following file:

Generated on Fri Feb 10 2012 23:36:25 for IMP by doxygen 1.7.5.1