IMP logo

IMP::core::RigidClosePairsFinder Class Reference


Detailed Description

Peform more efficient close pair finding when rigid bodies are involved.

The class finds all close pairs consisting of particles taken from the passed list(s) (if they are not rigid bodies) or members of rigid bodies passed as input. That is, given an input list l, for each pair of particles p, q taken from the list, that are closer than the distance threshold, it returns

Consequently, the user must ensure that the RigidBody are assigned a radius that encloses all of their RigidMember particles.

It uses another ClosePairsFinder to find which pairs of particles in the input list or lists are close. Your choice of this can be passed to the constructor.

Note:
Having CGAL makes the computations more efficient.

The bounding spheres are kept in internal coordinates for the rigid body and transformed on the fly. It would probably be faster to cache the tranformed results.

The particles are divided up using a grid. The number of grid cells to use should be explored. In addition, with highly excentric sets of points, there will be too many cells.

import IMP
import IMP.core
import IMP.atom
import IMP.helper
import IMP.container

# This example addes a restraint on nonbonded interactions
# Since it is between two rigid bodies, internal interactions are ignored

m= IMP.Model()
# The particles in the rigid bodies
rbps0= IMP.core.create_xyzr_particles(m, 3, 1)
rbps1= IMP.core.create_xyzr_particles(m, 3, 1)

rbp0= IMP.Particle(m)
rbp1= IMP.Particle(m)

rbss0 = IMP.core.RigidBody.setup_particle(rbp0, IMP.core.XYZs(rbps0))

rbss1 = IMP.core.RigidBody.setup_particle(rbp1, IMP.core.XYZs(rbps1))

lsc= IMP.container.ListSingletonContainer()
lsc.add_particle(rbp0)
lsc.add_particle(rbp1)

tr= IMP.core.TableRefiner()
tr.add_particle(rbp0, rbps0)
tr.add_particle(rbp1, rbps1)

# Set up the nonbonded list
nbl= IMP.container.ClosePairContainer(lsc, 0, IMP.core.RigidClosePairsFinder(tr), 2.0)

# Set up excluded volume
ps= IMP.core.SphereDistancePairScore(IMP.core.HarmonicLowerBound(0,1))
evr= IMP.container.PairsRestraint(ps, nbl)
evri= m.add_restraint(evr)

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

done=False
while not done:
    try:
        o.optimize(1000)
    except IMP.ModelException:
        for d in [rbss0, rbss1]:
            d.set_transformation(IMP.algebra.Transformation3D(IMP.algebra.get_random_rotation_3d(),
                                                              IMP.algebra.get_random_vector_in(IMP.algebra.BoundingBox3D(IMP.algebra.Vector3D(0,0,0),
                                                                                               IMP.algebra.Vector3D(10,10,10)))))
    else:
        done=True

Note:
This class uses the IMP::core::BoxSweepClosePairsFinder by default if CGAL is available.
See also:
ClosePairsScoreState

RigidBody

cover_members()

Inheritance diagram for IMP::core::RigidClosePairsFinder:

Inheritance graph
[legend]

Public Member Functions

ParticlePairsTemp get_close_pairs (Particle *a, Particle *b) const
ParticlePairsTemp get_close_pairs (SingletonContainer *pca, SingletonContainer *pcb) const
ParticlePairsTemp get_close_pairs (SingletonContainer *pc) const
ContainersTemp get_input_containers (SingletonContainer *a, SingletonContainer *b) const
ContainersTemp get_input_containers (SingletonContainer *pc) const
ParticlesTemp get_input_particles (SingletonContainer *a, SingletonContainer *b) const
ParticlesTemp get_input_particles (SingletonContainer *pc) const
internal::MovedSingletonContainer * get_moved_singleton_container (SingletonContainer *c, Model *m, double thresold) const
virtual std::string get_type_name () const
virtual ::IMP::VersionInfo get_version_info () const
 RigidClosePairsFinder (ClosePairsFinder *cpf, Refiner *r)
 RigidClosePairsFinder (Refiner *r)
 Use the default choice for the ClosePairsFinder.
void set_distance (double d)

Friends

template<class T >
void IMP::internal::unref (T *)

Constructor & Destructor Documentation

IMP::core::RigidClosePairsFinder::RigidClosePairsFinder ( Refiner r  ) 

Use the default choice for the ClosePairsFinder.

Use rep to generate the list of representation particles.


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

Generated on Mon Mar 8 23:08:57 2010 for IMP by doxygen 1.5.8