8#ifndef IMPNPCTRANSPORT_ANCHOR_TO_CYLINDRICAL_PORE_PAIR_SCORE_H
9#define IMPNPCTRANSPORT_ANCHOR_TO_CYLINDRICAL_PORE_PAIR_SCORE_H
11#include "npctransport_config.h"
19IMPNPCTRANSPORT_BEGIN_NAMESPACE
24class IMPNPCTRANSPORTEXPORT
94 void update_reference_point_for_pore_radius
99AnchorToCylidnricalPorePairScore
100::update_reference_point_for_pore_radius
103 Float r= pr - pore_radial_d_;
104 reference_point_[0]= normalized_xy_[0]*r;
105 reference_point_[1]= normalized_xy_[1]*r;
110AnchorToCylidnricalPorePairScore
117 "pip[0] is not a SlabWithCylindricalPore in evaluate_index()");
119 update_reference_point_for_pore_radius(slab.get_pore_radius());
121 if(!xyz.get_coordinates_are_optimized()){
125 reference_point_ - xyz.get_coordinates();
126 double sq = rp_to_xyz.get_squared_magnitude();
127 double dist = std::sqrt(sq);
129 std::pair<double, double> sp =
130 ds_.get_score_and_derivative(m, pip, dist);
131 static const double MIN_DISTANCE = .00001;
133 if (dist > MIN_DISTANCE) {
134 rp_to_xyz_norm = rp_to_xyz / dist;
139 if(slab.get_pore_radius_is_optimized()){
141 double deriv_on_pore_radius_squared=
142 deriv_on_rp[0]*deriv_on_rp[0] + deriv_on_rp[1]*deriv_on_rp[1];
143 slab.add_to_pore_radius_derivative(sqrt(deriv_on_pore_radius_squared), *da);
145 m->add_to_coordinate_derivatives(pip[1], -deriv_on_rp, *da);
148 return ds_.get_score(m, pip, dist);
155IMPNPCTRANSPORT_END_NAMESPACE
A decorator for a particle that's a slab with a cylindrical pore.
Decorator for a sphere-like particle.
Helper macros for throwing and handling exceptions.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
Class for adding derivatives from restraints to the model.
Class for storing model, its restraints, constraints, and particles.
A decorator for a particle with x,y,z coordinates.
AnchorToCylidnricalPorePairScore(SlabWithCylindricalPore scp, algebra::Vector3D initial_anchor_point, Float k)
virtual double evaluate_index(Model *m, const ParticleIndexPair &pip, DerivativeAccumulator *da) const override
Evaluate score for particle pair pip in model m.
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const override
Overload this method to specify the inputs.
AnchorToCylidnricalPorePairScore(Float rot_angle, Float pore_radial_d, Float z, Float k)
VectorD< D > get_zero_vector_d()
Return a vector of zeros.
double Float
Basic floating-point value (could be float, double...).
Vector< ParticleIndex, std::allocator< ParticleIndex > > ParticleIndexes
A list of particles, each identified by its ParticleIndex.
Array< 2, ParticleIndex > ParticleIndexPair
An ordered pair of particles, each identified by its ParticleIndex.
IMP::Vector< IMP::WeakPointer< ModelObject > > ModelObjectsTemp
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Macros for various classes.
#define IMP_PAIR_SCORE_METHODS(Name)
A harmonic score on the directed distance between a pair of particles, centered at 0.