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"
19 IMPNPCTRANSPORT_BEGIN_NAMESPACE
24 class IMPNPCTRANSPORTEXPORT
94 void update_reference_point_for_pore_radius
99 AnchorToCylidnricalPorePairScore
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;
110 AnchorToCylidnricalPorePairScore
117 "pip[0] is not a SlabWithCylindricalPore in evaluate_index()");
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;
136 rp_to_xyz_norm = algebra::get_zero_vector_d<3>();
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];
145 m->add_to_coordinate_derivatives(pip[1], -deriv_on_rp, *da);
148 return ds_.get_score(m, pip, dist);
155 IMPNPCTRANSPORT_END_NAMESPACE
void add_to_pore_radius_derivative(double v, DerivativeAccumulator &d)
Abstract class for scoring object(s) of type ParticleIndexPair.
Macros for various classes.
#define IMP_PAIR_SCORE_METHODS(Name)
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
A more IMP-like version of the std::vector.
Class for storing model, its restraints, constraints, and particles.
A harmonic score on the directed distance between a pair of particles, centered at 0...
A decorator for a particle that's a slab with a cylindrical pore.
Float get_pore_radius() const
get cylindrical pore radius
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const =0
Overload this method to specify the inputs.
A decorator for a particle with x,y,z coordinates.
Helper macros for throwing and handling exceptions.
double Float
Basic floating-point value (could be float, double...)
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
Decorator for a sphere-like particle.
virtual double evaluate_index(Model *m, const ParticleIndexPair &vt, DerivativeAccumulator *da) const =0
Compute the score and the derivative if needed.
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
Class for adding derivatives from restraints to the model.