00001
00002
00003
00004
00005
00006
00007
00008 #ifndef IMPATOM_LENNARD_JONES_PAIR_SCORE_H
00009 #define IMPATOM_LENNARD_JONES_PAIR_SCORE_H
00010
00011 #include "atom_config.h"
00012 #include <IMP/PairScore.h>
00013 #include <IMP/Pointer.h>
00014 #include <IMP/atom/LennardJones.h>
00015 #include <IMP/atom/smoothing_functions.h>
00016
00017 IMPATOM_BEGIN_NAMESPACE
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 class IMPATOMEXPORT LennardJonesPairScore : public PairScore
00041 {
00042 IMP::internal::OwnerPointer<SmoothingFunction> smoothing_function_;
00043 double repulsive_weight_, attractive_weight_;
00044
00045
00046
00047
00048 inline void get_factors(const LennardJones &lj0, const LennardJones &lj1,
00049 double &A, double &B) const {
00050 double well_depth = std::sqrt(lj0.get_well_depth() * lj1.get_well_depth());
00051 double rmin = lj0.get_radius() + lj1.get_radius();
00052
00053
00054 double rmin6 = rmin * rmin * rmin * rmin * rmin * rmin;
00055 double rmin12 = rmin6 * rmin6;
00056
00057 A = well_depth * rmin12 * repulsive_weight_;
00058 B = 2.0 * well_depth * rmin6 * attractive_weight_;
00059 }
00060
00061 public:
00062 LennardJonesPairScore(SmoothingFunction *f)
00063 : smoothing_function_(f), repulsive_weight_(1.0), attractive_weight_(1.0) {}
00064
00065 void set_repulsive_weight(double repulsive_weight) {
00066 repulsive_weight_ = repulsive_weight;
00067 }
00068
00069 double get_repulsive_weight() const { return repulsive_weight_; }
00070
00071 void set_attractive_weight(double attractive_weight) {
00072 attractive_weight_ = attractive_weight;
00073 }
00074
00075 double get_attractive_weight() const { return attractive_weight_; }
00076
00077 IMP_SIMPLE_PAIR_SCORE(LennardJonesPairScore);
00078 };
00079
00080 IMPATOM_END_NAMESPACE
00081
00082 #endif