IMP logo
Public Member Functions | Static Public Member Functions
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:
The bipartite method will also not return any pairs where both members are in the same rigid body.
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.
Do not reuse RigidClosePairsFinders for different sets of particles from the same rigid body.
import IMP
import IMP.core
import IMP.atom
# This example addes a restraint on nonbonded interactions
# Since it is between two rigid bodies, internal interactions are ignored
# The particles in the rigid bodies
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.add_particles(rbps0)
lsc.add_particles(rbps1)
# Set up the nonbonded list
# Set up excluded volume
evri= m.add_restraint(evr)
# Set up optimizer
o.set_model(m)
done=False
while not done:
try:
o.optimize(1000)
for d in [rbss0, rbss1]:
IMP.algebra.get_random_vector_in(IMP.algebra.BoundingBox3D(IMP.algebra.Vector3D(0,0,0),
IMP.algebra.Vector3D(10,10,10)))))
else:
done=True

The class RigidClosePairsFinder uses CGAL in order to improve its functionality. It will fall back on less good code without it.

See also:
ClosePairsScoreState
RigidBody
cover_members()

Examples: rigid collisions

+ Inheritance diagram for IMP::core::RigidClosePairsFinder:

List of all members.

Public Member Functions

 RigidClosePairsFinder (ClosePairsFinder *cpf=nullptr)
ParticlePairsTemp get_close_pairs (Particle *a, Particle *b, const ParticleIndexes &pa, const ParticleIndexes &pb) const
void set_distance (double d)
- Public Member Functions inherited from IMP::core::ClosePairsFinder
 ClosePairsFinder (std::string name)
virtual ParticlePairsTemp get_close_pairs (const ParticlesTemp &pc) const =0
virtual ParticlePairsTemp get_close_pairs (const ParticlesTemp &pca, const ParticlesTemp &pcb) const =0
virtual ParticleIndexPairs get_close_pairs (Model *m, const ParticleIndexes &pc) const
virtual ParticleIndexPairs get_close_pairs (Model *m, const ParticleIndexes &pca, const ParticleIndexes &pcb) const
virtual IntPairs get_close_pairs (const algebra::BoundingBox3Ds &bbs) const =0
virtual IntPairs get_close_pairs (const algebra::BoundingBox3Ds &bas, const algebra::BoundingBox3Ds &bbs) const =0
double get_distance () const
virtual ParticlesTemp get_input_particles (const ParticlesTemp &ps) const =0
virtual ContainersTemp get_input_containers (const ParticlesTemp &ps) const =0
void remove_pair_filter (PairPredicate *d)
template<class F >
void remove_pair_filters_if (const F &f)
template<class List >
void remove_pair_filters (List d)
template<class List >
void set_pair_filters (List ps)
template<class List >
void set_pair_filters_order (List ps)
unsigned int add_pair_filter (PairPredicate *obj)
template<class List >
void add_pair_filters (List objs)
void clear_pair_filters ()
unsigned int get_number_of_pair_filters () const
bool get_has_pair_filters () const
PairPredicateget_pair_filter (unsigned int i) const
PairPredicates get_pair_filters () const
void reserve_pair_filters (unsigned int sz)
PairFilterIterator pair_filters_begin ()
PairFilterIterator pair_filters_end ()
PairFilterConstIterator pair_filters_begin () const
PairFilterConstIterator pair_filters_end () const
- Public Member Functions inherited from IMP::base::Object
std::size_t __hash__ () const
virtual std::string get_type_name () const =0
 Return a string identifying the type of the object.
virtual IMP::base::VersionInfo get_version_info () const =0
 Get information about the module and version of the object.
void set_check_level (CheckLevel l)
void set_log_level (LogLevel l)
 Set the logging level used in this object.
void set_was_used (bool tf) const
void show (std::ostream &out=std::cout) const
const std::string & get_name () const
void set_name (std::string name)

Static Public Member Functions

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

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

Generated on Tue May 22 2012 23:33:31 for IMP by doxygen 1.8.1